Bug 83838 - Many gcc.target/i386/indirect-thunk*.c tests FAIL
Summary: Many gcc.target/i386/indirect-thunk*.c tests FAIL
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 8.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: testsuite-fail
Depends on:
Blocks:
 
Reported: 2018-01-14 19:43 UTC by Rainer Orth
Modified: 2021-12-27 22:35 UTC (History)
1 user (show)

See Also:
Host:
Target: i386-pc-solaris2.10
Build:
Known to work:
Known to fail:
Last reconfirmed: 2018-01-14 00:00:00


Attachments
i386-pc-solaris2.11 -m32 assembler output (265 bytes, text/plain)
2018-01-14 19:44 UTC, Rainer Orth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Orth 2018-01-14 19:43:02 UTC
Many of the new gcc.target/i386/indirect-thunk*.c tests FAIL on Solaris/x86
(both 32 and 64-bit):

+FAIL: gcc.target/i386/indirect-thunk-1.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/indirect-thunk-2.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/indirect-thunk-3.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/indirect-thunk-4.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/indirect-thunk-7.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/indirect-thunk-attr-1.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/indirect-thunk-attr-2.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/indirect-thunk-attr-5.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/indirect-thunk-attr-6.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/indirect-thunk-attr-7.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/indirect-thunk-bnd-1.c scan-assembler bnd jmp[ \\t]*__x86_indirect_thunk_bnd
+FAIL: gcc.target/i386/indirect-thunk-bnd-2.c scan-assembler bnd jmp[ \\t]*__x86_indirect_thunk_bnd
+FAIL: gcc.target/i386/indirect-thunk-extern-1.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/indirect-thunk-extern-2.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/indirect-thunk-extern-3.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/indirect-thunk-extern-4.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/indirect-thunk-extern-7.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/indirect-thunk-register-1.c scan-assembler jmp[ \\t]*__x86_indirect_thunk_(r|e)ax
+FAIL: gcc.target/i386/indirect-thunk-register-3.c scan-assembler jmp[ \\t]*__x86_indirect_thunk_(r|e)ax

+FAIL: gcc.target/i386/ret-thunk-1.c scan-assembler jmp[ \\t]*__x86_return_thunk
+FAIL: gcc.target/i386/ret-thunk-10.c scan-assembler __x86_indirect_thunk:
+FAIL: gcc.target/i386/ret-thunk-10.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/ret-thunk-11.c scan-assembler __x86_indirect_thunk:
+FAIL: gcc.target/i386/ret-thunk-11.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/ret-thunk-11.c scan-assembler jmp[ \\t]*__x86_return_thunk
+FAIL: gcc.target/i386/ret-thunk-12.c scan-assembler __x86_indirect_thunk:
+FAIL: gcc.target/i386/ret-thunk-12.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/ret-thunk-13.c scan-assembler jmp[ \\t]*__x86_return_thunk
+FAIL: gcc.target/i386/ret-thunk-14.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/ret-thunk-15.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/ret-thunk-15.c scan-assembler jmp[ \\t]*__x86_return_thunk
+FAIL: gcc.target/i386/ret-thunk-3.c scan-assembler jmp[ \\t]*__x86_return_thunk
+FAIL: gcc.target/i386/ret-thunk-5.c scan-assembler jmp[ \\t]*__x86_return_thunk
+FAIL: gcc.target/i386/ret-thunk-7.c scan-assembler jmp[ \\t]*__x86_return_thunk
+FAIL: gcc.target/i386/ret-thunk-9.c scan-assembler __x86_indirect_thunk:
+FAIL: gcc.target/i386/ret-thunk-9.c scan-assembler jmp[ \\t]*__x86_indirect_thunk
+FAIL: gcc.target/i386/ret-thunk-9.c scan-assembler jmp[ \\t]*__x86_return_thunk

I'm adding gcc.target/i386/indirect-thunk-1.c assembler output as an example.

  Rainer
Comment 1 Rainer Orth 2018-01-14 19:44:01 UTC
Created attachment 43123 [details]
i386-pc-solaris2.11 -m32 assembler output
Comment 2 H.J. Lu 2018-01-14 21:04:34 UTC
Solaris fails these tests due to

sol2.h:#define USE_HIDDEN_LINKONCE 0

We can limit these tests to Linux only.
Comment 3 H.J. Lu 2018-01-14 21:10:25 UTC
There are

/* Only recent versions of Solaris 11 ld properly support hidden .gnu.linkonce
   sections, so don't use them.  */
#ifndef USE_GLD
#define USE_HIDDEN_LINKONCE 0
#endif

But GCC generates comdat:

	.section	.text.__x86_indirect_thunk,"axG",@progbits,__x86_indirec
t_thunk,comdat
	.globl	__x86_indirect_thunk
	.hidden	__x86_indirect_thunk
	.type	__x86_indirect_thunk, @function

