summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2005-10-31 13:22:20 +0000
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2005-10-31 13:22:20 +0000
commit031951bfcfbacf30e6ef1b1628b14f0332826556 (patch)
tree539dd432a942d07e4c911b395308685980c9c8d5
parent88ba1e8a5df4974032335c355c5acea42d60f6d3 (diff)
downloadgcc-031951bfcfbacf30e6ef1b1628b14f0332826556.tar.gz
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-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
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/zero-strct-5.c14
-rw-r--r--gcc/tree-inline.c3
4 files changed, 27 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 56ab4272dcb..6e274dafd73 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9489b6e1c22..7b0e3e7064e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 00000000000..2dfbabe406a
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/zero-strct-5.c
@@ -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);
+}
+
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 228252fd709..b17a5975dc4 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -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);
}
}