From: John David Anglin Date: Sun, 30 Oct 2011 03:21:45 +0000 (+0000) Subject: re PR target/50691 (Incorrect argument evaluation in call with __thread argument) X-Git-Tag: releases/gcc-4.4.7~191 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69d1ecf101f9ab5c169dc7687d06e61ade2ce878;p=thirdparty%2Fgcc.git re PR target/50691 (Incorrect argument evaluation in call with __thread argument) PR target/50691 * config/pa/pa.c (emit_move_sequence): Legitimize TLS symbol references. * config/pa/pa.h (LEGITIMATE_CONSTANT_P): Return false for TLS_MODEL_GLOBAL_DYNAMIC and TLS_MODEL_LOCAL_DYNAMIC symbol references. From-SVN: r180672 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 21cb741228ed..10200c204693 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2011-10-29 John David Anglin + + PR target/50691 + * config/pa/pa.c (emit_move_sequence): Legitimize TLS symbol references. + * config/pa/pa.h (LEGITIMATE_CONSTANT_P): Return false for + TLS_MODEL_GLOBAL_DYNAMIC and TLS_MODEL_LOCAL_DYNAMIC symbol references. + 2011-10-23 Uros Bizjak PR target/50788 diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 6318611bd9af..1bba63e1d9e2 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -1669,6 +1669,11 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg) /* Handle the most common case: storing into a register. */ else if (register_operand (operand0, mode)) { + /* Legitimize TLS symbol references. This happens for references + that aren't a legitimate constant. */ + if (PA_SYMBOL_REF_TLS_P (operand1)) + operand1 = legitimize_tls_address (operand1); + if (register_operand (operand1, mode) || (GET_CODE (operand1) == CONST_INT && cint_ok_for_move (INTVAL (operand1))) diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index aec5fa12d4a4..f4e56a769766 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -1070,6 +1070,9 @@ extern int may_call_alloca; && (NEW_HP_ASSEMBLER \ || TARGET_GAS \ || GET_CODE (X) != LABEL_REF) \ + && (!PA_SYMBOL_REF_TLS_P (X) \ + || (SYMBOL_REF_TLS_MODEL (X) != TLS_MODEL_GLOBAL_DYNAMIC \ + && SYMBOL_REF_TLS_MODEL (X) != TLS_MODEL_LOCAL_DYNAMIC)) \ && (!TARGET_64BIT \ || GET_CODE (X) != CONST_DOUBLE) \ && (!TARGET_64BIT \