From 3d5e00a036cec0a70c46c0f2617de26849c7d46b Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 16 Apr 2008 18:00:34 +0200 Subject: [PATCH] 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 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/gcc.dg/pr35899.c | 15 +++++++++++++++ gcc/tree-inline.c | 6 +++--- 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr35899.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ea8fb4dc670..3797049a6f6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-04-16 Jakub Jelinek + + PR tree-optimization/35899 + * tree-inline.c (expand_call_inline): Use GIMPLE_STMT_OPERAND + rather than TREE_OPERAND. + 2008-04-16 Uros Bizjak PR target/35944 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0c4c417d332..7ba05e88885 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2008-04-16 Jakub Jelinek + PR tree-optimization/35899 + * gcc.dg/pr35899.c: New test. + PR target/35662 * gfortran.dg/pr35662.f90: New test. diff --git a/gcc/testsuite/gcc.dg/pr35899.c b/gcc/testsuite/gcc.dg/pr35899.c new file mode 100644 index 00000000000..113cbc87a7d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr35899.c @@ -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" } */ +{ +} diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 091a45a1439..6373d5eebea 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -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. */ -- 2.30.2