aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew Pinski <andrew_pinski@playstation.sony.com>2007-08-20 07:42:55 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2007-08-20 00:42:55 -0700
commita9eafe819c64a5f6dbc52dbe908ca680de8ca103 (patch)
treed3d8854762eccbab4fae6d8c86b3a9bad23068eb /gcc
parent5a4ac6841c58e0e0fa97c46f363736728c029215 (diff)
downloadgcc-a9eafe819c64a5f6dbc52dbe908ca680de8ca103.zip
gcc-a9eafe819c64a5f6dbc52dbe908ca680de8ca103.tar.gz
gcc-a9eafe819c64a5f6dbc52dbe908ca680de8ca103.tar.bz2
re PR tree-optimization/30564 (ice for legal code with -O3)
2007-08-20 Andrew Pinski <andrew_pinski@playstation.sony.com> PR middle-end/30564 * tree-inline.c (optimize_inline_calls): Move the cgraph checking code in front of the compacting of basic blocks. Move the folding of statements inbetween the cgraph checking and compacting of basic blocks. 2007-08-20 Andrew Pinski <andrew_pinski@playstation.sony.com> PR middle-end/30564 * gcc.c-torture/compile/pr30564-1.c: New test. * gcc.c-torture/compile/pr30564-2.c: New test. From-SVN: r127638
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr30564-1.c15
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr30564-2.c12
-rw-r--r--gcc/tree-inline.c15
5 files changed, 50 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5442180..6f486f8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2007-08-20 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR middle-end/30564
+ * tree-inline.c (optimize_inline_calls): Move the cgraph checking
+ code in front of the compacting of basic blocks.
+ Move the folding of statements inbetween the cgraph checking
+ and compacting of basic blocks.
+
2007-08-19 Andrew Pinski <andrew_pinski@playstation.sony.com>
Serge Belyshev <belyshev@depni.sinp.msu.ru>
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 34a5659..22e5df7 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2007-08-20 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR middle-end/30564
+ * gcc.c-torture/compile/pr30564-1.c: New test.
+ * gcc.c-torture/compile/pr30564-2.c: New test.
+
2007-08-19 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/debug/dwarf2/aranges-fnsec-1.c: New test.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr30564-1.c b/gcc/testsuite/gcc.c-torture/compile/pr30564-1.c
new file mode 100644
index 0000000..6c373f7
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr30564-1.c
@@ -0,0 +1,15 @@
+static int spready[] = {0, 1, 2, 3};
+void explosion_map (int y)
+{
+ int i;
+ for (i = 0; i < 4; i++)
+ if (y * spready[i] < 0)
+ break;
+}
+void explosion (void)
+{
+ int i;
+ explosion_map (0);
+ for (i = 0; i < 2; i++)
+ continue;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr30564-2.c b/gcc/testsuite/gcc.c-torture/compile/pr30564-2.c
new file mode 100644
index 0000000..403f396
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr30564-2.c
@@ -0,0 +1,12 @@
+
+static int RawOrEnc = 0;
+static inline void addpair(int fp, int un)
+{
+ if (RawOrEnc == 0 && fp != un)
+ RawOrEnc = 1;
+}
+int f(int un0, char *a, unsigned int __s2_len)
+{
+ addpair(un0, un0);
+ __s2_len < 4 ? __builtin_strcmp (a, "-") : 0;
+}
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 3609480..c078166 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -2823,10 +2823,6 @@ optimize_inline_calls (tree fn)
gimple_expand_calls_inline (bb, &id);
pop_gimplify_context (NULL);
- /* Renumber the (code) basic_blocks consecutively. */
- compact_blocks ();
- /* Renumber the lexical scoping (non-code) blocks consecutively. */
- number_blocks (fn);
#ifdef ENABLE_CHECKING
{
@@ -2839,13 +2835,20 @@ optimize_inline_calls (tree fn)
gcc_assert (e->inline_failed);
}
#endif
+
+ /* Fold the statements before compacting/renumbering the basic blocks. */
+ fold_marked_statements (last, id.statements_to_fold);
+ pointer_set_destroy (id.statements_to_fold);
+
+ /* Renumber the (code) basic_blocks consecutively. */
+ compact_blocks ();
+ /* Renumber the lexical scoping (non-code) blocks consecutively. */
+ number_blocks (fn);
/* We are not going to maintain the cgraph edges up to date.
Kill it so it won't confuse us. */
cgraph_node_remove_callees (id.dst_node);
- fold_marked_statements (last, id.statements_to_fold);
- pointer_set_destroy (id.statements_to_fold);
fold_cond_expr_cond ();
if (current_function_has_nonlocal_label)
make_nonlocal_label_edges ();