This is the mail archive of the
mailing list for the GCC project.
C++ PATCH: Use relayout_decl
- From: mitchell at codesourcery dot com (Mark Mitchell)
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 2 Jun 2009 18:03:59 -0700 (PDT)
- Subject: C++ PATCH: Use relayout_decl
- Reply-to: mark at codesourcery dot com
The original purpose for this patch was to fix pr35526.C for Thumb.
In that test, the C++ front endfirst created an ARRAY_TYPE with
unknown bounds (which is a BLKmode type), and then goes back and
realizes that the array has one character element (and is therefore a
QImode type), but failed to update the mode, leading to a crash.
Using relayout_decl is safer, since it clears things out and starts
Since that point, this test has been fixed in another way. Therefore,
this patch is perhaps no longer necessary. But, it's still The Right
Thing, since at this point the decl may have been laid out before.
Applied after testing on arm-eabi.
(650) 331-3385 x713
2009-06-02 Mark Mitchell <email@example.com>
* decl.c (maybe_deduce_size_from_array_init): Use relayout_decl.
--- decl.c (revision 148087)
+++ decl.c (working copy)
@@ -4502,7 +4502,7 @@ maybe_deduce_size_from_array_init (tree
cp_apply_type_quals_to_decl (cp_type_quals (TREE_TYPE (decl)), decl);
- layout_decl (decl, 0);
+ relayout_decl (decl);