RFA: PATCH to reconstruct_complex_type to preserve attributes

View: New views
2 Messages — Rating Filter:   Alert me  

RFA: PATCH to reconstruct_complex_type to preserve attributes

by Jason Merrill :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

While working on c++/9381 I noticed this as another place we were
rebuilding types but not preserving attributes.  OK for trunk?

Tested x86_64-pc-linux-gnu, applied to trunk.

[reconst-attr.patch]

commit 024ed6cf7d6bd427cc747f273b20a3a166ff2dc2
Author: Jason Merrill <jason@...>
Date:   Fri Nov 6 15:38:49 2009 -0500

    * tree.c (reconstruct_complex_type): Preserve attributes.

diff --git a/gcc/tree.c b/gcc/tree.c
index f3970dd..b386334 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -9214,7 +9214,8 @@ reconstruct_complex_type (tree type, tree bottom)
   else
     return bottom;
 
-  return build_qualified_type (outer, TYPE_QUALS (type));
+  return build_type_attribute_qual_variant (outer, TYPE_ATTRIBUTES (type),
+    TYPE_QUALS (type));
 }
 
 /* Returns a vector tree node given a mode (integer, vector, or BLKmode) and



Re: RFA: PATCH to reconstruct_complex_type to preserve attributes

by Richard Guenther-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Nov 6, 2009 at 10:02 PM, Jason Merrill <jason@...> wrote:
> While working on c++/9381 I noticed this as another place we were rebuilding
> types but not preserving attributes.  OK for trunk?

I guess it doesn't matter much - the only user seems to be
handle_vector_size_attribute.  But ok anyway.

Thanks.
Richard.

> Tested x86_64-pc-linux-gnu, applied to trunk.
>