stmt.c (expand_asm_operands): Check whether force_const_mem succeeded.

* stmt.c (expand_asm_operands): Check whether force_const_mem
	succeeded.

testsuite/
	* gcc.dg/tls/asm-1.C: New test.

From-SVN: r74035
This commit is contained in:
Richard Sandiford 2003-11-29 18:54:43 +00:00 committed by Richard Sandiford
parent 2d25605a54
commit 9c85868198
4 changed files with 25 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2003-11-29 Richard Sandiford <rsandifo@redhat.com>
* stmt.c (expand_asm_operands): Check whether force_const_mem
succeeded.
2003-11-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* config/gnu.h (HURD_TARGET_OS_CPP_BUILTINS): New.

View File

@ -1712,13 +1712,16 @@ expand_asm_operands (tree string, tree outputs, tree inputs,
if (CONSTANT_P (op))
{
op = force_const_mem (TYPE_MODE (type), op);
op = validize_mem (op);
rtx mem = force_const_mem (TYPE_MODE (type), op);
if (mem)
op = validize_mem (mem);
else
op = force_reg (TYPE_MODE (type), op);
}
else if (GET_CODE (op) == REG
|| GET_CODE (op) == SUBREG
|| GET_CODE (op) == ADDRESSOF
|| GET_CODE (op) == CONCAT)
if (GET_CODE (op) == REG
|| GET_CODE (op) == SUBREG
|| GET_CODE (op) == ADDRESSOF
|| GET_CODE (op) == CONCAT)
{
tree qual_type = build_qualified_type (type,
(TYPE_QUALS (type)

View File

@ -1,3 +1,7 @@
2003-11-29 Richard Sandiford <rsandifo@redhat.com>
* gcc.dg/tls/asm-1.C: New test.
2003-11-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* testsuite/gcc.dg/cpp/assert4.c: Update.

View File

@ -0,0 +1,7 @@
/* { dg-options "-Werror" } */
__thread int i;
int foo ()
{
asm volatile ("" :: "m" (&i)); /* { dg-error "lvalue" } */
}