Commit aee91ff0 by Alexandre Oliva Committed by Alexandre Oliva

re PR middle-end/38271 (Spurious / missing "... used uninitialized in this function" warning)

gcc/ChangeLog:
PR middle-end/38271
* tree-sra.c (sra_build_bf_assignment): Avoid warnings for
variables initialized from SRAed bit fields.
gcc/testsuite/ChangeLog:
PR middle-end/38271
* gcc.dg/torture/pr38271.c: New.

From-SVN: r142651
parent 7ce8451d
2008-12-10 Alexandre Oliva <aoliva@redhat.com>
PR middle-end/38271
* tree-sra.c (sra_build_bf_assignment): Avoid warnings for
variables initialized from SRAed bit fields.
2008-12-10 Martin Guy <martinwguy@yahoo.it>
PR target/37668
2008-12-10 Alexandre Oliva <aoliva@redhat.com>
PR middle-end/38271
* gcc.dg/torture/pr38271.c: New.
2008-12-10 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/37416
......
/* { dg-do compile } */
/* { dg-options "-Wuninitialized" } */
struct xxx {
short a;
short b;
void *c;
};
void bar(struct xxx);
void foo(struct xxx *p, int i)
{
struct xxx s0 = *p;
struct xxx s = s0;
if (s.a) i++;
bar(s);
}
......@@ -2354,14 +2354,17 @@ sra_build_bf_assignment (tree dst, tree src)
tmp = var;
if (!is_gimple_variable (tmp))
tmp = unshare_expr (var);
else
TREE_NO_WARNING (var) = true;
tmp2 = make_rename_temp (utype, "SR");
if (INTEGRAL_TYPE_P (TREE_TYPE (var)))
stmt = gimple_build_assign (tmp2, fold_convert (utype, tmp));
tmp = fold_convert (utype, tmp);
else
stmt = gimple_build_assign (tmp2, fold_build1 (VIEW_CONVERT_EXPR,
utype, tmp));
tmp = fold_build1 (VIEW_CONVERT_EXPR, utype, tmp);
stmt = gimple_build_assign (tmp2, tmp);
gimple_seq_add_stmt (&seq, stmt);
}
else
......
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