aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>2011-10-29 15:57:00 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2011-10-29 15:57:00 +0000
commit9a201645052b874b4455c042ddd31f5d5e79a69c (patch)
tree34c75b89e40211352f5b68541e34bb02d1e4d1f1 /gcc
parentd702f362b50d9f6fe4a92b2404c6b9ec51f2708c (diff)
downloadgcc-9a201645052b874b4455c042ddd31f5d5e79a69c.zip
gcc-9a201645052b874b4455c042ddd31f5d5e79a69c.tar.gz
gcc-9a201645052b874b4455c042ddd31f5d5e79a69c.tar.bz2
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. (pa_legitimate_constant_p): Return false for TLS_MODEL_GLOBAL_DYNAMIC and TLS_MODEL_LOCAL_DYNAMIC symbol references. From-SVN: r180655
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/pa/pa.c15
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f25b3f0..08687df 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2011-10-29 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR target/50691
+ config/pa/pa.c (emit_move_sequence): Legitimize TLS symbol references.
+ (pa_legitimate_constant_p): Return false for TLS_MODEL_GLOBAL_DYNAMIC
+ and TLS_MODEL_LOCAL_DYNAMIC symbol references.
+
2011-10-29 Georg-Johann Lay <avr@gjlay.de>
PR target/50887
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 66e3fc7..85ccf89 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -1781,6 +1781,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)))
@@ -10271,6 +10276,16 @@ pa_legitimate_constant_p (enum machine_mode mode, rtx x)
if (!NEW_HP_ASSEMBLER && !TARGET_GAS && GET_CODE (x) == LABEL_REF)
return false;
+ /* TLS_MODEL_GLOBAL_DYNAMIC and TLS_MODEL_LOCAL_DYNAMIC are not
+ legitimate constants. */
+ if (PA_SYMBOL_REF_TLS_P (x))
+ {
+ enum tls_model model = SYMBOL_REF_TLS_MODEL (x);
+
+ if (model == TLS_MODEL_GLOBAL_DYNAMIC || model == TLS_MODEL_LOCAL_DYNAMIC)
+ return false;
+ }
+
if (TARGET_64BIT && GET_CODE (x) == CONST_DOUBLE)
return false;