Commit 0039fa55 by Adam Nemet Committed by Adam Nemet

re PR middle-end/18160 (ICE on taking register variable address)

	PR middle-end/18160
	* c-typeck.c (c_mark_addressable): Issue error if address of a
	register variable is taken.  Use "%qD" to print DECL_NAME.

From-SVN: r89772
parent 5c588b22
2004-10-28 Adam Nemet <anemet@lnxw.com>
PR middle-end/18160
* c-typeck.c (c_mark_addressable): Issue error if address of a
register variable is taken. Use "%qD" to print DECL_NAME.
2004-10-28 Diego Novillo <dnovillo@redhat.com>
* opts.c (decode_options): Don't run PRE at -Os.
......
......@@ -2818,8 +2818,8 @@ c_mark_addressable (tree exp)
case COMPONENT_REF:
if (DECL_C_BIT_FIELD (TREE_OPERAND (x, 1)))
{
error ("cannot take address of bit-field %qs",
IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (x, 1))));
error
("cannot take address of bit-field %qD", TREE_OPERAND (x, 1));
return false;
}
......@@ -2846,24 +2846,19 @@ c_mark_addressable (tree exp)
{
if (TREE_PUBLIC (x) || TREE_STATIC (x) || DECL_EXTERNAL (x))
{
error ("global register variable %qs used in nested function",
IDENTIFIER_POINTER (DECL_NAME (x)));
error
("global register variable %qD used in nested function", x);
return false;
}
pedwarn ("register variable %qs used in nested function",
IDENTIFIER_POINTER (DECL_NAME (x)));
pedwarn ("register variable %qD used in nested function", x);
}
else if (C_DECL_REGISTER (x))
{
if (TREE_PUBLIC (x) || TREE_STATIC (x) || DECL_EXTERNAL (x))
{
error ("address of global register variable %qs requested",
IDENTIFIER_POINTER (DECL_NAME (x)));
return false;
}
pedwarn ("address of register variable %qs requested",
IDENTIFIER_POINTER (DECL_NAME (x)));
error ("address of global register variable %qD requested", x);
else
error ("address of register variable %qD requested", x);
return false;
}
/* drops in */
......
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