Commit 6bdfdb96 by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/47265 (Error: SSA name in freelist but still referenced)

	PR tree-optimization/47265
	PR tree-optimization/47443
	* tree-ssa-forwprop.c (forward_propagate_addr_expr): Return false
	if name still has some uses.

	* gcc.c-torture/compile/pr47265.c: New test.
	* gcc.dg/pr47443.c: New test.

From-SVN: r169250
parent 6be7b668
2011-01-25 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/47265
PR tree-optimization/47443
* tree-ssa-forwprop.c (forward_propagate_addr_expr): Return false
if name still has some uses.
2011-01-25 Martin Jambor <mjambor@suse.cz> 2011-01-25 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/47382 PR tree-optimization/47382
......
2011-01-25 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/47265
PR tree-optimization/47443
* gcc.c-torture/compile/pr47265.c: New test.
* gcc.dg/pr47443.c: New test.
2011-01-25 Martin Jambor <mjambor@suse.cz> 2011-01-25 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/47382 PR tree-optimization/47382
......
/* PR tree-optimization/47265 */
struct S
{
char a[3];
char b[3];
};
void
bar (char *dst, const char *src, unsigned n)
{
while (n--)
*dst++ = *src ? *src++ : ' ';
}
void
foo (struct S *s)
{
bar (s->a, s->b, 3);
}
/* PR tree-optimization/47443 */
/* { dg-do compile } */
/* { dg-options "-O -fstack-check=generic" } */
static inline bar (char *c, int i)
{
return c + i > c;
}
int foo ()
{
char c[100];
return (bar (c, 1));
}
/* Forward propagation of expressions for single use variables. /* Forward propagation of expressions for single use variables.
Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010 Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -1114,7 +1114,7 @@ forward_propagate_addr_expr (tree name, tree rhs) ...@@ -1114,7 +1114,7 @@ forward_propagate_addr_expr (tree name, tree rhs)
} }
} }
return all; return all && has_zero_uses (name);
} }
/* Forward propagate the comparison defined in STMT like /* Forward propagate the comparison defined in STMT like
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment