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

* Re: Wrong code generated for Hitachi SH
  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
  0 siblings, 2 replies; 5+ messages in thread
From: Joern Rennecke @ 2000-03-22  8:54 UTC (permalink / raw)
  To: Michael Schwingen; +Cc: gcc

> 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.

There was no 20000230 snapshot (or a 30th Febuary, for that matter), so
don't know what you did try to compile that failed.  At any rate, I've
recently applied a patch to reload to fix a bug like the one you have seen:

Fri Mar  3 12:49:28 2000  J"orn Rennecke <amylaar@cygnus.co.uk>

        * reload1.c (reload_combine_note_use): Handle return register USEs.
        REG case: Handle multi-hard-register hard regs.

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

* Re: Wrong code generated for Hitachi SH
  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
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Schwingen @ 2000-03-23  5:20 UTC (permalink / raw)
  To: Joern Rennecke; +Cc: Michael Schwingen, gcc

On Wed, Mar 22, 2000 at 04:53:39PM +0000, Joern Rennecke wrote:
> > 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.
> 
> There was no 20000230 snapshot (or a 30th Febuary, for that matter), so

Um - sorry, I meant 20000320 (the latest I found on the server).

> don't know what you did try to compile that failed.  At any rate, I've
> recently applied a patch to reload to fix a bug like the one you have seen:
> 
> Fri Mar  3 12:49:28 2000  J"orn Rennecke <amylaar@cygnus.co.uk>
> 
>         * reload1.c (reload_combine_note_use): Handle return register USEs.
>         REG case: Handle multi-hard-register hard regs.

OK, I will try a snapshot after that date, then.

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

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

* Re: Wrong code generated for Hitachi SH, and compilation problems with recent snapshots
  2000-03-22  8:54 ` Joern Rennecke
  2000-03-23  5:20   ` Michael Schwingen
@ 2000-04-11  2:41   ` Michael Schwingen
  2000-04-11  8:07     ` Wrong code generated for Hitachi SH, and compilation problems withrecent snapshots Joern Rennecke
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Schwingen @ 2000-04-11  2:41 UTC (permalink / raw)
  To: Joern Rennecke; +Cc: Michael Schwingen, gcc

On Wed, Mar 22, 2000 at 04:53:39PM +0000, Joern Rennecke wrote:
> There was no 20000230 snapshot (or a 30th Febuary, for that matter), so
> don't know what you did try to compile that failed.  At any rate, I've
> recently applied a patch to reload to fix a bug like the one you have seen:
> 
> Fri Mar  3 12:49:28 2000  J"orn Rennecke <amylaar@cygnus.co.uk>
> 
>         * reload1.c (reload_combine_note_use): Handle return register USEs.
>         REG case: Handle multi-hard-register hard regs.

OK, I found time to check the current snapshots today:
20000320, 20000327 both give this result when building a sh-coff cross
compiler:

make[4]: Entering directory /usr/src/gnu/build-sh-coff/gcc'
/usr/src/gnu/build-sh-coff/gcc/xgcc -B/usr/src/gnu/build-sh-coff/gcc/
-B/opt/cgc
c/sh-coff/bin/ -I/opt/cgcc/sh-coff/include -O2  -DCROSS_COMPILE -DIN_GCC
-g -
O2 -I./include   -g1  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc
-g 
-O2 -I. -I../../src/gcc -I../../src/gcc/config -I../../src/gcc/../include \
  -c ../../src/gcc/cp/tinfo.cc
../../src/gcc/cp/tinfo.cc: In method \x02ad_cast::bad_cast ()':
../../src/gcc/cp/tinfo.cc:1135: Internal compiler error.
../../src/gcc/cp/tinfo.cc:1135: Please submit a full bug report.
../../src/gcc/cp/tinfo.cc:1135: See
../../src/gcc/cp/tinfo.cc:1135: <URL: http://www.gnu.org/software/gcc/bugs.html >
../../src/gcc/cp/tinfo.cc:1135: for instructions.




20000403 gives this:

_fixunssfsi
../../src/gcc/libgcc2.c: In function \x1f_fixunssfsi':
../../src/gcc/libgcc2.c:1026: Insn does not satisfy its constraints:
(insn 59 55 4 (set (reg:SI 0 r0)
        (reg:SI 28 fr4)) 123 {movsi_ie} (nil)
    (nil))
