* calls.c (precompute_register_parameters): Force non-legitimate
constants into pseudos.
* gcc.dg/tls/opt-3.c: New.
From-SVN: r57709
+2002-10-01 Richard Henderson <rth@redhat.com>
+
+ * calls.c (precompute_register_parameters): Force non-legitimate
+ constants into pseudos.
+
2002-10-01 Nick Clifton <nickc@redhat.com>
* config/rs6000/spe.md (spe_evrlwi): Add missing third operand
emit_queue ();
}
+ /* If the value is a non-legitimate constant, force it into a
+ pseudo now. TLS symbols sometimes need a call to resolve. */
+ if (CONSTANT_P (args[i].value)
+ && !LEGITIMATE_CONSTANT_P (args[i].value))
+ args[i].value = force_reg (args[i].mode, args[i].value);
+
/* If we are to promote the function arg to a wider mode,
do it now. */
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fpic } */
+/* { dg-options "-O2 -fpic -mregparm=3" { target i?86-*-* } } */
+
+extern __thread int i, j, k;
+extern void bar(int *, int *, int *);
+void foo(void)
+{
+ bar(&i, &j, &k);
+}