Summary: | [4.6 Regression] IPA-split causes crash due to null pointer deref | ||
---|---|---|---|
Product: | gcc | Reporter: | John Regehr <regehr> |
Component: | tree-optimization | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | alexey, chenyang, gcc-bugs, hubicka |
Priority: | P1 | ||
Version: | 4.6.0 | ||
Target Milestone: | 4.6.0 | ||
Host: | x86_64-unknown-linux-gnu | Target: | x86_64-unknown-linux-gnu |
Build: | x86_64-unknown-linux-gnu | Known to work: | |
Known to fail: | Last reconfirmed: | 2010-07-15 08:21:55 |
Description
John Regehr
2010-07-14 18:34:07 UTC
Confirmed. (gdb) call debug_gimple_stmt (stmt) .MEM_12 = PHI <.MEM_13(D)(2), (3)> we miss a PHI arg here after splitting the function. func_4 (int p_5, unsigned char p_6, unsigned char p_7) { <bb 2>: if (p_6_3(D) != 0) goto <bb 3>; else goto <bb 4>; <bb 3>: # p_6_10 = PHI <0(2)> func_4.part.0 (); <bb 4>: # .MEM_12 = PHI <.MEM_13(D)(2), (3)> return 0; Subject: Re: [4.6 Regression] IPA-split
causes crash due to null pointer deref
> (gdb) call debug_gimple_stmt (stmt)
> .MEM_12 = PHI <.MEM_13(D)(2), (3)>
Hmm, I make no attempts to update alias info. Why return has VOP?
Honza
It doesn't. It's a PHI node. So I suppose there was a CFG confluence point here. CDDCE removes the single store in the loop but doesn't remove the virtual PHI nodes. But you still have to deal with them I guess. Subject: Re: [4.6 Regression] IPA-split
causes crash due to null pointer deref
> CDDCE removes the single store in the loop but doesn't remove the virtual
> PHI nodes. But you still have to deal with them I guess.
OK, how I deal with those then?
Honza
(In reply to comment #5) > Subject: Re: [4.6 Regression] IPA-split > causes crash due to null pointer deref > > > CDDCE removes the single store in the loop but doesn't remove the virtual > > PHI nodes. But you still have to deal with them I guess. > OK, how I deal with those then? Well, you have to either delete it, update it or avoid splitting. As I said earlier splitting the edge to the split part if there are PHI nodes would avoid most of the issues. > Honza > Subject: Bug 44937 Author: rguenth Date: Thu Sep 2 13:42:25 2010 New Revision: 163775 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163775 Log: 2010-09-02 Richard Guenther <rguenther@suse.de> PR tree-optimization/44937 PR tree-optimization/45412 * ipa-split.c (split_function): Properly remove PHI nodes. * g++.dg/opt/pr45412.C: New testcase. * gcc.c-torture/compile/pr45412.c: Likewise. * gcc.c-torture/compile/pr44937.c: Likewise. Added: trunk/gcc/testsuite/g++.dg/opt/pr45412.C trunk/gcc/testsuite/gcc.c-torture/compile/pr44937.c trunk/gcc/testsuite/gcc.c-torture/compile/pr45412.c Modified: trunk/gcc/ChangeLog trunk/gcc/ipa-split.c trunk/gcc/testsuite/ChangeLog Fixed. |