public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Wrong code generated for Hitachi SH
@ 2000-03-22  2:18 Michael Schwingen
  2000-03-22  8:54 ` Joern Rennecke
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Schwingen @ 2000-03-22  2:18 UTC (permalink / raw)
  To: gcc

Hello,

I have a problem when cross-compiling for sh-coff. The following program

unsigned int test(unsigned int x)
{
  return 1000 + x;
}

yields the following result when compiling with -O2:
/opt/cgcc/bin/sh-coff-gcc -fomit-frame-pointer -m3 -O2 -S hello.c
        .file   "hello.c"
        .data
gcc2_compiled.:
___gnu_compiled_c:
        .text
        .align 4
        .global _test
_test:
        mov.w   L3,r0
        rts
        nop
        .align 1
L3:
        .short  1000

As you can see, the addition is never performed - the routine always returns
1000. 

(leaving out -fomit-frame-pointer or -m3 changes nothing, and with -O1 the
output is fine).

This happens with both gcc-2.95.2 and the 20000221 snapshot (the 20000230
snapshot does not compile). egcs 1.1b did not have this problem. The same
compiler, built for a powerpc-eabi target, produced correct code.

This happens both on a linux-i686 and a cygwin host.

Any ideas?

cu
Michael
-- 
In the beginning there was nothing, which exploded.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-04-11  8:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-22  2:18 Wrong code generated for Hitachi SH Michael Schwingen
2000-03-22  8:54 ` Joern Rennecke
2000-03-23  5:20   ` Michael Schwingen
2000-04-11  2:41   ` Wrong code generated for Hitachi SH, and compilation problems with recent snapshots Michael Schwingen
2000-04-11  8:07     ` Wrong code generated for Hitachi SH, and compilation problems withrecent snapshots Joern Rennecke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).