(mark_addressable): Give different error if trying to put object with volatile fields...
authorRichard Kenner <kenner@gcc.gnu.org>
Wed, 21 Sep 1994 18:45:25 +0000 (14:45 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Wed, 21 Sep 1994 18:45:25 +0000 (14:45 -0400)
(mark_addressable): Give different error if trying to put object with
volatile fields into register; don't use DECL_NAME.

From-SVN: r8115

gcc/c-typeck.c

index d09399bbec7335dd1f4c9e1fbcb359a94ecf7946..b3b36821b2a699a61c4ab8f043155a7d05a9f6f5 100644 (file)
@@ -3223,6 +3223,18 @@ mark_addressable (exp)
                       IDENTIFIER_POINTER (DECL_NAME (x)));
                return 0;
              }
+
+           /* If we are making this addressable due to its having
+              volatile components, give a different error message.  Also
+              handle the case of an unnamed parameter by not trying
+              to give the name.  */
+
+           else if (C_TYPE_FIELDS_VOLATILE (TREE_TYPE (x)))
+             {
+               error ("cannot put object with volatile field into register");
+               return 0;
+             }
+
            pedwarn ("address of register variable `%s' requested",
                     IDENTIFIER_POINTER (DECL_NAME (x)));
          }