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
This commit is contained in:
Jakub Jelinek 2007-11-14 20:32:45 +01:00 committed by Jakub Jelinek
parent 3bc8ba2577
commit f7bc70c5bf
4 changed files with 37 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2007-11-14 Jakub Jelinek <jakub@redhat.com>
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 <ebotcazou@libertysurf.fr>
PR tree-optimization/34046

View File

@ -1,3 +1,8 @@
2007-11-14 Jakub Jelinek <jakub@redhat.com>
PR middle-end/34088
* gcc.dg/pr34088.c: New test.
2007-11-14 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.c-torture/compile/20071114-1.c: New test.

View File

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

View File

@ -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;