From: Jakub Jelinek Date: Wed, 14 Nov 2007 19:32:45 +0000 (+0100) Subject: re PR middle-end/34088 (ICE with uninitialized variable and -Werror) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f7bc70c5bfd8b06a03df87734d37201cc0ac9463;p=gcc.git re PR middle-end/34088 (ICE with uninitialized variable and -Werror) PR middle-end/34088 * tree-ssa.c (delete_tree_ssa): Don't call fini_ssa_operands if init_ssa_operands has not been called for cfun. * gcc.dg/pr34088.c: New test. From-SVN: r130187 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e13903d497f..695f9b88a21 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-11-14 Jakub Jelinek + + PR middle-end/34088 + * tree-ssa.c (delete_tree_ssa): Don't call fini_ssa_operands if + init_ssa_operands has not been called for cfun. + 2007-11-14 Eric Botcazou PR tree-optimization/34046 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ee8faa56728..be76b344bf6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-11-14 Jakub Jelinek + + PR middle-end/34088 + * gcc.dg/pr34088.c: New test. + 2007-11-14 Eric Botcazou * gcc.c-torture/compile/20071114-1.c: New test. diff --git a/gcc/testsuite/gcc.dg/pr34088.c b/gcc/testsuite/gcc.dg/pr34088.c new file mode 100644 index 00000000000..88a635d2d20 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr34088.c @@ -0,0 +1,24 @@ +/* PR middle-end/34088 */ +/* { dg-do compile } */ +/* { dg-options "-O -Wall -Werror" } */ + +int F0 (int); +int F1 (int t) { return F0(t); } +int F2 (int t) { return F0(t); } + +extern int X[]; +static inline int foo(int i) +{ + return X[i]; +} + +int bar(int* p) +{ + int i; + + while ( ({ if (foo(*p) && foo(*p)); p; }) ); + + return i; /* { dg-error "is used uninitialized" } */ +} + +/* { dg-message "warnings being treated as errors" "" {target "*-*-*"} 0 } */ diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index 9baf6bc40ee..eeb76806f8d 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -899,7 +899,8 @@ delete_tree_ssa (void) fini_ssanames (); fini_phinodes (); /* we no longer maintain the SSA operand cache at this point. */ - fini_ssa_operands (); + if (ssa_operands_active ()) + fini_ssa_operands (); cfun->gimple_df->global_var = NULL_TREE;