Commit dcad005d by Bernd Schmidt Committed by Bernd Schmidt

re PR tree-optimization/39799 (missing 'may be used uninitialized' warning)

	PR tree-optimization/39799
	* tree-inline.c (remap_ssa_name): Initialize variable only if
	SSA_NAME_OCCURS_IN_ABNORMAL_PHI.

testsuite/
	PR tree-optimization/39799
	* c-c++-common/uninit-17.c: New test.

From-SVN: r161605
parent 1d468b06
2010-06-30 Bernd Schmidt <bernds@codesourcery.com>
PR tree-optimization/39799
* tree-inline.c (remap_ssa_name): Initialize variable only if
SSA_NAME_OCCURS_IN_ABNORMAL_PHI.
2010-06-30 Nathan Froyd <froydnj@codesourcery.com> 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
* c-parser.c (c_parser_omp_for_loop): Use a VEC for for_block. * c-parser.c (c_parser_omp_for_loop): Use a VEC for for_block.
......
2010-06-30 Bernd Schmidt <bernds@codesourcery.com>
PR tree-optimization/39799
* c-c++-common/uninit-17.c: New test.
2010-06-29 Jerry DeLisle <jvdelisle@gcc.gnu.org> 2010-06-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/43298 PR libfortran/43298
......
/* { dg-do compile } */
/* { dg-options "-O2 -Wuninitialized" } */
inline int foo(int x)
{
return x;
}
static void bar(int a, int *ptr)
{
do
{
int b; /* { dg-message "note: 'b' was declared here" } */
if (b < 40) {
ptr[0] = b; /* { dg-warning "may be used uninitialized" } */
}
b += 1;
ptr++;
}
while (--a != 0);
}
void foobar(int a, int *ptr)
{
bar(foo(a), ptr);
}
...@@ -234,6 +234,7 @@ remap_ssa_name (tree name, copy_body_data *id) ...@@ -234,6 +234,7 @@ remap_ssa_name (tree name, copy_body_data *id)
regions of the CFG, but this is expensive to test. */ regions of the CFG, but this is expensive to test. */
if (id->entry_bb if (id->entry_bb
&& is_gimple_reg (SSA_NAME_VAR (name)) && is_gimple_reg (SSA_NAME_VAR (name))
&& SSA_NAME_OCCURS_IN_ABNORMAL_PHI (name)
&& TREE_CODE (SSA_NAME_VAR (name)) != PARM_DECL && TREE_CODE (SSA_NAME_VAR (name)) != PARM_DECL
&& (id->entry_bb != EDGE_SUCC (ENTRY_BLOCK_PTR, 0)->dest && (id->entry_bb != EDGE_SUCC (ENTRY_BLOCK_PTR, 0)->dest
|| EDGE_COUNT (id->entry_bb->preds) != 1)) || EDGE_COUNT (id->entry_bb->preds) != 1))
......
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