Patchwork [PR58066] preferred_stack_boundary update for tls expanded call

login
register
mail settings
Submitter Wei Mi
Date March 12, 2014, 10:28 p.m.
Message ID <CA+4CFy5NmXE656_hCOmC3_J2Pmm_KiamoLX7Pep0Z7yPNuObqQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/329729/
State New
Headers show

Comments

Wei Mi - March 12, 2014, 10:28 p.m.
On Wed, Mar 12, 2014 at 3:07 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Wed, Mar 12, 2014 at 2:58 PM, Wei Mi <wmi@google.com> wrote:
>> This is the updated testcase.
>
> Does my patch fix the original problem?

Yes, it works. I am doing bootstrap and regression test for your patch. Thanks!

>
>> Thanks,
>> Wei.
>>
>> ===================================================================
>> --- testsuite/gcc.dg/pr58066.c (revision 0)
>> +++ testsuite/gcc.dg/pr58066.c (revision 0)
>> @@ -0,0 +1,18 @@
>> +/* { dg-do compile { target {{ i?86-*-* x86_64-*-* } && { ! ia32 } } } } */
>
> Since it is a C testcase and we should test it under ia32, it
> should be moved to gcc.target/i386 and remove target.
>

Fixed.

Thanks,
Wei.
Wei Mi - March 13, 2014, 12:28 a.m.
>> Does my patch fix the original problem?
>
> Yes, it works. I am doing bootstrap and regression test for your patch. Thanks!
>

The patch passes bootstrap and regression test on x86_64-linux-gnu.

Thanks,
Wei.

Patch

Index: testsuite/gcc.target/i386/pr58066.c
===================================================================
--- testsuite/gcc.target/i386/pr58066.c (revision 0)
+++ testsuite/gcc.target/i386/pr58066.c (revision 0)
@@ -0,0 +1,18 @@ 
+/* { dg-do compile } */
+/* { dg-options "-fPIC -O2" } */
+
+/* Check whether the stack frame starting addresses of tls expanded calls
+   in foo and goo are 16bytes aligned.  */
+static __thread char ccc1;
+void* foo()
+{
+ return &ccc1;
+}
+
+__thread char ccc2;
+void* goo()
+{
+ return &ccc2;
+}
+
+/* { dg-final { scan-assembler-times ".cfi_def_cfa_offset 16" 2 } } */