Commit 1b8d7c9a by Adam Nemet Committed by Adam Nemet

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
parent 7299dbfb
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> 2004-11-10 Nathan Sidwell <nathan@codesourcery.com>
PR c++/18143 PR c++/18143
......
...@@ -4343,9 +4343,16 @@ cxx_mark_addressable (tree exp) ...@@ -4343,9 +4343,16 @@ cxx_mark_addressable (tree exp)
case CONST_DECL: case CONST_DECL:
case RESULT_DECL: case RESULT_DECL:
if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x) if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x)
&& !DECL_ARTIFICIAL (x) && extra_warnings) && !DECL_ARTIFICIAL (x))
warning ("address requested for %qD, which is declared %<register%>", if (DECL_HARD_REGISTER (x) != 0)
x); {
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; TREE_ADDRESSABLE (x) = 1;
return true; return true;
......
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