This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C++ PATCH: Use relayout_decl

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.

Mark Mitchell
(650) 331-3385 x713

2009-06-02  Mark Mitchell  <>

	* decl.c (maybe_deduce_size_from_array_init): Use relayout_decl.

Index: decl.c
--- 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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]