This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Removal of unused vars
- 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: 26 Jun 2003 10:07:42 -0400
- Subject: Re: [tree-ssa] Removal of unused vars
- Organization: Red Hat Canada
- References: <200306260103.h5Q13ROx024950@speedy.slc.redhat.com>
On Wed, 2003-06-25 at 21:03, law@redhat.com wrote:
> * tree-cfg.c (remove_useless_stmts_and_vars): On the first
> iteration, remove unused variables from BIND_EXPRs.
> * tree-flow.h (var_ann_d): Add new field USED.
> (set_is_used): Prototype.
> (remove_useless_stmts_and_vars): Update prototype.
> * tree-ssa-live.c (create_ssa_var_map): Note which variables
> are used so that we can delete those which are not used.
> * tree-ssa.c (create_temp): Mark the new temporary as being used.
> (rewrite_out_of_ssa): Note if the call to remove_useless_stmts_and_vars
> is the first iteration or not.
> (set_is_used): New function.
>
Jeff,
This produces a regression in alpha:
New regressions in 20030626/gcc.sum.gz:
FAIL: gcc.c-torture/compile/20010605-1.c
FAIL: gcc.c-torture/compile/20010605-1.c
FAIL: gcc.c-torture/compile/20010605-1.c
FAIL: gcc.c-torture/compile/20010605-1.c
FAIL: gcc.c-torture/compile/20010605-1.c
main (int argc, char **argv)
{
int size = 10;
typedef struct {
char val[size];
} block;
block retframe_block()
{
return *(block*)0;
}
return 0;
}
We don't seem to flag 'size' as having hidden uses in alpha. In x86, we
do:
main (argc, argv)
{
int size;
static retframe_block;
size = 10;
int = 0;
return 0;
}
But in alpha, we emit:
main (argc, argv)
{
static retframe_block;
int = 0;
return 0;
}
If you don't have access to alpha, let me know and I'll add it to my
queue of things to fix.
Thanks. Diego.