diff mbox

[PR58066] preferred_stack_boundary update for tls expanded call

Message ID CA+4CFy4m-hwwhq=_aj+-8MhNf03_DRy6a_FpaabWY_pfXTErJw@mail.gmail.com
State New
Headers show

Commit Message

Wei Mi May 11, 2014, 12:55 a.m. UTC
Here is a patch for the test. It contains two changes:
1. For emutls, there will be an explicit call generated at expand
pass, and no stack adjustment is needed. So add /* {
dg-require-effective-target tls_native } */ in the test.
2. Replace cfi_def_cfa_offset with insn sequence check.

Is it ok?

Thanks,
Wei.

"sub\[^\r\n\]*8\[^\r\n\]*sp.*call\[^\r\n\]*__tls_get_addr.*sub\[^\r\n\]*8\[^\r\n\]*sp.*call\[^\r\n\]*__tls_get_addr"
} } */

On Sat, May 10, 2014 at 6:47 AM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
> dominiq@lps.ens.fr (Dominique Dhumieres) writes:
>
>>> This is the updated patch of pr58066-3.patch. ...
>>
>> On x86_64-apple-darwin13 I get
>>
>> FAIL: gcc.target/i386/pr58066.c scan-assembler-times .cfi_def_cfa_offset 16 2
>
> Same on i386-pc-solaris2.* with Sun as (which doesn't support cfi
> directives).
>
>         Rainer
>
> --
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University

Comments

Rainer Orth May 12, 2014, 2:58 p.m. UTC | #1
Hi Wei,

please teach your mailer not to break/mangle long lines.  Thanks.

> Here is a patch for the test. It contains two changes:
> 1. For emutls, there will be an explicit call generated at expand
> pass, and no stack adjustment is needed. So add /* {
> dg-require-effective-target tls_native } */ in the test.
> 2. Replace cfi_def_cfa_offset with insn sequence check.
>
> Is it ok?

No, the test FAILs for 32-bit i386-pc-solaris2.11 with Sun as/ld:

FAIL: gcc.target/i386/pr58066.c scan-assembler sub[^\r\n]*8[^\r\n]*sp.*call[^\r\n]*__tls_get_addr.*sub[^\r\n]*8[^\r\n]*sp.*call[^\r\n]*__tls_get_addr

The TLS code sequence is different here:

        subl    $8, %esp
        leal    ccc1@tlsgd(,%ebx,1), %eax
        call    ccc1@tlsgdplt

I fear this insn scanning is going to be extremely fragile.

	Rainer
diff mbox

Patch

Index: testsuite/gcc.target/i386/pr58066.c
===================================================================
--- testsuite/gcc.target/i386/pr58066.c (revision 210301)
+++ testsuite/gcc.target/i386/pr58066.c (working copy)
@@ -1,5 +1,6 @@ 
 /* { dg-do compile } */
-/* { dg-options "-fPIC -O2" } */
+/* { dg-require-effective-target tls_native } */
+/* { dg-options "-fPIC -fomit-frame-pointer -O2" } */

 /* Check whether the stack frame starting addresses of tls expanded calls
    in foo and goo are 16bytes aligned.  */
@@ -15,4 +16,4 @@  void* goo()
  return &ccc2;
 }

-/* { dg-final { scan-assembler-times ".cfi_def_cfa_offset 16" 2 } } */
+/* { dg-final { scan-assembler