diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-09-21 14:45:25 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-09-21 14:45:25 -0400 |
commit | bbbd670050382b8998c4b639e8cc0ed61686487d (patch) | |
tree | 6e58f692b55227a1d47c334626a3abf9f9e97bc1 /gcc | |
parent | fc4a0dca1b2250923b5be56a178e28fd1f514ce6 (diff) | |
download | gcc-bbbd670050382b8998c4b639e8cc0ed61686487d.zip gcc-bbbd670050382b8998c4b639e8cc0ed61686487d.tar.gz gcc-bbbd670050382b8998c4b639e8cc0ed61686487d.tar.bz2 |
(mark_addressable): Give different error if trying to put object with volatile fields into register...
(mark_addressable): Give different error if trying to put object with
volatile fields into register; don't use DECL_NAME.
From-SVN: r8115
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-typeck.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index d09399b..b3b3682 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -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))); } |