re PR tree-optimization/35899 (ICE on filesystem code)

PR tree-optimization/35899
	* tree-inline.c (expand_call_inline): Use GIMPLE_STMT_OPERAND
	rather than TREE_OPERAND.

	* gcc.dg/pr35899.c: New test.

From-SVN: r134350
This commit is contained in:
Jakub Jelinek 2008-04-16 18:00:34 +02:00 committed by Jakub Jelinek
parent fc207c379c
commit 3d5e00a036
4 changed files with 27 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2008-04-16 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/35899
* tree-inline.c (expand_call_inline): Use GIMPLE_STMT_OPERAND
rather than TREE_OPERAND.
2008-04-16 Uros Bizjak <ubizjak@gmail.com>
PR target/35944

View File

@ -1,5 +1,8 @@
2008-04-16 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/35899
* gcc.dg/pr35899.c: New test.
PR target/35662
* gfortran.dg/pr35662.f90: New test.

View File

@ -0,0 +1,15 @@
/* PR tree-optimization/35899 */
/* { dg-do compile } */
/* { dg-options "-O2" } */
int
foo (void)
{
int a = bar (); /* { dg-warning "previous implicit declaration" } */
return a;
}
void
bar (void) /* { dg-warning "conflicting types for" } */
{
}

View File

@ -2868,15 +2868,15 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == SSA_NAME)
{
tree name = TREE_OPERAND (stmt, 0);
tree var = SSA_NAME_VAR (TREE_OPERAND (stmt, 0));
tree name = GIMPLE_STMT_OPERAND (stmt, 0);
tree var = SSA_NAME_VAR (GIMPLE_STMT_OPERAND (stmt, 0));
tree def = gimple_default_def (cfun, var);
/* If the variable is used undefined, make this name undefined via
move. */
if (def)
{
TREE_OPERAND (stmt, 1) = def;
GIMPLE_STMT_OPERAND (stmt, 1) = def;
update_stmt (stmt);
}
/* Otherwise make this variable undefined. */