Summary: | [4.1 Regression] ICE during kernel build. | ||
---|---|---|---|
Product: | gcc | Reporter: | Pawel Sikora <pawel_sikora> |
Component: | target | Assignee: | Paolo Bonzini <bonzini> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | aj, bonzini, dje, gcc-bugs, pinskia, rguenth |
Priority: | P3 | Keywords: | ice-on-valid-code, patch |
Version: | 4.1.0 | ||
Target Milestone: | 4.1.0 | ||
URL: | http://gcc.gnu.org/ml/gcc-patches/2005-12/msg00136.html | ||
Host: | ppc-linux | Target: | ppc-linux |
Build: | ppc-linux | Known to work: | 4.0.3 4.2.0 |
Known to fail: | 4.1.0 | Last reconfirmed: | 2005-12-18 15:55:36 |
Attachments: |
testcase
reduced testcase proposed patch |
Description
Pawel Sikora
2005-11-30 12:55:03 UTC
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 |