[Bug c++/45709] [4.3/4.4/4.5/4.6 regression] internal compiler error: in add_phi_arg, at tree-phinodes.c:395

2010-09-18 Thread rguenth at gcc dot gnu dot org


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2010-09-17 20:25:35 |2010-09-18 09:28:41
   date||
   Target Milestone|--- |4.3.6


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45709



[Bug c++/45709] [4.3/4.4/4.5/4.6 regression] internal compiler error: in add_phi_arg, at tree-phinodes.c:395

2010-09-18 Thread rguenth at gcc dot gnu dot org


--- Comment #8 from rguenth at gcc dot gnu dot org  2010-09-18 09:53 ---
We run into

  /* With return slot optimization we can end up with
 non-gimple (foo *)this-m, fix that here.  */
  if (TREE_CODE (new_arg) != SSA_NAME
   TREE_CODE (new_arg) != FUNCTION_DECL
   !is_gimple_val (new_arg))
{
  gimple_seq stmts = NULL;
  new_arg = force_gimple_operand (new_arg, stmts, true, NULL);
  gsi_insert_seq_on_edge_immediate (new_edge, stmts);

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_operand (new_arg, stmts, true, NULL);
- gsi_insert_seq_on_edge_immediate (new_edge, stmts);
+ tem = gsi_insert_seq_on_edge_immediate (new_edge, stmts);
+ if (tem)
+   new_edge = find_edge (tem, new_bb);
}
  add_phi_arg (new_phi, new_arg, new_edge,
   gimple_phi_arg_location_from_edge (phi, old_edge));

fixes that.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45709



[Bug c++/45709] [4.3/4.4/4.5/4.6 regression] internal compiler error: in add_phi_arg, at tree-phinodes.c:395

2010-09-18 Thread rguenth at gcc dot gnu dot org


--- Comment #9 from rguenth at gcc dot gnu dot org  2010-09-18 11:38 ---
Subject: Bug 45709

Author: rguenth
Date: Sat Sep 18 11:38:25 2010
New Revision: 164390

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=164390
Log:
2010-09-18  Richard Guenther  rguent...@suse.de

PR tree-optimization/45709
* tree-inline.c (copy_phis_for_bb): Fixup new_edge when
we splitted it.

* g++.dg/torture/pr45709.C: New testcase.

Added:
trunk/gcc/testsuite/g++.dg/torture/pr45709.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-inline.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45709



[Bug c++/45709] [4.3/4.4/4.5/4.6 regression] internal compiler error: in add_phi_arg, at tree-phinodes.c:395

2010-09-18 Thread rguenth at gcc dot gnu dot org


--- Comment #10 from rguenth at gcc dot gnu dot org  2010-09-18 11:39 
---
Subject: Bug 45709

Author: rguenth
Date: Sat Sep 18 11:39:44 2010
New Revision: 164391

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=164391
Log:
2010-09-18  Richard Guenther  rguent...@suse.de

PR tree-optimization/45709
* tree-inline.c (copy_phis_for_bb): Fixup new_edge when
we splitted it.

* g++.dg/torture/pr45709.C: New testcase.

Added:
branches/gcc-4_5-branch/gcc/testsuite/g++.dg/torture/pr45709.C
Modified:
branches/gcc-4_5-branch/gcc/ChangeLog
branches/gcc-4_5-branch/gcc/tree-inline.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45709



[Bug c++/45709] [4.3/4.4/4.5/4.6 regression] internal compiler error: in add_phi_arg, at tree-phinodes.c:395

2010-09-17 Thread hjl dot tools at gmail dot com


--- Comment #5 from hjl dot tools at gmail dot com  2010-09-17 22:20 ---
Revision 127647 is the first revision which failed to compile this.


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

 CC||jason at redhat dot com
  Component|middle-end  |c++


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45709



[Bug c++/45709] [4.3/4.4/4.5/4.6 regression] internal compiler error: in add_phi_arg, at tree-phinodes.c:395

2010-09-17 Thread hjl dot tools at gmail dot com


--- Comment #6 from hjl dot tools at gmail dot com  2010-09-18 02:59 ---
This patch:

http://gcc.gnu.org/ml/gcc-patches/2010-09/msg01459.html

fixes the bug, but caused:

FAIL: g++.dg/conversion/op5.C  (test for errors, line 18)
FAIL: g++.dg/conversion/op5.C (test for excess errors)

Now, we get

[...@gnu-6 gcc]$ ./xgcc -B./ -S -O
/export/gnu/import/git/gcc/gcc/testsuite/g++.dg/conversion/op5.C -ansi
-pedantic-errors 
/export/gnu/import/git/gcc/gcc/testsuite/g++.dg/conversion/op5.C: In function
\u2018void foo(const B)\u2019:
/export/gnu/import/git/gcc/gcc/testsuite/g++.dg/conversion/op5.C:18:15: error:
conversion from \u2018const B\u2019 to non-scalar type \u2018A\u2019 requested
[...@gnu-6 gcc]$ 

const is missing.


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

   Target Milestone|4.3.6   |---


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45709



[Bug c++/45709] [4.3/4.4/4.5/4.6 regression] internal compiler error: in add_phi_arg, at tree-phinodes.c:395

2010-09-17 Thread hjl dot tools at gmail dot com


--- Comment #7 from hjl dot tools at gmail dot com  2010-09-18 03:36 ---
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2010-09/msg01461.html


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

URL||http://gcc.gnu.org/ml/gcc-
   ||patches/2010-
   ||09/msg01461.html


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45709