From 047f4b2c78a3c54739ca1553cc74bec133ea0b36 Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Mon, 31 Oct 2005 13:22:20 +0000 Subject: [PATCH] re PR middle-end/23492 (ACATS c48009e SEGV in set_bb_for_stmt tree-cfg.c:2673 on x86_64) 2005-10-31 Andrew Pinski 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 PR middle-end/23492 * gcc.c-torture/compile/zero-strct-5.c: New test. From-SVN: r106270 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.c-torture/compile/zero-strct-5.c | 14 ++++++++++++++ gcc/tree-inline.c | 3 ++- 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.c-torture/compile/zero-strct-5.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 56ab4272dcbc..6e274dafd73f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-10-31 Andrew Pinski + + 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 PR tree-optimization/24172 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9489b6e1c22c..7b0e3e7064ea 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-10-31 Andrew Pinski + + PR middle-end/23492 + * gcc.c-torture/compile/zero-strct-5.c: New test. + 2005-10-31 Jerry DeLisle 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 000000000000..2dfbabe406a7 --- /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 228252fd7090..b17a5975dc48 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); } } -- 2.43.5