Commit aa8dea09 by Richard Henderson Committed by Richard Henderson

typeck.c (mark_addressable): Don't test TREE_ADDRESSABLE early.

        * typeck.c (mark_addressable): Don't test TREE_ADDRESSABLE early.
        Call put_var_into_stack.
        * g++.dg/opt/asm1.C: New.

From-SVN: r54862
parent 2b3aadfc
2002-06-20 Richard Henderson <rth@redhat.com>
PR c++/6747
* typeck.c (mark_addressable): Don't test TREE_ADDRESSABLE early.
Call put_var_into_stack.
2002-06-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* spew.c (remove_last_token): Use ARRAY_SIZE in lieu of explicit
......
......@@ -4805,9 +4805,6 @@ cxx_mark_addressable (exp)
{
register tree x = exp;
if (TREE_ADDRESSABLE (x) == 1)
return true;
while (1)
switch (TREE_CODE (x))
{
......@@ -4826,6 +4823,8 @@ cxx_mark_addressable (exp)
TREE_ADDRESSABLE (x) = 1; /* so compiler doesn't die later */
return true;
}
/* FALLTHRU */
case VAR_DECL:
/* Caller should not be trying to mark initialized
constant fields addressable. */
......@@ -4833,6 +4832,7 @@ cxx_mark_addressable (exp)
|| DECL_IN_AGGR_P (x) == 0
|| TREE_STATIC (x)
|| DECL_EXTERNAL (x), 314);
/* FALLTHRU */
case CONST_DECL:
case RESULT_DECL:
......@@ -4841,6 +4841,7 @@ cxx_mark_addressable (exp)
warning ("address requested for `%D', which is declared `register'",
x);
TREE_ADDRESSABLE (x) = 1;
put_var_into_stack (x);
return true;
case FUNCTION_DECL:
......
// PR c++/6747
// { dg-do compile }
// { dg-options "-O" }
void foo()
{
union { double d; char c[sizeof(double)]; } tmp;
__asm__ ("" : "=m" (tmp.d)); // { dg-bogus "not directly addressable" }
}
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