re PR tree-optimization/35899 (ICE on filesystem code)
authorJakub Jelinek <jakub@redhat.com>
Wed, 16 Apr 2008 16:00:34 +0000 (18:00 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 16 Apr 2008 16:00:34 +0000 (18:00 +0200)
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
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr35899.c [new file with mode: 0644]
gcc/tree-inline.c

index ea8fb4d..3797049 100644 (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
index 0c4c417..7ba05e8 100644 (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.
 
diff --git a/gcc/testsuite/gcc.dg/pr35899.c b/gcc/testsuite/gcc.dg/pr35899.c
new file mode 100644 (file)
index 0000000..113cbc8
--- /dev/null
@@ -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" } */
+{
+}
index 091a45a..6373d5e 100644 (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.  */