aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2002-02-25 17:38:53 -0500
committerJason Merrill <jason@gcc.gnu.org>2002-02-25 17:38:53 -0500
commit67282790905646306eb5c651d14dfb39a3627920 (patch)
tree90adb1f9c68b91787e88c2be94b09cf9fd7956e8
parent5c1817565f2c0f669634fab893d03cc83c215a4f (diff)
downloadgcc-67282790905646306eb5c651d14dfb39a3627920.zip
gcc-67282790905646306eb5c651d14dfb39a3627920.tar.gz
gcc-67282790905646306eb5c651d14dfb39a3627920.tar.bz2
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
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/attribs.c4
-rw-r--r--gcc/testsuite/g++.dg/ext/attrib3.C6
3 files changed, 11 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 385826c..f2faf55 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+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
diff --git a/gcc/attribs.c b/gcc/attribs.c
index 543931a..b915c880 100644
--- a/gcc/attribs.c
+++ b/gcc/attribs.c
@@ -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;
diff --git a/gcc/testsuite/g++.dg/ext/attrib3.C b/gcc/testsuite/g++.dg/ext/attrib3.C
index 40dbb0f..17a904c 100644
--- a/gcc/testsuite/g++.dg/ext/attrib3.C
+++ b/gcc/testsuite/g++.dg/ext/attrib3.C
@@ -1,17 +1,17 @@
// 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);
}