Summary: | gcc doesn't conform to Solaris 32-bit ABI by expecting 16-byte stack alignment | ||
---|---|---|---|
Product: | gcc | Reporter: | Justin Carveley <justin.carveley> |
Component: | target | Assignee: | Rainer Orth <ro> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ro |
Priority: | P3 | Keywords: | ABI, ssemmx |
Version: | 4.9.1 | ||
Target Milestone: | 4.9.4 | ||
URL: | https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00461.html | ||
Host: | i386-pc-solaris2.10 | Target: | i386-pc-solaris2.10 |
Build: | Known to work: | ||
Known to fail: | 4.8.0, 4.9.0 | Last reconfirmed: | 2016-03-07 00:00:00 |
Attachments: |
Example 2: SSE vector load causes SEGV on callback from Xt timer
Example 2: Preprocessed source Example 1: gcc compiled module performing sse vector load Example 1: Solaris studio compiled module: main() Example 1: preprocessed source Example 1: build script |
Description
Justin Carveley
2014-08-27 10:55:46 UTC
Created attachment 33401 [details]
Example 2: Preprocessed source
Created attachment 33402 [details]
Example 1: gcc compiled module performing sse vector load
Created attachment 33403 [details]
Example 1: Solaris studio compiled module: main()
Created attachment 33404 [details]
Example 1: preprocessed source
Created attachment 33405 [details]
Example 1: build script
I've been seeing the same issue in PR middle-end/61949, but only on Solaris 10, not S11, and the failures have been intermittent (i.e. happened during one bootstrap, but were gone a week later). Regarding > I believe the problem was fixed for the limited case of Solaris 9 x86 in bug > 60107. However, the analysis for this fix seems slightly off. It infers that, > because Solaris 10 creates outgoing thread stacks aligned on 16 bytes, the > 32-bit ABI has changed to 16-byte stack alignment on this platform, which isn't > correct. I believe the i386 psABI is irrelevant here: while it requires word alignment, it doesn't preclude that Solaris guarantees a stricter alignment, which from what I've seen both S10 and S11 do. > I suggest -mincoming-stack-boundary=2 should be the default for all 32-bit > Solaris binaries. Before making any changes in this area, I'd like word from the responsible libc engineer (Roger Faulkner probably) what various Solaris versions do and don't guarantee. Rainer FWIW, I recommended to Sun in Mar 2006 that the kernel should ensure 16-byte alignment for both signal handlers and process startup (apparently this resulted in Sun bug 6397812, "Problem with stack alignment for signal delivery on AMD64"). (This does not of course mean that the ABI ended up with such an alignment requirement at interface boundaries in general.) GCC 5.1 has been released. GCC 5.2 is being released, adjusting target milestone to 5.3. GCC 5.3 is being released, adjusting target milestone. *** Bug 61949 has been marked as a duplicate of this bug. *** Mine, received confirmation that only 4-byte stack alignment is guaranteed on 32-bit Solaris/x86 from the Solaris and Studio groups in Oracle. Rainer Author: ro Date: Mon Mar 7 09:51:31 2016 New Revision: 234022 URL: https://gcc.gnu.org/viewcvs?rev=234022&root=gcc&view=rev Log: Only assume 4-byte stack alignment on 32-bit Solaris/x86 (PR target/62281) PR target/62281 * config/i386/sol2.h (STACK_REALIGN_DEFAULT): Define. Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/sol2.h Fixed for 6.1. Author: ro Date: Mon Mar 14 09:56:47 2016 New Revision: 234179 URL: https://gcc.gnu.org/viewcvs?rev=234179&root=gcc&view=rev Log: Only assume 4-byte stack alignment on Solaris/x86 (PR target/62281) Backport from mainline 2016-03-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> PR target/62281 * config/i386/sol2.h (STACK_REALIGN_DEFAULT): Define. Modified: branches/gcc-5-branch/gcc/ChangeLog branches/gcc-5-branch/gcc/config/i386/sol2.h Author: ro Date: Mon Mar 14 10:03:12 2016 New Revision: 234180 URL: https://gcc.gnu.org/viewcvs?rev=234180&root=gcc&view=rev Log: Only assume 4-byte stack alignment on Solaris/x86 (PR target/62281) Backport from mainline: 2016-03-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> PR target/62281 * config/i386/sol2.h (STACK_REALIGN_DEFAULT): Define. Revert: 2014-02-11 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> PR libgomp/60107 * config/i386/sol2-9.h: New file. * config.gcc (i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*, *-*-solaris2.9*): Use it. Removed: branches/gcc-4_9-branch/gcc/config/i386/sol2-9.h Modified: branches/gcc-4_9-branch/gcc/ChangeLog branches/gcc-4_9-branch/gcc/config.gcc branches/gcc-4_9-branch/gcc/config/i386/sol2.h Fixed for GCC 4.9.4, 5.4, 6.1. Author: meissner Date: Mon Mar 14 18:18:45 2016 New Revision: 234188 URL: https://gcc.gnu.org/viewcvs?rev=234188&root=gcc&view=rev Log: [gcc] 2016-03-14 Michael Meissner <meissner@linux.vnet.ibm.com> Backport from mainline 2016-03-11 Michael Meissner <meissner@linux.vnet.ibm.com> PR target/70131 * config/rs6000/rs6000.md (round32<mode>2_fprs): Do not do the optimization if we have direct move. (roundu32<mode>2_fprs): Likewise. 2016-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> Backport from mainline 2016-03-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> PR target/62281 * config/i386/sol2.h (STACK_REALIGN_DEFAULT): Define. 2016-03-10 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> PR target/70168 * config/rs6000/rs6000.c (rs6000_expand_atomic_compare_and_swap): Handle overlapping retval and newval. [gcc/testsuite] 2016-03-14 Michael Meissner <meissner@linux.vnet.ibm.com> Backport from mainline 2016-03-11 Michael Meissner <meissner@linux.vnet.ibm.com> PR target/70131 * gcc.target/powerpc/ppc-round2.c: New test. 2016-03-14 Dominique d'Humieres <dominiq@lps.ens.fr> PR fortran/45076 gfortran.dg/prof/prof.exp: New script. gfortran.dg/prof/dynamic_dispatch_6.f03: New test. Added: branches/ibm/gcc-5-branch/gcc/testsuite/gcc.target/powerpc/ppc-round2.c - copied unchanged from r234186, branches/gcc-5-branch/gcc/testsuite/gcc.target/powerpc/ppc-round2.c branches/ibm/gcc-5-branch/gcc/testsuite/gfortran.dg/prof/ - copied from r234186, branches/gcc-5-branch/gcc/testsuite/gfortran.dg/prof/ Modified: branches/ibm/gcc-5-branch/gcc/ChangeLog branches/ibm/gcc-5-branch/gcc/DATESTAMP branches/ibm/gcc-5-branch/gcc/config/i386/sol2.h branches/ibm/gcc-5-branch/gcc/config/rs6000/rs6000.c branches/ibm/gcc-5-branch/gcc/config/rs6000/rs6000.md branches/ibm/gcc-5-branch/gcc/testsuite/ChangeLog |