diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-08-18 17:23:24 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-08-18 17:23:24 +0200 |
commit | 29b894421e0f072bc12048b5eebfabc7edc11d85 (patch) | |
tree | 2669840759a69cb8cbe81285f397da005589e40b | |
parent | 4f219961f049e3125a4f5f02c287db0a1f4b8143 (diff) | |
download | gcc-29b894421e0f072bc12048b5eebfabc7edc11d85.zip gcc-29b894421e0f072bc12048b5eebfabc7edc11d85.tar.gz gcc-29b894421e0f072bc12048b5eebfabc7edc11d85.tar.bz2 |
re PR tree-optimization/58006 (ICE compiling VegaStrike with -ffast-math -ftree-parallelize-loops=2)
PR tree-optimization/58006
* tree-parloops.c (take_address_of): Don't ICE if get_name
returns NULL.
(eliminate_local_variables_stmt): Remove clobber stmts.
* g++.dg/opt/pr58006.C: New test.
From-SVN: r201827
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/opt/pr58006.C | 22 | ||||
-rw-r--r-- | gcc/tree-parloops.c | 15 |
4 files changed, 46 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8579567..9fdf2c4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-08-18 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/58006 + * tree-parloops.c (take_address_of): Don't ICE if get_name + returns NULL. + (eliminate_local_variables_stmt): Remove clobber stmts. + 2013-08-18 Eric Botcazou <ebotcazou@adacore.com> * cgraphunit.c (handle_alias_pairs): Reset the alias flag after the diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f734674..659ce71 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-08-18 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/58006 + * g++.dg/opt/pr58006.C: New test. + 2013-08-18 Eric Botcazou <ebotcazou@adacore.com> * gnat.dg/specs/linker_alias.ads: New test. diff --git a/gcc/testsuite/g++.dg/opt/pr58006.C b/gcc/testsuite/g++.dg/opt/pr58006.C new file mode 100644 index 0000000..fd3b7be --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr58006.C @@ -0,0 +1,22 @@ +// PR tree-optimization/58006 +// { dg-do compile } +// { dg-require-effective-target pthread } +// { dg-options "-Ofast -ftree-parallelize-loops=2" } + +extern "C" float sqrtf (float); + +struct S +{ + float i, j; + float foo () const { return sqrtf (i * i + j * j); } + S () : i (1), j (1) {} +}; + +void +bar (int a, int b) +{ + int i; + float f; + for (i = a; i < b; i++) + f = S ().foo (); +} diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index cea6f03..0416745 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -494,9 +494,12 @@ take_address_of (tree obj, tree type, edge entry, if (gsi == NULL) return NULL; addr = TREE_OPERAND (*var_p, 0); - name = make_temp_ssa_name (TREE_TYPE (addr), NULL, - get_name (TREE_OPERAND - (TREE_OPERAND (*var_p, 0), 0))); + const char *obj_name + = get_name (TREE_OPERAND (TREE_OPERAND (*var_p, 0), 0)); + if (obj_name) + name = make_temp_ssa_name (TREE_TYPE (addr), NULL, obj_name); + else + name = make_ssa_name (TREE_TYPE (addr), NULL); stmt = gimple_build_assign (name, addr); gsi_insert_on_edge_immediate (entry, stmt); @@ -694,6 +697,12 @@ eliminate_local_variables_stmt (edge entry, gimple_stmt_iterator *gsi, dta.changed = true; } } + else if (gimple_clobber_p (stmt)) + { + stmt = gimple_build_nop (); + gsi_replace (gsi, stmt, false); + dta.changed = true; + } else { dta.gsi = gsi; |