../../src/gcc/libgcc2.c:1026: Internal compiler error in
\x12eload_cse_simplify_op
erands', at reload1.c:8130
Please submit a full bug report.
See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.


20000410 gives this:

/usr/src/gnu/build-sh-coff/gcc/xgcc -B/usr/src/gnu/build-sh-coff/gcc/
-B/usr/src
/gnu/build-sh-coff/sh-coff/newlib/ -B/opt/cgcc/sh-coff/bin/ -idirafter
/usr/src/
gnu/build-sh-coff/sh-coff/newlib/targ-include -idirafter
/usr/src/gnu/src/newlib
/libc/include -nostdinc -c -DHAVE_CONFIG_H -g -O2  -m3e -I.
-I../../../../src/li
biberty/../include  -W -Wall -Wtraditional
../../../../src/libiberty/floatformat
.c
xgcc: Internal compiler error: program cc1 got fatal signal 11


(sorry for the line breaks, I can only get the messages here by
cut-and-paste).

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

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

* Re: Wrong code generated for Hitachi SH, and compilation problems withrecent snapshots
  2000-04-11  2:41   ` Wrong code generated for Hitachi SH, and compilation problems with recent snapshots Michael Schwingen
@ 2000-04-11  8:07     ` Joern Rennecke
  0 siblings, 0 replies; 5+ messages in thread
From: Joern Rennecke @ 2000-04-11  8:07 UTC (permalink / raw)
  To: Michael Schwingen; +Cc: Joern Rennecke, gcc

> 20000403 gives this:
> 
> _fixunssfsi
> ../../src/gcc/libgcc2.c: In function \x1f_fixunssfsi':
> ../../src/gcc/libgcc2.c:1026: Insn does not satisfy its constraints:
> (insn 59 55 4 (set (reg:SI 0 r0)
>         (reg:SI 28 fr4)) 123 {movsi_ie} (nil)
>     (nil))
> ../../src/gcc/libgcc2.c:1026: Internal compiler error in
> \x12eload_cse_simplify_op
> erands', at reload1.c:8130
> Please submit a full bug report.
> See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.

I've fixed this on the 6th:

Thu Apr  6 00:30:50 2000  J"orn Rennecke <amylaar@cygnus.co.uk>

	* sh.h (FUNCTION_ARG_PARTIAL_NREGS): Accomodate an unsigned
	GET_MODE_SIZE.

Index: config/sh/sh.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sh/sh.h,v
retrieving revision 1.57
retrieving revision 1.58
diff -p -r1.57 -r1.58
*** sh.h	2000/04/05 23:12:53	1.57
--- sh.h	2000/04/05 23:38:36	1.58
*************** struct sh_args {
*** 1066,1072 ****
  	+ ((MODE) != BLKmode					\
  	   ? ROUND_ADVANCE (GET_MODE_SIZE (MODE))		\
  	   : ROUND_ADVANCE (int_size_in_bytes (TYPE)))		\
! 	- NPARM_REGS (MODE) > 0))				\
     ? NPARM_REGS (MODE) - ROUND_REG ((CUM), (MODE))		\
     : 0)
  
--- 1066,1072 ----
  	+ ((MODE) != BLKmode					\
  	   ? ROUND_ADVANCE (GET_MODE_SIZE (MODE))		\
  	   : ROUND_ADVANCE (int_size_in_bytes (TYPE)))		\
! 	> NPARM_REGS (MODE)))					\
     ? NPARM_REGS (MODE) - ROUND_REG ((CUM), (MODE))		\
     : 0)
  

> 20000410 gives this:
> 
> /usr/src/gnu/build-sh-coff/gcc/xgcc -B/usr/src/gnu/build-sh-coff/gcc/
> -B/usr/src
> /gnu/build-sh-coff/sh-coff/newlib/ -B/opt/cgcc/sh-coff/bin/ -idirafter
> /usr/src/
> gnu/build-sh-coff/sh-coff/newlib/targ-include -idirafter
> /usr/src/gnu/src/newlib
> /libc/include -nostdinc -c -DHAVE_CONFIG_H -g -O2  -m3e -I.
> -I../../../../src/li
> biberty/../include  -W -Wall -Wtraditional
> ../../../../src/libiberty/floatformat
> .c
> xgcc: Internal compiler error: program cc1 got fatal signal 11

I can't seem to get the current fsf sources to build newlib - it's missing
the make target.

^ 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).