* [Bug tree-optimization/22037] [4.1 Regression] internal compiler error: verify_ssa failed
[not found] <20050612151318.22037.mathieu@malaterre.com>
@ 2005-06-12 16:00 ` pinskia at gcc dot gnu dot org
2005-06-28 23:06 ` bangerth at dealii dot org
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-12 16:00 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-12 16:00 -------
Confirmed, reduced testcase:
extern double sqrt (double __x) throw ();
int numDerivs1;
int ComputeAStep( double& error)
{
int i, numDerivs;
numDerivs = numDerivs1;
for(i=0; i<numDerivs; i++)
;
double err=0;
for(i=0; i<numDerivs; i++)
err += 1;
error = sqrt(err);
for(i=0; i<numDerivs; i++)
;
return 0;
}
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-06-12 16:00:05
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22037
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/22037] [4.1 Regression] internal compiler error: verify_ssa failed
[not found] <20050612151318.22037.mathieu@malaterre.com>
2005-06-12 16:00 ` [Bug tree-optimization/22037] [4.1 Regression] internal compiler error: verify_ssa failed pinskia at gcc dot gnu dot org
@ 2005-06-28 23:06 ` bangerth at dealii dot org
2005-06-29 20:19 ` dnovillo at gcc dot gnu dot org
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: bangerth at dealii dot org @ 2005-06-28 23:06 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2005-06-28 23:06 -------
Cutting another line or two:
-------------------
extern double sqrt (double) throw ();
void foo(double& d, int n)
{
double e=0;
for(int i=0; i<n; i++);
for(int i=0; i<n; i++) e=1;
d = sqrt(e);
for(int i=0; i<n; i++);
}
-----------------------------
g/x> /home/bangerth/bin/gcc-4.1-pre/bin/c++ -c x.cc -O3 -fPIC
x.cc: In function ‘void foo(double&, int)’:
x.cc:3: error: Definition in block 6 follows the use
for SSA_NAME: TMT.4_17 in statement:
# TMT.4_18 = V_MAY_DEF <TMT.4_17>;
*d_10 = D.1741_9;
x.cc:3: internal compiler error: verify_ssa failed.
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22037
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/22037] [4.1 Regression] internal compiler error: verify_ssa failed
[not found] <20050612151318.22037.mathieu@malaterre.com>
2005-06-12 16:00 ` [Bug tree-optimization/22037] [4.1 Regression] internal compiler error: verify_ssa failed pinskia at gcc dot gnu dot org
2005-06-28 23:06 ` bangerth at dealii dot org
@ 2005-06-29 20:19 ` dnovillo at gcc dot gnu dot org
2005-07-01 16:27 ` pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2005-06-29 20:19 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dnovillo at gcc dot gnu dot org 2005-06-29 20:19 -------
We are folding sqrt(0) into 0 and not updating virtual operands properly. Still
looking.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |dnovillo at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22037
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/22037] [4.1 Regression] internal compiler error: verify_ssa failed
[not found] <20050612151318.22037.mathieu@malaterre.com>
` (2 preceding siblings ...)
2005-06-29 20:19 ` dnovillo at gcc dot gnu dot org
@ 2005-07-01 16:27 ` pinskia at gcc dot gnu dot org
2005-07-01 16:30 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-01 16:27 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-01 16:27 -------
Actually I think this is worse than any can think. The problem is that we have a VUSE on the sqrt which
is wrong, we should have a V_MAY_DEF.
With an optimized (non bootstrapped) compiler, we get the correct results and on powerpc-darwin.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
GCC target triplet| |i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22037
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/22037] [4.1 Regression] internal compiler error: verify_ssa failed
[not found] <20050612151318.22037.mathieu@malaterre.com>
` (3 preceding siblings ...)
2005-07-01 16:27 ` pinskia at gcc dot gnu dot org
@ 2005-07-01 16:30 ` pinskia at gcc dot gnu dot org
2005-07-01 16:36 ` pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-01 16:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-01 16:30 -------
(In reply to comment #7)
in reply to this. On powerpc-darwin we get the right answer but on i686-pc-linux-gnu, we don't, I
have no idea why.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22037
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/22037] [4.1 Regression] internal compiler error: verify_ssa failed
[not found] <20050612151318.22037.mathieu@malaterre.com>
` (4 preceding siblings ...)
2005-07-01 16:30 ` pinskia at gcc dot gnu dot org
@ 2005-07-01 16:36 ` pinskia at gcc dot gnu dot org
2005-07-01 17:08 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-01 16:36 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-01 16:36 -------
(In reply to comment #8)
> (In reply to comment #7)
> in reply to this. On powerpc-darwin we get the right answer but on i686-pc-linux-gnu, we don't, I
> have no idea why.
Ignore all this talk, the reason why I cannot reproduce it on ppc-darwin is because -fno-math-errno is
default there.
--
What |Removed |Added
----------------------------------------------------------------------------
GCC target triplet|i686-pc-linux-gnu |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22037
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/22037] [4.1 Regression] internal compiler error: verify_ssa failed
[not found] <20050612151318.22037.mathieu@malaterre.com>
` (5 preceding siblings ...)
2005-07-01 16:36 ` pinskia at gcc dot gnu dot org
@ 2005-07-01 17:08 ` pinskia at gcc dot gnu dot org
2005-07-02 14:31 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-01 17:08 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-01 17:08 -------
The bug is really in cleanup_tree_cfg which is doing the merge of the two BBs.
This patch fixes the problem but I have not yet bootstrapped it yet:
Index: tree-cfg.c
===============================================================
====
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.207
diff -u -p -r2.207 tree-cfg.c
--- tree-cfg.c 28 Jun 2005 19:33:20 -0000 2.207
+++ tree-cfg.c 1 Jul 2005 17:07:35 -0000
@@ -1254,6 +1254,10 @@ replace_uses_by (tree name, tree val)
tree rhs;
fold_stmt_inplace (stmt);
+ mark_new_vars_to_rename (stmt);
+
+ if (maybe_clean_or_replace_eh_stmt (stmt, stmt))
+ tree_purge_dead_eh_edges (bb_for_stmt (stmt));
rhs = get_rhs (stmt);
if (TREE_CODE (rhs) == ADDR_EXPR)
Index: tree-cfgcleanup.c
===============================================================
====
RCS file: /cvs/gcc/gcc/gcc/tree-cfgcleanup.c,v
retrieving revision 2.2
diff -u -p -r2.2 tree-cfgcleanup.c
--- tree-cfgcleanup.c 25 Jun 2005 02:01:15 -0000 2.2
+++ tree-cfgcleanup.c 1 Jul 2005 17:07:36 -0000
@@ -520,7 +520,11 @@ cleanup_tree_cfg (void)
/* Merging the blocks creates no new opportunities for the other
optimizations, so do it here. */
- retval |= merge_seq_blocks ();
+ if (merge_seq_blocks ())
+ {
+ retval = true;
+ update_ssa (TODO_update_ssa_only_virtuals);
+ }
compact_blocks ();
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|dnovillo at gcc dot gnu dot |pinskia at gcc dot gnu dot
|org |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22037
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/22037] [4.1 Regression] internal compiler error: verify_ssa failed
[not found] <20050612151318.22037.mathieu@malaterre.com>
` (6 preceding siblings ...)
2005-07-01 17:08 ` pinskia at gcc dot gnu dot org
@ 2005-07-02 14:31 ` pinskia at gcc dot gnu dot org
2005-07-02 18:32 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-02 14:31 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-02 14:30 -------
(In reply to comment #10)
> The bug is really in cleanup_tree_cfg which is doing the merge of the two BBs.
> This patch fixes the problem but I have not yet bootstrapped it yet:
This patch does not bootstrap. I think it is better to disable the optimization in tree cfg and let leter
tree passes fix it up.
I am looking into fix it still.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22037
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/22037] [4.1 Regression] internal compiler error: verify_ssa failed
[not found] <20050612151318.22037.mathieu@malaterre.com>
` (7 preceding siblings ...)
2005-07-02 14:31 ` pinskia at gcc dot gnu dot org
@ 2005-07-02 18:32 ` pinskia at gcc dot gnu dot org
2005-07-04 10:38 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-02 18:32 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-02 18:32 -------
Here is a patch fixes the problem:
Index: tree-cfg.c
===============================================================
====
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.207
diff -u -p -r2.207 tree-cfg.c
--- tree-cfg.c 28 Jun 2005 19:33:20 -0000 2.207
+++ tree-cfg.c 2 Jul 2005 18:29:46 -0000
@@ -1298,10 +1298,12 @@ tree_merge_blocks (basic_block a, basic_
tree copy;
if (!may_propagate_copy (def, use)
- /* Propagating pointers might cause the set of vops for statements
- to be changed, and thus require ssa form update. */
+ /* Propagating pointers and constants might cause the
+ set of vops for statements to be changed, and thus
+ require ssa form update. */
|| (is_gimple_reg (def)
- && POINTER_TYPE_P (TREE_TYPE (def))))
+ && (POINTER_TYPE_P (TREE_TYPE (def))
+ || TREE_CONSTANT (use))))
{
gcc_assert (is_gimple_reg (def));
Hopefully it is not too permissive, we do allow the later passes fix up the permissiveness.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22037
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/22037] [4.1 Regression] internal compiler error: verify_ssa failed
[not found] <20050612151318.22037.mathieu@malaterre.com>
` (8 preceding siblings ...)
2005-07-02 18:32 ` pinskia at gcc dot gnu dot org
@ 2005-07-04 10:38 ` pinskia at gcc dot gnu dot org
2005-08-04 18:16 ` cvs-commit at gcc dot gnu dot org
2005-08-04 18:17 ` dnovillo at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-04 10:38 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-04 10:38 -------
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2005-07/msg00155.html>.
--
What |Removed |Added
----------------------------------------------------------------------------
URL| |http://gcc.gnu.org/ml/gcc-
| |patches/2005-
| |07/msg00155.html
Keywords| |patch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22037
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/22037] [4.1 Regression] internal compiler error: verify_ssa failed
[not found] <20050612151318.22037.mathieu@malaterre.com>
` (9 preceding siblings ...)
2005-07-04 10:38 ` pinskia at gcc dot gnu dot org
@ 2005-08-04 18:16 ` cvs-commit at gcc dot gnu dot org
2005-08-04 18:17 ` dnovillo at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-08-04 18:16 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-08-04 18:16 -------
Subject: Bug 22037
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: dnovillo@gcc.gnu.org 2005-08-04 18:16:41
Modified files:
gcc : ChangeLog passes.c tree-cfg.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/tree-ssa: pr22037.C
Log message:
PR 22037
* tree-cfg.c (replace_uses_by): Call mark_new_vars_to_rename.
(tree_merge_blocks): Propagate anything allowed by
may_propagate_copy.
Clarify documentation.
* passes.c (execute_todo): If cleanup_tree_cfg invalidated the
SSA form, schedule an update if necessary.
testsuite/ChangeLog
PR 22037
* g++.dg/tree-ssa/pr22037.C:
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9654&r2=2.9655
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/passes.c.diff?cvsroot=gcc&r1=2.108&r2=2.109
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-cfg.c.diff?cvsroot=gcc&r1=2.213&r2=2.214
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5877&r2=1.5878
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/tree-ssa/pr22037.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22037
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/22037] [4.1 Regression] internal compiler error: verify_ssa failed
[not found] <20050612151318.22037.mathieu@malaterre.com>
` (10 preceding siblings ...)
2005-08-04 18:16 ` cvs-commit at gcc dot gnu dot org
@ 2005-08-04 18:17 ` dnovillo at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2005-08-04 18:17 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dnovillo at gcc dot gnu dot org 2005-08-04 18:17 -------
Fixed. http://gcc.gnu.org/ml/gcc-patches/2005-08/msg00283.html.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22037
^ permalink raw reply [flat|nested] 13+ messages in thread