Path: utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bbn!mailrus!tut.cis.ohio-state.edu!"Richard From: "Richard@tut.cis.ohio-state.edu Newsgroups: gnu.gcc.bug Subject: bug in gcc v1.32 Sun 3 SunOS 4.0.1 Message-ID: <8901261256.AA01602@marvin.moncam.uucp> Date: 26 Jan 89 12:56:17 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 41 /* The following trivial function demonstrates a bug in gcc v1.32 for a 68020 running SunOS 4.0.1 When compiled by gcc v1.32 without any optimisation, the compiler produces the following code, which appears to be correct. #NO_APP gcc_compiled.: .text .even .globl _fred _fred: link a6,#-4 moveb a6@(11),a6@(-1) L1: unlk a6 rts When compiled with "-O", it produces the following code, which extracts the MSB of the parameter rather than the LSB. #NO_APP gcc_compiled.: .text .even .globl _fred _fred: link a6,#-4 moveb a6@(8),d0 moveb d0,a6@(-1) unlk a6 rts */ fred( int j ) { volatile char x; x = j; }