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]
Other format: [Raw text]

[Bug rtl-optimization/17262] New: s390 bootstrap failure - maybe due to a reload bug


current cvs head (09/01/2004) does not bootstrap on s390 (31bit). 

stage1/xgcc -v says:

Using built-in specs.
Configured with: /build/cvs/gcc-3.5/configure --prefix=/build/cvs/mygcc
--enable-threads=posix --enable-shared 
--with-system-zlib --enable-__cxa_atexit --disable-multilib
--enable-serial-configure
Thread model: posix
gcc version 3.5.0 20040901 (experimental)

Bootstrap exits with an ICE triggered by the s390 back end function
s390_decompose_address in the postreload step:

stage1/xgcc -Bstage1/ -B/build/cvs/mygcc/s390-ibm-linux/bin/ -c   -g -O2
-DIN_GCC   -W -Wall -Wwrite-strings -Wstri
ct-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros
-Wold-style-definition -Werror -fn
o-common   -DHAVE_CONFIG_H    -I. -I. -I/build/cvs/gcc-3.5/gcc
-I/build/cvs/gcc-3.5/gcc/. -I/build/cvs/gcc-3.5/gcc/
../include -I/build/cvs/gcc-3.5/gcc/../libcpp/include
-I/build/cvs/gcc-3.5/gcc/../libbanshee/libcompat -I/build/cvs
/gcc-3.5/gcc/../libbanshee -I/build/cvs/gcc-3.5/gcc/../libbanshee/points-to 
/build/cvs/gcc-3.5/gcc/postreload-gcse
.c -o postreload-gcse.o
/build/cvs/gcc-3.5/gcc/postreload.c: In function `reload_cse_regs':
/build/cvs/gcc-3.5/gcc/postreload.c:71: internal compiler error: output_operand:
Cannot decompose address.
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

After local register allocation exists the following insn taken from .24.lreg:

(insn:QI 477 475 478 52 (set (reg:CCS 33 %cc)
        (compare:CCS (reg:SI 325 [ <variable>.store_ruid ])
            (mem/s:SI (plus:SI (plus:SI (reg:SI 324)
                        (reg/f:SI 818))
                    (const_int 60 [0x3c])) [7 <variable>.use_ruid+0 S4 A32])))

The global register allocator decides to replace pseudo 818 with hard reg 7 
and pseudo 324 with hard reg 0.
Unfortunately reg 0 is a bad choice within an address for s390 because 0
in machine code stands for an unused register so it is interpreted as the
immediate value 0 for address generation. But this will be fixed later
in reload.

But due to the fact that reg 0 is contained in the address strict_memory_address_p
in reload.c:4737 returns false what makes find_reloads_address to go on.
The code beginning in line 4911 of find_reloads_address rebuilds the insn so that
the address changes from (r0 + r7) + 60 to r0 + (r7 + 60) and later r0 is
replaced by r2 by
an input reload. Here are the resulting insns copied from .25.greg:

(insn 2320 475 477 52 (set (reg:SI 2 %r2)
        (reg:SI 0 %r0 [324])) 49 {*movsi_esa} (nil)
    (nil))

(insn:QI 477 2320 478 52 (set (reg:CCS 33 %cc)
        (compare:CCS (reg:SI 1 %r1 [orig:325 <variable>.store_ruid ] [325])
            (mem/s:SI (plus:SI (reg:SI 2 %r2)
                    (plus:SI (reg/f:SI 7 %r7 [818])
                        (const_int 60 [0x3c])))

The s390 back end function s390_decompose_address does not recognize the
generated address as valid. I think this is right because 

(plus:SI (reg:SI 2 %r2)
    (plus:SI (reg/f:SI 7 %r7 [818])
        (const_int 60 [0x3c])))

is a non-canonical rtx and therefore should not appear in the insn list.

-- 
           Summary: s390 bootstrap failure - maybe due to a reload bug
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: krebbel1 at de dot ibm dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: s390-ibm-linux
  GCC host triplet: s390-ibm-linux
GCC target triplet: s390-ibm-linux


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


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