diff options
author | Adam Nemet <anemet@lnxw.com> | 2004-11-10 21:09:25 +0000 |
---|---|---|
committer | Adam Nemet <nemet@gcc.gnu.org> | 2004-11-10 21:09:25 +0000 |
commit | 1b8d7c9a2f59ea73c66a7fea32de2ff7e25f6344 (patch) | |
tree | 178e47c46da7165af4de9d3bd758b213f1909246 | |
parent | 7299dbfbf14f76336d18706df4e90c1ba167b4ae (diff) | |
download | gcc-1b8d7c9a2f59ea73c66a7fea32de2ff7e25f6344.zip gcc-1b8d7c9a2f59ea73c66a7fea32de2ff7e25f6344.tar.gz gcc-1b8d7c9a2f59ea73c66a7fea32de2ff7e25f6344.tar.bz2 |
re PR middle-end/18160 (ICE on taking register variable address)
PR middle-end/18160
* typeck.c (cxx_mark_addressable): Issue an error if address of an
explicit register variable is requested.
From-SVN: r90452
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 13 |
2 files changed, 16 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 080e246..d6a7eeb 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2004-11-10 Adam Nemet <anemet@lnxw.com> + + PR middle-end/18160 + * typeck.c (cxx_mark_addressable): Issue an error if address of an + explicit register variable is requested. + 2004-11-10 Nathan Sidwell <nathan@codesourcery.com> PR c++/18143 diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index c83d33a..ce3f2f7 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -4343,9 +4343,16 @@ cxx_mark_addressable (tree exp) case CONST_DECL: case RESULT_DECL: if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x) - && !DECL_ARTIFICIAL (x) && extra_warnings) - warning ("address requested for %qD, which is declared %<register%>", - x); + && !DECL_ARTIFICIAL (x)) + if (DECL_HARD_REGISTER (x) != 0) + { + error + ("address of explicit register variable %qD requested", x); + return false; + } + else if (extra_warnings) + warning + ("address requested for %qD, which is declared %<register%>", x); TREE_ADDRESSABLE (x) = 1; return true; |