Commit 67282790 by Jason Merrill Committed by Jason Merrill

attribs.c (decl_attributes): Also re-layout PARM_DECL and RESULT_DECL.

        * attribs.c (decl_attributes): Also re-layout PARM_DECL and
        RESULT_DECL.

From-SVN: r50027
parent 5c181756
2002-02-25 Jason Merrill <jason@redhat.com>
* attribs.c (decl_attributes): Also re-layout PARM_DECL and
RESULT_DECL.
2002-02-25 Alexandre Oliva <aoliva@redhat.com>
* gcc.c (init_gcc_specs): Get -shared-libgcc along with -shared to
......
......@@ -386,7 +386,9 @@ decl_attributes (node, attributes, flags)
/* Layout the decl in case anything changed. */
if (spec->type_required && DECL_P (*node)
&& TREE_CODE (*node) == VAR_DECL)
&& (TREE_CODE (*node) == VAR_DECL
|| TREE_CODE (*node) == PARM_DECL
|| TREE_CODE (*node) == RESULT_DECL))
{
/* Force a recalculation of mode and size. */
DECL_MODE (*node) = VOIDmode;
......
// Test that attributes work in a variety of situations.
// { dg-options -Wunused }
// { dg-options -O }
// { dg-do run }
#define attrib __attribute ((mode (QI)))
#define attrib2 __attribute ((unused))
attrib signed int a; // attributes before type are broken
static attrib unsigned int b;
int foo(attrib2 int o) // attribute arguments are broken
int foo(attrib int o) // attribute arguments are broken
{
return (sizeof (a) != 1
|| sizeof (b) != 1
|| sizeof (o) != 1
|| sizeof ((attrib signed int) b) != 1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment