This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa] fix opt/14288


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" } */
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]