internal compiler error: in add_phi_arg, at tree-phinodes.c:391 [maverick]
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Inkscape |
High
|
Alex Valavanis | ||
| gcc |
Fix Released
|
Medium
|
||
| gcc-4.4 (Ubuntu) |
Undecided
|
Unassigned |
Bug Description
Inkscape daily builds for maverick [1] are failing with this gcc internal error.
CXX display/
display/
display/
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:/
make[4]: *** [display/
The issue is not present on natty or newer builds. It is a known upstream issue (http://
|
#13 |
Reduced testcase:
struct Region {
int storage[4];
int count;
};
static inline Region subtract(int lhs)
{
Region reg;
int* storage = reg.storage;
if (lhs > 0)
storage++;
reg.count = storage - reg.storage;
return reg;
}
void bar(int a)
{
const Region copyBack(
}
---- CUT ---
Comes from inlining.
|
#14 |
Not what is happening is an interaction between the inlining and the return slot optimization and the named value optimization.
Before inlining we have:
# storage_1 = PHI <&<retval>
...
copyBack.1_1 = (struct Region *) ©Back;
*copyBack.1_1 ={v} subtract (a_2(D)) [return slot optimization];
--- Cut ----
Since &(*copyBack.
const Region copyBack(
to
const Region copyBack = (subtract(a));
We can remove the cast and it works.
|
#15 |
It was introduced between revision 127644 and 127649.
|
#16 |
Revision 127647:
http://
introduced:
[hjl@gnu-26 gcc]$ ./xgcc -B./ -S -O ../../../pr45709.cc
../../.
../../.
storage_8 = PHI <©Back.
©Back.
../../.
storage_8 = PHI <©Back.
©Back.
../../.
©Back.
../../.
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://
[hjl@gnu-26 gcc]$
|
#17 |
Revision 127647 is the first revision which failed to compile this.
|
#18 |
This patch:
http://
fixes the bug, but caused:
FAIL: g++.dg/
FAIL: g++.dg/
Now, we get
[hjl@gnu-6 gcc]$ ./xgcc -B./ -S -O /export/
/export/
/export/
[hjl@gnu-6 gcc]$
"const" is missing.
|
#20 |
We run into
/* With return slot optimization we can end up with
if (TREE_CODE (new_arg) != SSA_NAME
{
but inserting on an edge that needs splitting, which wrecks new_edge.
Index: tree-inline.c
=======
--- tree-inline.c (revision 164388)
+++ tree-inline.c (working copy)
@@ -2021,8 +2021,11 @@ copy_phis_for_bb (basic_block bb, copy_b
&& !is_gimple_val (new_arg))
{
gimple_seq stmts = NULL;
+ basic_block tem;
new_arg = force_gimple_
- gsi_insert_
+ tem = gsi_insert_
+ if (tem)
+ new_edge = find_edge (tem, new_bb);
}
add_phi_arg (new_phi, new_arg, new_edge,
fixes that.
|
#21 |
Subject: Bug 45709
Author: rguenth
Date: Sat Sep 18 11:38:25 2010
New Revision: 164390
URL: http://
Log:
2010-09-18 Richard Guenther <email address hidden>
PR tree-optimizati
* tree-inline.c (copy_phis_for_bb): Fixup new_edge when
we splitted it.
* g++.dg/
Added:
trunk/
Modified:
trunk/
trunk/
|
#22 |
Subject: Bug 45709
Author: rguenth
Date: Sat Sep 18 11:39:44 2010
New Revision: 164391
URL: http://
Log:
2010-09-18 Richard Guenther <email address hidden>
PR tree-optimizati
* tree-inline.c (copy_phis_for_bb): Fixup new_edge when
we splitted it.
* g++.dg/
Added:
branches/
Modified:
branches/
branches/
|
#23 |
Stopping here for now - I guess doing immediate insertion still can break
things as if there is another PHI node we'll iterate over the edges
again (but now including split ones) and find_edge (new_edge-
will break as new_edge->src is the newly inserted block.
I suppose delaying edge insert commits until after at least this block
is finished is better.
|
#24 |
Yep - testcase that still ICEs (now w/ a segfault):
struct Region {
int storage[4];
int count;
};
static inline Region subtract(int lhs)
{
Region reg;
int* storage = reg.storage;
int* storage2 = reg.storage;
if (lhs > 0)
storage++, storage2--;
reg.count = storage - reg.storage + storage2 - reg.storage;
return reg;
}
void bar(int a)
{
const Region copyBack(
}
|
#26 |
Subject: Bug 45709
Author: rguenth
Date: Sat Sep 18 17:13:04 2010
New Revision: 164397
URL: http://
Log:
2010-09-18 Richard Guenther <email address hidden>
PR tree-optimizati
* tree-inline.c (copy_phis_for_bb): Delay commit of edge
insertions until after all PHI nodes of the block are processed.
* g++.dg/
Added:
trunk/
Modified:
trunk/
trunk/
trunk/
|
#27 |
Subject: Bug 45709
Author: rguenth
Date: Sat Sep 18 17:16:42 2010
New Revision: 164398
URL: http://
Log:
2010-09-18 Richard Guenther <email address hidden>
PR tree-optimizati
* tree-inline.c (copy_phis_for_bb): Delay commit of edge
insertions until after all PHI nodes of the block are processed.
* g++.dg/
Added:
branches/
Modified:
branches/
branches/
branches/
|
#28 |
Subject: Bug 45709
Author: rguenth
Date: Sat Sep 18 17:23:20 2010
New Revision: 164399
URL: http://
Log:
2010-09-18 Richard Guenther <email address hidden>
PR tree-optimizati
* tree-inline.c (copy_phis_for_bb): Delay commit of edge
insertions until after all PHI nodes of the block are processed.
* g++.dg/
* g++.dg/
Added:
branches/
branches/
Modified:
branches/
branches/
branches/
|
#30 |
Subject: Bug 45709
Author: rguenth
Date: Sat Sep 18 18:53:53 2010
New Revision: 164400
URL: http://
Log:
2010-09-18 Richard Guenther <email address hidden>
PR tree-optimizati
* tree-inline.c (copy_phis_for_bb): Delay commit of edge
insertions until after all PHI nodes of the block are processed.
* g++.dg/
* g++.dg/
Added:
branches/
branches/
Modified:
branches/
branches/
branches/
Changed in gcc-4.4 (Ubuntu): | |
milestone: | none → maverick-updates |
Bryce Harrington (bryce) wrote : | #1 |
Patch needs pulled and built against the ubuntu gcc-4.4, then ensure tests still past and verify various packages still build properly. Then an SRU can be filed.
Launchpad Janitor (janitor) wrote : | #2 |
Status changed to 'Confirmed' because the bug affects multiple users.
Changed in gcc-4.4 (Ubuntu): | |
status: | New → Confirmed |
Changed in inkscape: | |
status: | New → Triaged |
importance: | Undecided → High |
Cafuego (cafuego) wrote : | #3 |
This issue also affects Lucid users (on i3886 only, amd64 builds fine) who try to build Inkscape with a backported cairo and pximan.
Cafuego (cafuego) wrote : | #4 |
Matthias Klose (doko) wrote : | #5 |
please add the ubuntu-
Cafuego (cafuego) wrote : | #6 |
I actually ported the patch to gcc for Lucid and Maverick, then added a PPA containing these compilers (ppa://
Cafuego (cafuego) wrote : | #7 |
... and this one.
Cafuego (cafuego) wrote : | #8 |
The bundled Inkscape versions build fine on these respective Ubuntu versions, this compiler problem was only introduced earlier this year, so is only triggered when building a much newer Inkscape.
I agree that pushing new a GCC to Lucid and Maverick is probably not needed or wanted :-)
The attachment "lucid-
[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]
tags: | added: patch |
Alex Valavanis (valavanisalex) wrote : | #10 |
@Matthias - I have added ppa:ubuntu-
Bryce Harrington (bryce) wrote : | #11 |
Ok, given that pushing a new GCC to lucid/maverick for this issue sounds unwarranted, and the toolchain dependency solves it for the inkscape project itself, shall this bug report be closed out at this time?
Any other actual issues need to be investigated here? If not, I'm fine to call this issue resolved now and close all the tasks.
Changed in gcc: | |
importance: | Unknown → Medium |
status: | Unknown → Fix Released |
Alex Valavanis (valavanisalex) wrote : | #32 |
Hi Bryce,
I'm not sure if it's really resolved in Ubuntu Maverick - the package would presumably still FTBFS for any user who tried a local build. However, pushing a new version of GCC is understandably a very big deal. Probably best closing as "Won't fix" rather than "Fix Released" so that users at least know that the bug still exists and can see the reason for not pushing the change.
Alex Valavanis (valavanisalex) wrote : | #33 |
Marking as fixed in Inkscape - the package builds with updated toolchain dependency in PPA.
Changed in inkscape: | |
assignee: | nobody → Alex Valavanis (valavanisalex) |
status: | Triaged → Fix Released |
milestone: | none → 0.49 |
Changed in gcc-4.4 (Ubuntu): | |
status: | Confirmed → Won't Fix |
Changed in inkscape: | |
milestone: | 0.49 → none |
[hjl@gnu-35 rrs]$ cat foo.cc
struct foo {
virtual void bar();
struct Rect {
int bottom;
};
struct Region {
static Region subtract(const Rect& lhs, const Rect& rhs) Region: :subtract( oldDirtyRegion, dirtyRegion)); gnu/import/ rrs/164143/ usr/bin/ gcc -S -O foo.cc gcc.gnu. org/bugs. html> for instructions.
{
Region reg;
Rect* storage = reg.storage;
{
if (lhs.bottom > rhs.bottom)
storage++;
reg.count = storage - reg.storage;
}
return reg;
}
Rect storage[4];
int count;
};
Rect dirtyRegion;
Rect oldDirtyRegion;
};
void foo::bar()
{
const Region copyBack(
}
[hjl@gnu-35 rrs]$ /export/
foo.cc: In member function ‘virtual void foo::bar()’:
foo.cc:27:70: internal compiler error: in add_phi_arg, at tree-phinodes.c:395
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://
[hjl@gnu-35 rrs]$