diff options
author | Andrew Pinski <andrew_pinski@playstation.sony.com> | 2008-09-28 22:48:48 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2008-09-28 15:48:48 -0700 |
commit | f50d67f64e861c52bef8a7c6d330cee72f4679f9 (patch) | |
tree | b6ac98bcf3c5bd31e17c4546d4d572075a550624 /gcc | |
parent | 0d5f7a16ebc7931c798d266a2b172c856ef26531 (diff) | |
download | gcc-f50d67f64e861c52bef8a7c6d330cee72f4679f9.zip gcc-f50d67f64e861c52bef8a7c6d330cee72f4679f9.tar.gz gcc-f50d67f64e861c52bef8a7c6d330cee72f4679f9.tar.bz2 |
re PR tree-optimization/36891 (ICE with vector division and -ffast-math and LIM)
2008-09-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
Kaushal Kantawala <kaushal_kantawala@playstation.sony.com>
PR tree-opt/36891
* tree-ssa-loop-im.c (rewrite_reciprocal): Set DECL_GIMPLE_REG_P on
the newly created variable.
Create a VECTOR_CST of all 1s for vector types.
2008-09-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
Kaushal Kantawala <kaushal_kantawala@playstation.sony.com>
PR tree-opt/36891
* gcc.dg/torture/pr36891.c: New testcase.
Co-Authored-By: Kaushal Kantawala <Kaushal_Kantawala@playstation.sony.com>
From-SVN: r140738
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr36891.c | 17 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-im.c | 18 |
4 files changed, 48 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e0405f6..e3b9046 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2008-09-28 Andrew Pinski <andrew_pinski@playstation.sony.com> + Kaushal Kantawala <kaushal_kantawala@playstation.sony.com> + + PR tree-opt/36891 + * tree-ssa-loop-im.c (rewrite_reciprocal): Set DECL_GIMPLE_REG_P on + the newly created variable. + Create a VECTOR_CST of all 1s for vector types. + 2008-09-28 Eric Botcazou <ebotcazou@adacore.com> PR middle-end/36575 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 41ba8dc..0723a51 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2008-09-28 Andrew Pinski <andrew_pinski@playstation.sony.com> + Kaushal Kantawala <kaushal_kantawala@playstation.sony.com> + + PR tree-opt/36891 + * gcc.dg/torture/pr36891.c: New testcase. + 2008-09-28 Eric Botcazou <ebotcazou@adacore.com> * gnat.dg/conv_decimal.adb: New test. diff --git a/gcc/testsuite/gcc.dg/torture/pr36891.c b/gcc/testsuite/gcc.dg/torture/pr36891.c new file mode 100644 index 0000000..0d5bc98 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr36891.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-ffast-math" } */ + +#define __vector __attribute__((vector_size(16) )) +__vector float f(void); +void g(__vector float); +void RRB( __vector float vdist, __vector float vx) +{ + int detail; + for(detail = 0; detail < 5;++detail) + { + __vector float frand = f(); + __vector float pullperc = frand/ vdist; + __vector float pullx = vx * pullperc; + g(pullx); + } +} diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c index 527b810..fe7a222 100644 --- a/gcc/tree-ssa-loop-im.c +++ b/gcc/tree-ssa-loop-im.c @@ -763,6 +763,7 @@ rewrite_reciprocal (gimple_stmt_iterator *bsi) { gimple stmt, stmt1, stmt2; tree var, name, lhs, type; + tree real_one; stmt = gsi_stmt (*bsi); lhs = gimple_assign_lhs (stmt); @@ -770,9 +771,24 @@ rewrite_reciprocal (gimple_stmt_iterator *bsi) var = create_tmp_var (type, "reciptmp"); add_referenced_var (var); + DECL_GIMPLE_REG_P (var) = 1; + + /* For vectors, create a VECTOR_CST full of 1's. */ + if (TREE_CODE (type) == VECTOR_TYPE) + { + int i, len; + tree list = NULL_TREE; + real_one = build_real (TREE_TYPE (type), dconst1); + len = TYPE_VECTOR_SUBPARTS (type); + for (i = 0; i < len; i++) + list = tree_cons (NULL, real_one, list); + real_one = build_vector (type, list); + } + else + real_one = build_real (type, dconst1); stmt1 = gimple_build_assign_with_ops (RDIV_EXPR, - var, build_real (type, dconst1), gimple_assign_rhs2 (stmt)); + var, real_one, gimple_assign_rhs2 (stmt)); name = make_ssa_name (var, stmt1); gimple_assign_set_lhs (stmt1, name); |