aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9
diff options
context:
space:
mode:
authorBen Cheng <bccheng@android.com>2014-04-14 16:50:28 -0700
committerAndrew Hsieh <andrewhsieh@google.com>2014-04-22 15:34:22 -0700
commit9511967c9ccf1a35599b1903125d08ad2f426df7 (patch)
tree2269b98762ff5befe83d967f3f684f1e34ee193c /gcc-4.9
parent8b7731320484a056e6404e2f0790fa309ab7b83b (diff)
downloadtoolchain_gcc-9511967c9ccf1a35599b1903125d08ad2f426df7.tar.gz
toolchain_gcc-9511967c9ccf1a35599b1903125d08ad2f426df7.tar.bz2
toolchain_gcc-9511967c9ccf1a35599b1903125d08ad2f426df7.zip
[4.9] Backport a gimplify fix.
See eceb576ea5b15a7f8f179f131b665afeeba1c6ad Change-Id: Ifd1dec97b9ceed460d10eaaaf4aa923d02ad2c29
Diffstat (limited to 'gcc-4.9')
-rw-r--r--gcc-4.9/gcc/gimplify.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/gimplify.c b/gcc-4.9/gcc/gimplify.c
index 744178420..dcc2d74bc 100644
--- a/gcc-4.9/gcc/gimplify.c
+++ b/gcc-4.9/gcc/gimplify.c
@@ -1940,6 +1940,15 @@ gimplify_compound_lval (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
if (TREE_OPERAND (t, 3) == NULL_TREE)
{
tree elmt_type = TREE_TYPE (TREE_TYPE (TREE_OPERAND (t, 0)));
+ /* FIXME google - In some edge cases, ELMT_TYPE may
+ not have been laid out. This causes an ICE later
+ (PR 55245). We call layout_type if ELMT_TYPE is not
+ yet complete, but this is not where this bug should
+ be fixed. The FE should have laid out all the types
+ before gimplification. When a proper fix for PR
+ 55245 is available, remove this. */
+ if (!COMPLETE_TYPE_P (elmt_type))
+ layout_type (elmt_type);
tree elmt_size = unshare_expr (array_ref_element_size (t));
tree factor = size_int (TYPE_ALIGN_UNIT (elmt_type));