[Bug c/36336] New: ICE push_reload - psuedo reg_equiv_constant

hutchinsonandy at aim dot com gcc-bugzilla@gcc.gnu.org
Mon May 26 19:23:00 GMT 2008


The follow ICE occurs with various testsuite tests. It appears to be real bug.

Executing on host: /home/hutchia/Desktop/awhconf/gcc/xgcc
-B/home/hutchia/Desktop/awhconf/gcc/   -O2  -w -DSTACK_SIZE=2048
-DNO_TRAMPOLINES -fno-show-column -c  -DSIGNAL_SUPPRESS -mmcu=atmega128   -o
980408-1.o
/home/hutchia/Desktop/gcc/gcc/testsuite/gcc.c-torture/compile/980408-1.c   
(timeout = 300)
/home/hutchia/Desktop/gcc/gcc/testsuite/gcc.c-torture/compile/980408-1.c: In
function 'MinifyImage':
/home/hutchia/Desktop/gcc/gcc/testsuite/gcc.c-torture/compile/980408-1.c:129:
internal compiler error: in push_reload, at reload.c:940


The assertion failure is due to push_reload receiving pseudo (e.g. p68) that
has not replaced with its reg_equiv_constant.

The assert was added by this bug fix:


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34641


Analysis

push_reload is called by target LEGITIMIZE_RELOAD_ADDRESS. This received 
operand p68 + 2 and is attempting to reload p68.

LEGITIMIZE_RELOAD_ADDRESS was invoked by find_reloads_address after
strict_memory_address_p rejects  p68+2.

The assert was added 
2008-01-10  Andreas Krebbel  <krebbel1@de.ibm.com>

This also added extra code to convert pseudo register equivalent constants were
converted by before push_reload is called. However, it does not consider the
case where the operand is a sum of reg_equiv_reg and constant.

This does not get replaced before LEGITIMIZE_RELOAD_ADDRESS is called in 
find_reloads_address.


The internals manual clearly indicates that GO_IF_LEGITIMATE_ADDRESS should
reject p68+2 unless there is const wrapper.

http://gcc.gnu.org/onlinedocs/gccint/Addressing-Modes.html

But the call from reload does not seem to provide that wrapper. Perhaps this is
the bug?

I have attached the smallest testcase. It is nonsense but will cause failure
when compiled using:

avr-gcc -c -mmcu=atmega128  -w  -O1 -mmcu=atmega128  -std=gnu99 memcpy-chk.c -o
memcpy-chk.o


The attached testcase uses __builtin_setjmp as a reduction from a failing test.
However, the ICE is not unique to this function.
gcc/gcc/testsuite/gcc.c-torture/compile/980408-1.c also fails and this does not
use _builtin_setjmp. But I was unable to create small testcase from this.


-- 
           Summary: ICE push_reload - psuedo reg_equiv_constant
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hutchinsonandy at aim dot com
 GCC build triplet: i686-pc-cygwin
  GCC host triplet: i686-pc-cygwin
GCC target triplet: avr-unknown-none


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36336



More information about the Gcc-bugs mailing list