Xref: utzoo comp.bugs.misc:207 comp.bugs.sys5:815 comp.lang.c:17132 comp.unix.wizards:15169 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!iconsys!bryan From: bryan@iconsys.UUCP (Bryan Cardoza) Newsgroups: comp.bugs.misc,comp.bugs.sys5,comp.lang.c,comp.unix.wizards Subject: Need help with C bug. Keywords: pcc2 char array code generation Message-ID: <349@iconsys.UUCP> Date: 21 Mar 89 23:27:10 GMT Reply-To: bryan@iconsys.UUCP (Bryan Cardoza) Followup-To: comp.bugs.misc Distribution: usa Organization: Icon International, Inc. -- Orem, Utah Lines: 33 Has anyone isolated the following pcc2 bug? (I assume it is a bug.) We have a Mot SVR2 based compiler. char p[50]; main() { printf("p = 0x%08X\n", p); if (p) printf("ok\n"); else printf("bad berries\n"); } When run, this it says: p = 0x00002F84 bad berries The relevant m68k assembly code is: mov.l &_p,(%sp) # This is correct mov.l &L%15,-(%sp) jsr _printf add.l &4,%sp tst.l _p # OOPS! This should be "&_p". Any pointers? -- Bryan Cardoza uunet!iconsys!bryan Software Engineer SANYO/ICON Telephone: (801) 225-6888 Orem, Utah FAX: (801) 226-0651