diff options
-rw-r--r-- | gcc-4.7/ChangeLog.backported | 4 | ||||
-rw-r--r-- | gcc-4.7/gcc/gimplify.c | 9 |
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc-4.7/ChangeLog.backported b/gcc-4.7/ChangeLog.backported new file mode 100644 index 000000000..b9fd26272 --- /dev/null +++ b/gcc-4.7/ChangeLog.backported @@ -0,0 +1,4 @@ +http://gcc.gnu.org/viewcvs?view=revision&revision=193825 +2012-11-26 Diego Novillo <dnovillo@google.com> + + * gimplify.c: Work around for PR 55245. diff --git a/gcc-4.7/gcc/gimplify.c b/gcc-4.7/gcc/gimplify.c index a10d17e10..d25f6b54f 100644 --- a/gcc-4.7/gcc/gimplify.c +++ b/gcc-4.7/gcc/gimplify.c @@ -2078,6 +2078,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)); |