summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-11 14:53:20 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-11 14:53:20 +0000
commit83a99d39680ae22ff4d738742379cf81553a68f4 (patch)
tree9c89799f44ae4d4e96a1e79f7af70fca2353d8c8 /gcc
parente31161b30aca84f8abb3216ed59a52b62bda13b9 (diff)
downloadgcc-83a99d39680ae22ff4d738742379cf81553a68f4.tar.gz
2008-09-11 Richard Guenther <rguenther@suse.de>
* tree-vectorizer.c (slpeel_add_loop_guard): Fix types. (set_prologue_iterations): Likewise. * tree-vect-transform.c (vect_create_addr_base_for_vector_ref): Likewise. (vect_update_init_of_dr): Likewise. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Fix type verification. * fold-const.c (fold_unary): Do not generate calculations in sub-types. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140291 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/fold-const.c4
-rw-r--r--gcc/tree-ssa-forwprop.c2
-rw-r--r--gcc/tree-vect-transform.c18
-rw-r--r--gcc/tree-vectorizer.c10
5 files changed, 32 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2f4e784fc63..33de0138db0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2008-09-11 Richard Guenther <rguenther@suse.de>
+
+ * tree-vectorizer.c (slpeel_add_loop_guard): Fix types.
+ (set_prologue_iterations): Likewise.
+ * tree-vect-transform.c (vect_create_addr_base_for_vector_ref):
+ Likewise.
+ (vect_update_init_of_dr): Likewise.
+ * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Fix
+ type verification.
+ * fold-const.c (fold_unary): Do not generate calculations
+ in sub-types.
+
2008-09-11 Paolo Bonzini <bonzini@gnu.org>
* dojump.c (do_jump) [BIT_AND_EXPR]: Move below. Fall through to
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index aea7a653b18..2c822b561e2 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -7883,7 +7883,9 @@ fold_unary (enum tree_code code, tree type, tree op0)
transformation effectively doesn't preserve non-maximal ranges. */
if (TREE_CODE (type) == INTEGER_TYPE
&& TREE_CODE (op0) == BIT_AND_EXPR
- && TREE_CODE (TREE_OPERAND (op0, 1)) == INTEGER_CST)
+ && TREE_CODE (TREE_OPERAND (op0, 1)) == INTEGER_CST
+ /* Not if the conversion is to the sub-type. */
+ && TREE_TYPE (type) != TREE_TYPE (op0))
{
tree and = op0;
tree and0 = TREE_OPERAND (and, 0), and1 = TREE_OPERAND (and, 1);
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index bf860d90758..3513ee09e9f 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -834,7 +834,7 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs,
if (TREE_CODE (rhs2) == SSA_NAME
/* Avoid problems with IVopts creating PLUS_EXPRs with a
different type than their operands. */
- && useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (name)))
+ && useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (def_rhs)))
return forward_propagate_addr_into_variable_array_index (rhs2, def_rhs,
use_stmt_gsi);
return false;
diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c
index a889836f298..d69ce51814b 100644
--- a/gcc/tree-vect-transform.c
+++ b/gcc/tree-vect-transform.c
@@ -918,9 +918,10 @@ vect_create_addr_base_for_vector_ref (gimple stmt,
gimple_seq_add_seq (new_stmt_list, seq);
/* Create base_offset */
- base_offset = size_binop (PLUS_EXPR, base_offset, init);
- base_offset = fold_convert (sizetype, base_offset);
- dest = create_tmp_var (TREE_TYPE (base_offset), "base_off");
+ base_offset = size_binop (PLUS_EXPR,
+ fold_convert (sizetype, base_offset),
+ fold_convert (sizetype, init));
+ dest = create_tmp_var (sizetype, "base_off");
add_referenced_var (dest);
base_offset = force_gimple_operand (base_offset, &seq, true, dest);
gimple_seq_add_seq (new_stmt_list, seq);
@@ -930,8 +931,9 @@ vect_create_addr_base_for_vector_ref (gimple stmt,
tree tmp = create_tmp_var (sizetype, "offset");
add_referenced_var (tmp);
- offset = fold_build2 (MULT_EXPR, TREE_TYPE (offset), offset, step);
- base_offset = fold_build2 (PLUS_EXPR, TREE_TYPE (base_offset),
+ offset = fold_build2 (MULT_EXPR, sizetype,
+ fold_convert (sizetype, offset), step);
+ base_offset = fold_build2 (PLUS_EXPR, sizetype,
base_offset, offset);
base_offset = force_gimple_operand (base_offset, &seq, false, tmp);
gimple_seq_add_seq (new_stmt_list, seq);
@@ -7632,8 +7634,10 @@ vect_update_init_of_dr (struct data_reference *dr, tree niters)
{
tree offset = DR_OFFSET (dr);
- niters = fold_build2 (MULT_EXPR, TREE_TYPE (niters), niters, DR_STEP (dr));
- offset = fold_build2 (PLUS_EXPR, TREE_TYPE (offset), offset, niters);
+ niters = fold_build2 (MULT_EXPR, sizetype,
+ fold_convert (sizetype, niters),
+ fold_convert (sizetype, DR_STEP (dr)));
+ offset = fold_build2 (PLUS_EXPR, sizetype, offset, niters);
DR_OFFSET (dr) = offset;
}
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index 40d1302c723..47821e89a9e 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -940,10 +940,9 @@ slpeel_add_loop_guard (basic_block guard_bb, tree cond, basic_block exit_bb,
enter_e->flags |= EDGE_FALSE_VALUE;
gsi = gsi_last_bb (guard_bb);
- cond =
- force_gimple_operand (cond, &gimplify_stmt_list, true,
- NULL_TREE);
- cond_stmt = gimple_build_cond (NE_EXPR, cond, integer_zero_node,
+ cond = force_gimple_operand (cond, &gimplify_stmt_list, true, NULL_TREE);
+ cond_stmt = gimple_build_cond (NE_EXPR,
+ cond, build_int_cst (TREE_TYPE (cond), 0),
NULL_TREE, NULL_TREE);
if (gimplify_stmt_list)
gsi_insert_seq_after (&gsi, gimplify_stmt_list, GSI_NEW_STMT);
@@ -1073,7 +1072,8 @@ set_prologue_iterations (basic_block bb_before_first_loop,
force_gimple_operand (cost_pre_condition, &gimplify_stmt_list,
true, NULL_TREE);
cond_stmt = gimple_build_cond (NE_EXPR, cost_pre_condition,
- integer_zero_node, NULL_TREE, NULL_TREE);
+ build_int_cst (TREE_TYPE (cost_pre_condition),
+ 0), NULL_TREE, NULL_TREE);
gsi = gsi_last_bb (cond_bb);
if (gimplify_stmt_list)