aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-data-ref.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2007-11-10 08:40:37 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2007-11-10 08:40:37 +0100
commit6481b879bad720854a3a1f8be3edc2940b3d4085 (patch)
tree97187c171008938f7d60d88651e0c06b1c5c10ab /gcc/tree-data-ref.c
parent3d9b2eb64f64c87952dd974a96e2756bdcf2e4b3 (diff)
downloadgcc-6481b879bad720854a3a1f8be3edc2940b3d4085.zip
gcc-6481b879bad720854a3a1f8be3edc2940b3d4085.tar.gz
gcc-6481b879bad720854a3a1f8be3edc2940b3d4085.tar.bz2
re PR tree-optimization/33680 (ICE when compilling elbg.c from ffmpeg (vectorizer))
PR tree-optimization/33680 * tree-data-ref.c (split_constant_offset) <case ADDR_EXPR>: Punt if the added cast involves variable length types. * gcc.c-torture/compile/20071108-1.c: New test. From-SVN: r130067
Diffstat (limited to 'gcc/tree-data-ref.c')
-rw-r--r--gcc/tree-data-ref.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index bf7d2ab..8d9c4c9 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -560,7 +560,27 @@ split_constant_offset (tree exp, tree *var, tree *off)
fold_convert (TREE_TYPE (base), poffset));
}
- *var = fold_convert (type, base);
+ var0 = fold_convert (type, base);
+
+ /* If variable length types are involved, punt, otherwise casts
+ might be converted into ARRAY_REFs in gimplify_conversion.
+ To compute that ARRAY_REF's element size TYPE_SIZE_UNIT, which
+ possibly no longer appears in current GIMPLE, might resurface.
+ This perhaps could run
+ if (TREE_CODE (var0) == NOP_EXPR
+ || TREE_CODE (var0) == CONVERT_EXPR)
+ {
+ gimplify_conversion (&var0);
+ // Attempt to fill in any within var0 found ARRAY_REF's
+ // element size from corresponding op embedded ARRAY_REF,
+ // if unsuccessful, just punt.
+ } */
+ while (POINTER_TYPE_P (type))
+ type = TREE_TYPE (type);
+ if (int_size_in_bytes (type) < 0)
+ break;
+
+ *var = var0;
*off = off0;
return;
}