OSDN Git Service

2005-10-31 Andrew Pinski <pinskia@physics.uc.edu>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 31 Oct 2005 13:22:20 +0000 (13:22 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 31 Oct 2005 13:22:20 +0000 (13:22 +0000)
        PR middle-end/23492
        * tree-inline.c (setup_one_parameter): If the init_stmt
        is NULL, don't insert the statement.
2005-10-31  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/23492
        * gcc.c-torture/compile/zero-strct-5.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106270 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/zero-strct-5.c [new file with mode: 0644]
gcc/tree-inline.c

index 56ab427..6e274da 100644 (file)
@@ -1,3 +1,9 @@
+2005-10-31  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR middle-end/23492
+       * tree-inline.c (setup_one_parameter): If the init_stmt
+       is NULL, don't insert the statement.
+
 2005-10-30  Jan Hubicka  <jh@suse.cz>
 
        PR tree-optimization/24172
index 9489b6e..7b0e3e7 100644 (file)
@@ -1,3 +1,8 @@
+2005-10-31  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR middle-end/23492
+       * gcc.c-torture/compile/zero-strct-5.c: New test.
+
 2005-10-31  Jerry DeLisle  <jvdelisle@verizon.net>
 
         PR libgfortran/24584
diff --git a/gcc/testsuite/gcc.c-torture/compile/zero-strct-5.c b/gcc/testsuite/gcc.c-torture/compile/zero-strct-5.c
new file mode 100644 (file)
index 0000000..2dfbabe
--- /dev/null
@@ -0,0 +1,14 @@
+/* Check that the inliner does not crash for this testcase.
+   gimple_expr can change the expr to NULL meaning that we
+   should not add any statement. */
+struct f {};
+struct g1 {struct f l;};
+
+static inline void g(struct f a, int i){}
+
+void h(void)
+{
+  struct g1 t;
+  g(t.l , 1);
+}
+
index 228252f..b17a597 100644 (file)
@@ -1159,7 +1159,8 @@ setup_one_parameter (inline_data *id, tree p, tree value, tree fn,
          && (!is_gimple_cast (rhs)
              || !is_gimple_val (TREE_OPERAND (rhs, 0))))
        gimplify_stmt (&init_stmt);
-      bsi_insert_after (&bsi, init_stmt, BSI_NEW_STMT);
+      if (init_stmt)
+        bsi_insert_after (&bsi, init_stmt, BSI_NEW_STMT);
     }
 }