Does Solaris ld support comdat?
Comment 4 ro@CeBiTec.Uni-Bielefeld.DE 2018-01-15 09:59:44 UTC
> --- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
> There are
>
> /* Only recent versions of Solaris 11 ld properly support hidden .gnu.linkonce
>    sections, so don't use them.  */
> #ifndef USE_GLD
> #define USE_HIDDEN_LINKONCE 0
> #endif

If I can figure out when full support for .gnu.linkonce started in
Solaris ld, I can make this dynamic in configure.ac ...

> But GCC generates comdat:
>
>         .section       
> .text.__x86_indirect_thunk,"axG",@progbits,__x86_indirec
> t_thunk,comdat
>         .globl  __x86_indirect_thunk
>         .hidden __x86_indirect_thunk
>         .type   __x86_indirect_thunk, @function
>
> Does Solaris ld support comdat?

... like this one: complete Solaris ld support for comdat started
sometime in the Solaris 11 timeframe, cf. configure.ac (comdat_group).
Solaris 10 did not (at least not in a way that could cope with
everything gcc might generate).

	Rainer
Comment 5 H.J. Lu 2018-01-15 23:28:02 UTC
(In reply to ro@CeBiTec.Uni-Bielefeld.DE from comment #4)
> > --- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
> > There are
> >
> > /* Only recent versions of Solaris 11 ld properly support hidden .gnu.linkonce
> >    sections, so don't use them.  */
> > #ifndef USE_GLD
> > #define USE_HIDDEN_LINKONCE 0
> > #endif
> 
> If I can figure out when full support for .gnu.linkonce started in
> Solaris ld, I can make this dynamic in configure.ac ...
> 
> > But GCC generates comdat:
> >
> >         .section       
> > .text.__x86_indirect_thunk,"axG",@progbits,__x86_indirec
> > t_thunk,comdat
> >         .globl  __x86_indirect_thunk
> >         .hidden __x86_indirect_thunk
> >         .type   __x86_indirect_thunk, @function
> >
> > Does Solaris ld support comdat?
> 
> ... like this one: complete Solaris ld support for comdat started
> sometime in the Solaris 11 timeframe, cf. configure.ac (comdat_group).
> Solaris 10 did not (at least not in a way that could cope with
> everything gcc might generate).
> 

G++ uses comdat extensively.  Without comdat, g++ generates very
odd codes.  Please double check if libstdc++ object files on Solaris
have any comdat sections.
Comment 6 ro@CeBiTec.Uni-Bielefeld.DE 2018-01-16 08:25:57 UTC
> --- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> ---
[...]
>> > Does Solaris ld support comdat?
>> 
>> ... like this one: complete Solaris ld support for comdat started
>> sometime in the Solaris 11 timeframe, cf. configure.ac (comdat_group).
>> Solaris 10 did not (at least not in a way that could cope with
>> everything gcc might generate).
>
> G++ uses comdat extensively.  Without comdat, g++ generates very
> odd codes.  Please double check if libstdc++ object files on Solaris
> have any comdat sections.

It's exactly as I said:

sol10 $ readelf -g i386-pc-solaris2.10/libstdc++-v3/src/.libs/libstdc++.a

File: i386-pc-solaris2.10/libstdc++-v3/src/.libs/libstdc++.a(compatibility.o)

There are no section groups in this file.

[... and so on for every object]

sol11 $ elfdump -g i386-pc-solaris2.11/libstdc++-v3/src/.libs/libstdc++.a

i386-pc-solaris2.11/libstdc++-v3/src/.libs/libstdc++.a(compatibility.o):

Group Section:  .group%DW.ref._ZTIN10__cxxabiv115__forced_unwindE
  Signature Symbol: DW.ref._ZTIN10__cxxabiv115__forced_unwindE
  Members:
    index   flags / section
      [0]   [ COMDAT ]
      [1]   .data.DW.ref._ZTIN10__cxxabiv115__forced_unwindE%DW.ref._ZTIN10__cxxabiv115__forced_unwindE
      [2]   .rel.data.DW.ref._ZTIN10__cxxabiv115__forced_unwindE%DW.ref._ZTIN10__cxxabiv115__forced_unwindE
[...]

Even without comdat support, C++ testresults on Solaris 10 are as good
as on Solaris 11.

	Rainer
Comment 7 Rainer Orth 2018-04-20 08:31:48 UTC
In the meantime, I've enabled HIDDEN_LINKONCE on Solaris 11/x86.  However, this
(and COMDAT support) isn't possible on Solaris 10/x86 or is out of scope for
GCC 8.

So the ton of failures remains on Solaris 10/x86.
Comment 8 Jakub Jelinek 2018-05-02 10:04:35 UTC
GCC 8.1 has been released.
Comment 9 Jakub Jelinek 2018-07-26 10:59:59 UTC
GCC 8.2 has been released.
Comment 10 Jakub Jelinek 2019-02-22 15:19:58 UTC
GCC 8.3 has been released.
Comment 11 Jakub Jelinek 2020-03-04 09:40:43 UTC
GCC 8.4.0 has been released, adjusting target milestone.