On Thu, Jan 15, 2015 at 02:02:51PM +0100, Uros Bizjak wrote: > On Thu, Jan 15, 2015 at 2:00 PM, H.J. Lu <hjl.to...@gmail.com> wrote: > > >>> gcc/testsuite/gcc.target/i386/pr54445-2.c | 2 +- > >>> 1 file changed, 1 insertion(+), 1 deletion(-) > >>> > >>> 2015-01-11 H.J. Lu <hongjiu...@intel.com> > >>> > >>> * gcc.target/i386/pr54445-2.c: Add -fno-pie. > >>> > >>> diff --git a/gcc/testsuite/gcc.target/i386/pr54445-2.c > >>> b/gcc/testsuite/gcc.target/i386/pr54445-2.c > >>> index 5151c13..4d49816 100644 > >>> --- a/gcc/testsuite/gcc.target/i386/pr54445-2.c > >>> +++ b/gcc/testsuite/gcc.target/i386/pr54445-2.c > >>> @@ -1,5 +1,5 @@ > >>> /* { dg-do compile { target { *-*-linux* && { ! { ia32 } } } } } */ > >>> -/* { dg-options "-O2 -fno-pic" } */ > >>> +/* { dg-options "-O2 -fno-pic -fno-pie" } */ > >>> > >>> __thread unsigned char tls_array[64]; > >> > >> No. PI *executable* has nothing to do with the access to data. > >> > >> Can you rather investigate why -fpie is generating: > >> > >> movzbl %fs:-1+tls_array@tpoff(%rdi), %eax > >> > >> instead of (expected) > >> > >> movzbl %fs:tls_array@tpoff-1(%rdi), %eax > >> > >> Uros. > > > > They have the same encoding. The differences are in the order of address > > in the first operand due to different output orders of PLUS between > > output_addr_const and output_pic_addr_const. > > Then we should improve scan string to accept both expressions. >
The order of address in the first operand is different due to different output orders of PLUS between output_addr_const and output_pic_addr_const. This patch adjusts scan string for PIE in gcc.target/i386/pr54445-2.c. Tested on Linux/x86-64. OK to install? Thanks. H.J. --- * gcc.target/i386/pr54445-2.c: Adjust scan string for PIE. --- gcc/testsuite/gcc.target/i386/pr54445-2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.target/i386/pr54445-2.c b/gcc/testsuite/gcc.target/i386/pr54445-2.c index 5151c13..f0ca9dc 100644 --- a/gcc/testsuite/gcc.target/i386/pr54445-2.c +++ b/gcc/testsuite/gcc.target/i386/pr54445-2.c @@ -8,4 +8,4 @@ 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\\(%" } } */ +/* { dg-final { scan-assembler "mov(b|zbl)\[ \t\](%fs:)?(-1\\+)?tls_array@tpoff(-1)?\\(%" } } */ -- 1.9.3