This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [testsuite] PATCH: Add -fno-pie to gcc.target/i386/pr54445-2.c
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 15 Jan 2015 05:00:14 -0800
- Subject: Re: [testsuite] PATCH: Add -fno-pie to gcc.target/i386/pr54445-2.c
- Authentication-results: sourceware.org; auth=none
- References: <20150112003413 dot GA30204 at gmail dot com> <CAFULd4bnGVujHTYWBrq=mVO4bS=SBL+Mi13uUbKLC0q5L=W5Jw at mail dot gmail dot com>
On Thu, Jan 15, 2015 at 4:44 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Mon, Jan 12, 2015 at 1:34 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> Since PIE is also PIC, we need to add -fno-pie to avoid PIC. OK for trunk?
>>
>> Thanks.
>>
>> H.J.
>> ---
>> gcc/testsuite/gcc.target/i386/pr54445-2.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> 2015-01-11 H.J. Lu <hongjiu.lu@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.
--
H.J.