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: 31 May 2003 00:47:36 -0400
- Subject: Re: [tree-ssa] New tests
- Organization: Red Hat Canada
- References: <200305302318.h4UNIqSQ020318@speedy.slc.redhat.com>
On Fri, 2003-05-30 at 19:18, law@redhat.com wrote:
> In message <1054335774.21692.385.camel@frodo.toronto.redhat.com>, Diego Novillo
> writes:
> >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.
> No, we're calling it just fine.
>
You must have something different in your tree. I'm working with a
pristine copy and we are NOT calling var_is_live for this testcase!
--- WITHOUT PATCH ------------------------------------------------------
$ cat a.c
typedef struct rs6000_stack
{
int first_gp_reg_save;
}
rs6000_stack_t;
extern char regs_ever_live[113];
extern rs6000_stack_t *rs6000_stack_info (void);
void
rs6000_emit_prologue (int i, rs6000_stack_t * info)
{
if (regs_ever_live[info->first_gp_reg_save + i]
|| i + info->first_gp_reg_save)
gen_rtx_REG (info->first_gp_reg_save + i);
}
tobiano:~/clean-tree-ssa/native/bld.tobiano/gcc>
$ 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"...
Breakpoint 1 at 0x8193aea: file /home/dnovillo/clean-tree-ssa/src/gcc/diagnostic.c, line 1439.
Breakpoint 2 at 0x80498fc
Breakpoint 3 at 0x804966c
(gdb) b var_is_live
Breakpoint 4 at 0x8109c0e: file /home/dnovillo/clean-tree-ssa/src/gcc/tree-ssa.c, line 2685.
(gdb) run
Starting program: /notnfs/dnovillo/BLD-clean-tree-ssa-native.tobiano/gcc/cc1 -O2 a.c
Breakpoint 2 at 0x4202ac26
Breakpoint 3 at 0x42029a65
rs6000_emit_prologue
Breakpoint 1, fancy_abort (
file=0x85123e0 "/home/dnovillo/clean-tree-ssa/src/gcc/tree-ssa.c",
line=1530, function=0x8512616 "assign_vars")
at /home/dnovillo/clean-tree-ssa/src/gcc/diagnostic.c:1439
1439 internal_error ("in %s, at %s:%d", function, trim_filename (file), line);
(gdb)
--- WITHOUT PATCH ------------------------------------------------------
Notice how we proceed directly to the abort in assign_vars. We never
trigger the breakpoint in var_is_live. Now see what happens with the
patch:
--- WITH PATCH ------------------------------------------------------
$ 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"...
Breakpoint 1 at 0x8193b02: file /home/dnovillo/clean-tree-ssa/src/gcc/diagnostic.c, line 1439.
Breakpoint 2 at 0x80498fc
Breakpoint 3 at 0x804966c
(gdb) b var_is_live
Breakpoint 4 at 0x8109c26: file /home/dnovillo/clean-tree-ssa/src/gcc/tree-ssa.c, line 2688.
(gdb) run
Starting program: /notnfs/dnovillo/BLD-clean-tree-ssa-native.tobiano/gcc/cc1 -O2 a.c
Breakpoint 2 at 0x4202ac26
Breakpoint 3 at 0x42029a65
rs6000_emit_prologue
Breakpoint 4, var_is_live (var=0x40024960, bb=0x8680328)
at /home/dnovillo/clean-tree-ssa/src/gcc/tree-ssa.c:2688
2688 tree real_var = SSA_NAME_VAR (var);
(gdb) c
Continuing.
Breakpoint 4, var_is_live (var=0x40024960, bb=0x8680238)
at /home/dnovillo/clean-tree-ssa/src/gcc/tree-ssa.c:2688
2688 tree real_var = SSA_NAME_VAR (var);
(gdb) c
Continuing.
Breakpoint 4, var_is_live (var=0x40024960, bb=0x8680238)
at /home/dnovillo/clean-tree-ssa/src/gcc/tree-ssa.c:2688
2688 tree real_var = SSA_NAME_VAR (var);
(gdb) c
Continuing.
Execution times (seconds)
parser : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.01 ( 0%) wall
tree SSA rewrite : 0.00 ( 0%) usr 0.00 ( 0%) sys 8.60 (100%) wall
dominance frontiers : 0.01 (50%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
regmove : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.01 ( 0%) wall
TOTAL : 0.02 0.00 8.63
Breakpoint 2, 0x4202ac26 in exit () from /lib/i686/libc.so.6
(gdb)
--- WITH PATCH ------------------------------------------------------
I'd like to think that I still haven't totally lost my mind, you know? :)
> Your patch didn't change the behavior of my testcase at all, it's still
> aborting just like it did before your patch. Go back and double check it.
>
Oh, yes it did! Of course, the patch does not fix all our bootstrap
problems. It only perpetuates var_is_live which is completely wrong.
But it's not the end of the world. We can wait for Andrew's overlapping
live ranges.
Diego.