diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-03 22:35:39 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-03 22:35:39 +0000 |
commit | 55ed4df60c00ec0a64c4bdefbcccbee4c7271c41 (patch) | |
tree | 2d895fa1824f3bcdddf0dd88ec2b8c169f4f8c40 /gcc/tree-data-ref.c | |
parent | d08a0ab33a605554defe6dceb8ef11357388c490 (diff) | |
download | gcc-55ed4df60c00ec0a64c4bdefbcccbee4c7271c41.tar.gz |
PR tree-optimization/33453
* tree-data-ref.c (split_constant_offset): Use POINTER_PLUS_EXPR
for pointer addition.
* tree-parloops.c (canonicalize_loop_ivs): Likewise.
(separate_decls_in_loop_name): Copy DECL_GIMPLE_REG_P from var to
var_copy.
* gcc.c-torture/compile/20071203-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130588 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-data-ref.c')
-rw-r--r-- | gcc/tree-data-ref.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index 8d9c4c98a55..89a0039355f 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -555,9 +555,12 @@ split_constant_offset (tree exp, tree *var, tree *off) { split_constant_offset (poffset, &poffset, &off1); off0 = size_binop (PLUS_EXPR, off0, off1); - base = fold_build2 (PLUS_EXPR, TREE_TYPE (base), - base, - fold_convert (TREE_TYPE (base), poffset)); + if (POINTER_TYPE_P (TREE_TYPE (base))) + base = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (base), + base, fold_convert (sizetype, poffset)); + else + base = fold_build2 (PLUS_EXPR, TREE_TYPE (base), base, + fold_convert (TREE_TYPE (base), poffset)); } var0 = fold_convert (type, base); |