bug reload1.c reg_values[] indexed with pseudo register.

grahams@rcp.co.uk grahams@rcp.co.uk
Sat Jun 20 05:21:00 GMT 1998


Hi

I've stumbled onto a obsure bug in egcs while trying
to bootstrap egcs-19980617 on to an arm-semi-aout
target from an x86-linux host.

When I compile gcc/stmt.c from egcs-19980617
using the x86-linux => arm-semi-aout cross compiler
I built from egcs-19980617. The cross compiler
bombs with an access violation. If I make a trivial
change to gcc/stmt.c then I am able to compile
the whole of egcs-19980617 using the x86-linux =>
arm-semi-aout cross compiler.

I have identified the cause of the access violation
as a pseudo register (i.e regno # >= FIRST_PSEUDO_REGISTER)
being used to index reg_values[] which results in this case in a
bogus rtx and hence subsequent access violation. The
invalid reg_values[] index occurs in reload1.c  within the
routine reload_cse_noop_set_p().

The set rtx parameter passed to reload_cse_noop_set_p()
was "(insn 504 11 25 (set (reg:SI 9 r9) (reg:SI 41)) (nil) (nil))"
and it is the (reg:SI 41) which results in the invalid index to
reg_values[] (FIRST_PSEUDO_REGISTER is 27 on this target).

It is the compilation of check_for_full_enumeration_handling()
in gcc/stmt.c which triggers the bug. I have a cut down but not
trival version of stmt.c which also triggers the bug.
   

Graham




More information about the Gcc-bugs mailing list