This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] New tests
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: 30 May 2003 19:02:54 -0400
- Subject: Re: [tree-ssa] New tests
- Organization: Red Hat Canada
- References: <200305302209.h4UM9IA8019929@speedy.slc.redhat.com>
On Fri, 2003-05-30 at 18:09, law@redhat.com wrote:
> The first shows a case where Diego's hack to avoid overlapping
> lifetimes fails, thus leading to an abort during the out of SSA
> translation.
>
Really? How come var_is_live is never called on this test case? The
var_is_live kludge is only called when we're doing redundant assignments
and copy-prop while renaming. In fact, the bug was that we are *not*
calling the hack.
---------------------------------------------------------------------------------
$ gdb --args ./cc1 -O2 a.c
GNU gdb Red Hat Linux (5.2.1-4)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(gdb) b var_is_live
Breakpoint 1 at 0x8109b96: file /home/dnovillo/clean-tree-ssa/src/gcc/tree-ssa.c, line 2685.
(gdb) run -O2 a.c
Starting program: /notnfs/dnovillo/BLD-clean-tree-ssa-native.toribio/gcc/stage1/cc1 -O2 a.c
rs6000_emit_prologue
a.c: In function `rs6000_emit_prologue':
a.c:13: internal compiler error: in assign_vars, at tree-ssa.c:1530
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Program exited with code 01.
(gdb)
---------------------------------------------------------------------------------
This ought to fix it:
Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa.c,v
retrieving revision 1.1.4.83
diff -d -u -p -r1.1.4.83 tree-ssa.c
--- tree-ssa.c 29 May 2003 23:10:59 -0000 1.1.4.83
+++ tree-ssa.c 30 May 2003 23:01:47 -0000
@@ -2145,7 +2145,9 @@ rewrite_stmt (si, block_defs_p, block_av
TREE_OPERAND (stmt, 1) = cached_lhs;
ann->modified = 1;
#else
- if (cached_lhs && get_value_for (*def_p, currdefs) == cached_lhs)
+ if (cached_lhs
+ && get_value_for (*def_p, currdefs) == cached_lhs
+ && var_is_live (cached_lhs, ann->bb))
{
/* A redundant assignment to the same lhs, perhaps a new
evaluation of an expression temporary that is still live.
@@ -2154,6 +2156,7 @@ rewrite_stmt (si, block_defs_p, block_av
bsi_remove (&si);
return;
}
+
if (var_is_live (cached_lhs, ann->bb))
{
register_new_def (*def_p, cached_lhs, block_defs_p);
I'll commit after bootstrapping and testing.
Diego.