aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-math-opts.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2006-07-07 16:30:36 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2006-07-07 16:30:36 +0000
commitbfabddb6c0307307e963bf1388fcad0b8a00ba5c (patch)
tree6a1baa8ebb8584cddfcf0a2c3567372718ab3933 /gcc/tree-ssa-math-opts.c
parentc6d0959c4b87ca27e45d827baf9b53071513a00b (diff)
downloadgcc-bfabddb6c0307307e963bf1388fcad0b8a00ba5c.zip
gcc-bfabddb6c0307307e963bf1388fcad0b8a00ba5c.tar.gz
gcc-bfabddb6c0307307e963bf1388fcad0b8a00ba5c.tar.bz2
re PR middle-end/28268 (ICE with simple vector operations)
2006-07-07 Richard Guenther <rguenther@suse.de> PR middle-end/28268 * tree.h (build_one_cst): Declare. * tree.c (build_one_cst): New function. * tree-ssa-math-opts.c (get_constant_one): Remove. (insert_reciprocals): Use build_one_cst. * fold-const.c (fold_plusminus_mult): Likewise. * gcc.dg/torture/pr28268.c: New testcase. From-SVN: r115263
Diffstat (limited to 'gcc/tree-ssa-math-opts.c')
-rw-r--r--gcc/tree-ssa-math-opts.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index 950b9aa..1ff0628 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -279,35 +279,6 @@ is_division_by (tree use_stmt, tree def)
&& TREE_OPERAND (TREE_OPERAND (use_stmt, 1), 1) == def;
}
-/* Return the LHS of a RDIV_EXPR that computes a reciprocal in type TYPE. */
-static tree
-get_constant_one (tree type)
-{
- tree scalar, cst;
- int i;
-
- gcc_assert (FLOAT_TYPE_P (type));
- switch (TREE_CODE (type))
- {
- case REAL_TYPE:
- return build_real (type, dconst1);
-
- case VECTOR_TYPE:
- scalar = build_real (TREE_TYPE (type), dconst1);
-
- /* Create 'vect_cst_ = {cst,cst,...,cst}' */
- cst = NULL_TREE;
- for (i = TYPE_VECTOR_SUBPARTS (type); --i >= 0; )
- cst = tree_cons (NULL_TREE, scalar, cst);
-
- return build_vector (type, cst);
-
- default:
- /* Complex operations have been split already. */
- gcc_unreachable ();
- }
-}
-
/* Walk the subset of the dominator tree rooted at OCC, setting the
RECIP_DEF field to a definition of 1.0 / DEF that can be used in
the given basic block. The field may be left NULL, of course,
@@ -333,7 +304,7 @@ insert_reciprocals (block_stmt_iterator *def_bsi, struct occurrence *occ,
type = TREE_TYPE (def);
recip_def = make_rename_temp (type, "reciptmp");
new_stmt = build2 (MODIFY_EXPR, void_type_node, recip_def,
- fold_build2 (RDIV_EXPR, type, get_constant_one (type),
+ fold_build2 (RDIV_EXPR, type, build_one_cst (type),
def));