gcc-4.1.0-20051126 rev 107546 [builder2@forge linux-2.6.14.3]$ gcc attrib.i -c -O2 fs/ntfs/attrib.c: In function 'ntfs_attr_lookup': fs/ntfs/attrib.c:1025: internal compiler error: Segmentation fault $ gcc -v Reading specs from /usr/lib/gcc/ppc-pld-linux/4.1.0/specs Target: ppc-pld-linux Configured with: ../configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --infodir=/usr/share/info --mandir=/usr/share/man --x-libraries=/usr/X11R6/lib --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++,f95,objc,obj-c++,ada,java --enable-c99 --enable-long-long --disable-multilib --enable-nls --disable-werror --with-gnu-as --with-gnu-ld --with-demangler-in-ld --with-system-zlib --with-slibdir=/lib --without-x --enable-cmath --enable-libgcj --enable-libgcj-multifile --enable-libgcj-database --enable-gtk-peer --enable-gtk-cairo --enable-jni --enable-xmlj --enable-alsa --enable-dssi ppc-pld-linux Thread model: posix gcc version 4.1.0 20051126 (prerelease)
Created attachment 10365 [details] testcase
Program received signal SIGSEGV, Segmentation fault. (gdb) bt #0 gen_peephole2_993 (curr_insn=Variable "curr_insn" is not available.) at rs6000.md:10847 #1 0x1020341c in peephole2_insns (x0=Variable "x0" is not available.) at rs6000.md:10838 #2 0x1026ac90 in peephole2_optimize (dump_file=Variable "dump_file" is not available.) at recog.c:3108 #3 0x102d5db4 in execute_one_pass (pass=0x1055f584) at passes.c:828 #4 0x102d5ebc in execute_pass_list (pass=0x1055f584) at passes.c:860 #5 0x102d5ed4 in execute_pass_list (pass=0x1055fda4) at passes.c:861 #6 0x102d5ed4 in execute_pass_list (pass=0x1055fd70) at passes.c:861 #7 0x1006a424 in tree_rest_of_compilation (fndecl=0x3057bb00) at tree-optimize.c:419 #8 0x1000b2bc in c_expand_body (fndecl=0x3057bb00) at c-decl.c:6641 #9 0x103199f0 in cgraph_expand_function (node=0x306148c0) at cgraphunit.c:1055 #10 0x1031a344 in cgraph_optimize () at cgraphunit.c:1121 #11 0x100115cc in c_write_global_declarations () at c-decl.c:7649 #12 0x102b0958 in toplev_main (argc=Variable "argc" is not available.) at toplev.c:1003 #13 0x100581d8 in main (argc=Variable "argc" is not available.) at main.c:35
Confirmed.
(reducing)
Created attachment 10367 [details] reduced testcase reduced testcase.
Caused by: 2005-08-23 Paolo Bonzini <bonzini@gnu.org> * config/rs6000/predicates.md (equality_operator): New. * config/rs6000/rs6000.md: Rewrite as a peephole2 the split for comparison with a large constant.
The peephole2 has logical_operand which means it accepts register so simplify_const_binary_operation will fail as we have a register here and not just an int.
Reduced testcase: typedef unsigned long long u64; extern u64 f (u64 x); int g (unsigned x, u64 *z) { u64 w = *z; u64 h = f (w) << 32; u64 l = f (w); u64 g = h | l; unsigned p = g; if (p == x) f (*z); }
Created attachment 10369 [details] proposed patch This patch enables the peephole2 only if operands[1] and operands[2] are constant. An alternative patch would add a check for CONSTANT_P (operands[1]) && CONSTANT_P (operands[2]) in the peephole's C code.
Assigning to bonzini by request.
Patch applied to mainline. I will ask for 4.1 approval in a few days, most likely at the beginning of next week.
Paolo, are you going to ask for approval for GCC 4.1 too?
David, ok to commit to 4.1 now?
Subject: Re: [4.1 Regression] ICE during kernel build. Okay.
patch committed to 4.1 branch as well.
Subject: Bug 25180 Author: bonzini Date: Mon Dec 19 17:46:15 2005 New Revision: 108799 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108799 Log: 2005-12-19 Paolo Bonzini <bonzini@gnu.org> PR target/25180 * config/rs6000/predicates.md (logical_const_operand): Split out of logical_operand. (logical_operand): Use it. * config/rs6000/rs6000.md (cmp -> xor peephole2): Use logical_const_operand. Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/config/rs6000/predicates.md branches/gcc-4_1-branch/gcc/config/rs6000/rs6000.md