Bug 49135 - ICE in gcc.c-torture/execute/920302-1.c on arm
Summary: ICE in gcc.c-torture/execute/920302-1.c on arm
Status: RESOLVED DUPLICATE of bug 49423
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2011-05-24 00:31 UTC by Janis Johnson
Modified: 2012-09-21 15:23 UTC (History)
4 users (show)

See Also:
Host:
Target: arm
Build:
Known to work:
Known to fail: 4.7.0
Last reconfirmed: 2011-05-25 15:48:02


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Janis Johnson 2011-05-24 00:31:54 UTC
Test gcc.c-torture/execute/920302-1.c gets an internal compiler error on arm-none-linux-gnueabi, which began with this patch:

r172954 | rguenth | 2011-04-26 09:21:44 +0000 (Tue, 26 Apr 2011) | 12 lines

2011-04-26  Richard Guenther  <rguenther@suse.de>
        
        PR middle-end/48694
        * tree.h (OEP_CONSTANT_ADDRESS_OF): New operand_equal_flag.
        * fold-const.c (operand_equal_p): For TREE_CONSTANT ADDR_EXPRs
        compare the operands with OEP_CONSTANT_ADDRESS_OF.  Treat
        trees with TREE_SIDE_EFFECTS equal when OEP_CONSTANT_ADDRESS_OF
        is set.

        * gcc.dg/torture/pr48694-1.c: New testcase.
        * gcc.dg/torture/pr48694-2.c: Likewise

Here's the compiler output:

/scratch/janisjo/arm-linux-fsf/src/gcc-mainline/gcc/testsuite/gcc.c-torture/execute/920302-1.c: In function 'execute':
/scratch/janisjo/arm-linux-fsf/src/gcc-mainline/gcc/testsuite/gcc.c-torture/execute/920302-1.c:27:1: internal compiler error: in push_minipool_fix, at config/arm/arm.c:12107
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Richard Biener 2011-05-24 10:17:47 UTC
There is no assert around in that routine and the file doesn't call
operand_equal_p anywhere ... so?
Comment 2 Mikael Pettersson 2011-05-24 12:38:28 UTC
I see the same ICE and test suite FAIL as Janis does, on armv5tel-linux-gnueabi, except I see it on line 11950 which is

gcc_assert (fix->forwards || fix->backwards);

4.7-20110423 was OK, 4.7-20110430 and newer show the ICE and FAIL.

My config is
/mnt/scratch/gcc-4.7-20110521/configure --prefix=/mnt/scratch/install47 --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,java,fortran --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --disable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --disable-sjlj-exceptions --with-arch=armv5te --with-tune=xscale --build=armv5tel-brewer-linux-gnueabi --with-gmp=/home/mikpe/pkgs/linux-armv5l/gmp-4.3.2 --with-mpfr=/home/mikpe/pkgs/linux-armv5l/mpfr-2.4.2 --with-mpc=/home/mikpe/pkgs/linux-armv5l/mpc-0.8.2 --disable-plugin --disable-lto --disable-libmudflap
Comment 3 Janis Johnson 2011-05-24 16:07:25 UTC
With sources updated yesterday the ICE is at line 11950.

Configured with:
/scratch/janisjo/arm-linux-fsf/src/gcc-mainline/configure
 --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi
--enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch
--with-gnu-as --with-gnu-ld --enable-languages=c,c++ --enable-shared --enable-lto 
--enable-symvers=gnu --enable-__cxa_atexit --disable-nls --prefix=/opt/codesourcery 
--with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc
--with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm'
--disable-libgomp --enable-poison-system-directories
--with-gmp=xxxx --with-mpfr=xxxx --with-mpc=xxxx --with-ppl=xxxx --with-cloog=xxxx
--with-libelf=xxxx --with-build-time-tools=xxxx --with-build-sysroot=xxxx
Comment 4 John David Anglin 2011-05-25 15:48:02 UTC
Also see the same ICE.
Comment 5 Ramana Radhakrishnan 2011-05-26 22:55:38 UTC
This is related to PR47719 . Appears to work fine on the 4.6 branch. Atleast an O2 trial didn't blow up. 

from a backtrace. 

(gdb)up
#3  0x08729c62 in arm_reorg () at /home/ramrad01/sources/fsf/trunk/gcc/config/arm/arm.c:12258
(gdb) p insn
$2 = (rtx) 0xb7cf5d14
(gdb) pr
(insn 13 12 108 (set (reg:SI 2 r2 [orig:142 D.2035 ] [142])
        (zero_extend:SI (mem/u/c/i:HI (symbol_ref/u:SI ("*.LC0") [flags 0x2]) [4 S2 A32]))) /home/ramrad01/sources/fsf/trunk/gcc/testsuite/gcc.c-torture/execute/920302-1.c:14 147 {*arm_zero_extendhisi2}
     (insn_list:REG_LABEL_OPERAND 30 (expr_list:REG_EQUIV (zero_extend:SI (mem/u/c/i:HI (symbol_ref/u:SI ("*.LC0") [flags 0x2]) [4 S2 A32]))
            (nil))))


Reproduced with -march=armv5te -marm -mfloat-abi=soft on the command line. 


cheers
Ramana
Comment 6 Ramana Radhakrishnan 2011-06-03 22:18:04 UTC
combine puts 2 and 2 together . 

(insn 11 10 12 (set (reg/f:SI 154)
        (mem/u/c/i:SI (symbol_ref/u:SI ("*.LC0") [flags 0x2]) [4 S4 A32])) /home/ramana/cos/git/gcc/gcc/testsuite/gcc.c-torture/execute/920302-1.c:14 -1
     (expr_list:REG_EQUAL (label_ref:SI 0)  
        (nil)))

(insn 12 11 13 (set (reg:HI 153)
        (subreg:HI (reg/f:SI 154) 0)) /home/ramana/cos/git/gcc/gcc/testsuite/gcc.c-torture/execute/920302-1.c:14 -1
     (nil))

(insn 13 12 0 (set (reg:SI 142 [ D.2035 ])  
        (zero_extend:SI (reg:HI 153))) /home/ramana/cos/git/gcc/gcc/testsuite/gcc.c-torture/execute/920302-1.c:14 -1
     (nil))



Trying 11 -> 12:
Successfully matched this instruction:
(set (reg/f:HI 153)
    (mem/u/c/i:HI (symbol_ref/u:SI ("*.LC0") [flags 0x2]) [4 S2 A32]))
deferring deletion of insn with uid = 11.
modifying insn i3    12 r153:HI=[`*.LC0']
deferring rescan insn with uid = 12.

Trying 12 -> 13:
Successfully matched this instruction:
(set (reg:SI 142 [ D.2035 ])
    (zero_extend:SI (mem/u/c/i:HI (symbol_ref/u:SI ("*.LC0") [flags 0x2]) [4 S2 A32])))
deferring deletion of insn with uid = 12.
modifying insn i3    13 r142:SI=zero_extend([`*.LC0'])
deferring rescan insn with uid = 13.

---


(insn 13 12 15 3 (set (reg:SI 142 [ D.2035 ])
        (zero_extend:SI (mem/u/c/i:HI (symbol_ref/u:SI ("*.LC0") [flags 0x2]) [4 S2 A32]))) /home/ramana/cos/git/gcc/gcc/testsuite/gcc.c-torture/execute/920302-1.c:14 150 {*arm_zero_extendhisi2_v6}
     (nil))
Comment 7 Andrew Pinski 2012-09-21 15:23:18 UTC
This is a dup of bug 49423 which points to the patch which really caused it.

*** This bug has been marked as a duplicate of bug 49423 ***