| Summary: | [4.6 Regression] segfault | ||
|---|---|---|---|
| Product: | gcc | Reporter: | John Regehr <regehr> |
| Component: | tree-optimization | Assignee: | Jeffrey A. Law <jeffreyalaw> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | chenyang, hubicka, jakub, jeffreyalaw |
| Priority: | P1 | Keywords: | ice-on-valid-code |
| Version: | 4.6.0 | ||
| Target Milestone: | 4.6.0 | ||
| Host: | Target: | ||
| Build: | Known to work: | ||
| Known to fail: | Last reconfirmed: | 2011-01-01 13:36:34 | |
| Attachments: | FIx for PR 47141 | ||
|
Description
John Regehr
2011-01-01 01:47:21 UTC
Caused by partial inlining. Smaller testcase:
int
foo (__UINTPTR_TYPE__ x)
{
int a = 6;
int *b = &a;
if (x)
for (a = 0; a; a++)
;
return a;
}
void
bar (void)
{
foo ((__UINTPTR_TYPE__) foo);
}
It is caused by revision 161433: http://gcc.gnu.org/ml/gcc-cvs/2010-06/msg01351.html I'm looking at it. It appears that we create a new edge to the exit block, which in turn creates a new phi arg for the vop. That phi arg is never initialized. The partial inlining code arranges to fixup the phi for the return value, but never does so for the vop. There's some code which marks the vop for renaming and removes its phi, but it doesn't trigger for this testcase. I suspect that's the root of our problem and if we fix that conditional things ought to be OK. Created attachment 22938 [details] FIx for PR 47141 Author: law Date: Mon Jan 10 16:48:42 2011 New Revision: 168634 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=168634 Log: * PR tree-optimization/47141 * ipa-split.c (split_function): Handle case where we are returning a value and the return block has a virtual operand phi. * gcc.c-torture/compile/pr47141.c: New test. Approved by richie in IRC Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr47141.c Modified: trunk/gcc/ChangeLog trunk/gcc/ipa-split.c trunk/gcc/testsuite/ChangeLog Resolved |