This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] fix opt/14288
- From: Richard Henderson <rth at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 25 Feb 2004 21:38:20 -0800
- Subject: Re: [tree-ssa] fix opt/14288
- References: <20040226052418.GA28112@redhat.com>
On Wed, Feb 25, 2004 at 09:24:18PM -0800, Richard Henderson wrote:
> * gimplify.c (gimple_push_cleanup): Add VAR argument. Set
> TREE_NO_WARNING if in a conditional context.
> (gimplify_target_expr): Pass new argument.
> * tree-sra.c (lookup_scalar): Copy TREE_NO_WARNING to replacement.
Test case as follows, committed as g++.dg/warn/Wunused-5.C.
r~
/* PR opt/14288 */
/* { dg-do compile } */
/* { dg-options "-O -Wall" } */
volatile int sink;
extern int foo(int);
struct S
{
int x;
S() { x = foo(0); }
~S() { sink = x; }
};
int test(bool p)
{
return p ? foo(S().x) : 0; /* { dg-bogus "uninitialized" } */
}