Summary: | [4.4 Regression] ice in df_refs_verify, at df-scan.c:4307 | ||
---|---|---|---|
Product: | gcc | Reporter: | John Regehr <regehr> |
Component: | rtl-optimization | Assignee: | Jakub Jelinek <jakub> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs, pinskia, zadeck |
Priority: | P2 | Keywords: | ice-checking, ice-on-valid-code |
Version: | 4.4.0 | ||
Target Milestone: | 4.4.0 | ||
Host: | i686-pc-linux-gnu | Target: | i686-pc-linux-gnu |
Build: | i686-pc-linux-gnu | Known to work: | |
Known to fail: | Last reconfirmed: | 2009-01-09 10:33:26 | |
Attachments: |
patch to cause df to verify after every patch
gcc44-pr38774.patch |
Description
John Regehr
2009-01-09 03:31:28 UTC
Confirmed. i will have my best people work on it. Created attachment 17068 [details]
patch to cause df to verify after every patch
this is a combine bug. The df verification fails after combine makes some modification to the cc arg of insn 28 in the foo function that bypasses the implicit and explicit calls to mark the insn as being changed.
I am looking into trying to figure out what path thru combine is doing this. However, if some combine expert (or just someone who wants to prove that they have better skill with the debugger than I do) wants to get there first, be my guest. I have attached a patch that improves some of the debugging and causes df to verify after every pass. This patch causes the failure to move from being in ira, to the start of if conversion after combine.
Simplified testcase: extern int bar (void); volatile int g; int foo (void) { int a = 1 >= bar (); if ((1 > 9223372036854775807LL - a && 1 - a ? : 1 + a) & 1) return g; return 0; } The single CC user is modified, then those changes are reverted, but unfortunately they aren't reverted by putting back the old content, but instead tweaking the new comparison with PUT_CODE. SUBST (*cc_use, gen_rtx_fmt_ee (new_code, GET_MODE (*cc_use), dest, const0_rtx)); other_changed = 1; ... if ((recog_for_combine (&pat, other_insn, ¬e) < 0 && ! check_asm_operands (pat))) { PUT_CODE (*cc_use, old_code); other_changed = 0; We should insert put there the old *cc_use rtx. I'll test a patch. Created attachment 17094 [details] gcc44-pr38774.patch Patch I'm going to bootstrap/regtest. Fixes the testcase on both i686-linux and x86_64-linux. (In reply to comment #6) > Created an attachment (id=17094) [edit] > gcc44-pr38774.patch > > Patch I'm going to bootstrap/regtest. Fixes the testcase on both i686-linux > and x86_64-linux. Do you think the testcase could go into gcc.dg/torture/ instead of just gcc.dg and remove the -O2 part of dg-options ? Subject: Bug 38774 Author: jakub Date: Tue Jan 13 22:36:06 2009 New Revision: 143355 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143355 Log: PR rtl-optimization/38774 * combine.c (simplify_set): When undoing cc_use change, don't do PUT_CODE on the newly created comparison, but instead put back the old comparison. * gcc.dg/torture/pr38774.c: New test. Added: trunk/gcc/testsuite/gcc.dg/torture/pr38774.c Modified: trunk/gcc/ChangeLog trunk/gcc/combine.c trunk/gcc/testsuite/ChangeLog Fixed. |