Commit 9691b9a7 by H.J. Lu Committed by H.J. Lu

Allow negative offset for UNSPEC_DTPOFF/UNSPEC_NTPOFF

gcc/

	PR target/54445
	* config/i386/predicates.md (x86_64_immediate_operand): Allow
	negative offset for UNSPEC_DTPOFF/UNSPEC_NTPOFF.

gcc/testsuite/

	PR target/54445
	* gcc.target/i386/pr54445-1.c: New file.
	* gcc.target/i386/pr54445-2.c: Likewise.

From-SVN: r191230
parent c3c445e1
2012-09-12 H.J. Lu <hongjiu.lu@intel.com>
PR target/54445
* config/i386/predicates.md (x86_64_immediate_operand): Allow
negative offset for UNSPEC_DTPOFF/UNSPEC_NTPOFF.
2012-09-12 Jan Hubicka <jh@suse.cz>
* common.opt (flto-partition): Add "max".
......
......@@ -201,8 +201,7 @@
{
case UNSPEC_DTPOFF:
case UNSPEC_NTPOFF:
if (offset > 0
&& trunc_int_for_mode (offset, SImode) == offset)
if (trunc_int_for_mode (offset, SImode) == offset)
return true;
}
break;
......
2012-09-12 H.J. Lu <hongjiu.lu@intel.com>
PR target/54445
* gcc.target/i386/pr54445-1.c: New file.
* gcc.target/i386/pr54445-2.c: Likewise.
2012-09-12 Tobias Burnus <burnus@net-b.de>
PR fortran/54225
......
/* { dg-do run } */
/* { dg-options "-O2" } */
__thread unsigned char tls_array[64];
unsigned char
__attribute__ ((noinline))
tls_array_lookup_with_negative_constant(long long int position) {
return tls_array[position - 1];
}
int
main ()
{
int i;
for (i = 0; i < sizeof (tls_array) / sizeof (tls_array[0]); i++)
tls_array[i] = i;
for (i = 0; i < sizeof (tls_array) / sizeof (tls_array[0]); i++)
if (i != tls_array_lookup_with_negative_constant (i + 1))
__builtin_abort ();
return 0;
}
/* { dg-do compile { target { *-*-linux* && { ! { ia32 } } } } } */
/* { dg-options "-O2 -fno-pic" } */
__thread unsigned char tls_array[64];
unsigned char
tls_array_lookup_with_negative_constant(long long int position) {
return tls_array[position - 1];
}
/* { dg-final { scan-assembler "mov(b|zbl)\[ \t\](%fs:)?tls_array@tpoff-1\\(%" } } */
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