This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: egcs-251297 fails to build for sh-xxx


Ralf Corsepius wrote:

> egcs-251297 still fails to be build for any Hitachi SH
> (--target=sh-coff/sh-elf ...) target.

To be more precise, it xgcc fails to compile libiberty/cplus-dem.c inside
the target directory:

> [...]
> /lfs/hermes/embedded/sh-elf/gcc/xgcc -B/lfs/hermes/embedded/sh-elf/gcc/
> -idirafter /lfs/hermes/embedded/sh-elf/sh-elf/newlib/targ-include
> -idirafter /lfs/hermes/embedded/src/newlib/libc/include -nostdinc -c -g
> -O2 -I. -I../../../src/libiberty/../include
> ../../../src/libiberty/cplus-dem.c
> /tmp/cca19281.s: Assembler messages:
> /tmp/cca19281.s:6356: Error: invalid operands for opcode
> /tmp/cca19281.s:7999: Error: invalid operands for opcode
> make[1]: *** [cplus-dem.o] Error 1
> make[1]: Leaving directory
> `/lfs/hermes/embedded/sh-elf/sh-elf/libiberty'
> make: *** [all-target-libiberty] Error 2
> [...]

Until now still nobody has replied to my previous posts, therefore I tried
to trace this bug:

1) The lines reported contain the following assembler statements:
line 6356:    mov.b @(3,r0),r3
line 7999:    mov.b @(3,r0),r3

According to my Hitachi SH-docs these statements are invalid for the SH1.
AFAIK, only mov.b @(disp,rN),r0 is allowed, while mov.b @(disp,rN),rM is
not.

Both lines are generated by the 2nd rule from insn movqi_i
(gcc/config/sh.md).


2) Additionally I tried to compile cplus-dem.c using different
egcs-versions and -m<xxx> flags:

egcs-251297 succeeds to compile cplus-dem.c if -ml is passed to the xgcc.
If -ml is not given, it only succeeds to compile if -O0 is passed.
egcs-1.0.1 always succeeds to compile cplus-dem.c, no matter what -m
options are passed.

IMHO, this indicates that big-endian support for sh is probably broken
(probably for little-endian hosts (i586-pc-linux-gnulibc1) only?), but I
suspect the sh-backend's handling of move-operands to be faulty.


Ralf.





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]