From patchwork Mon Nov 1 01:18:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 69743 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id DD263B70E9 for ; Mon, 1 Nov 2010 12:19:01 +1100 (EST) Received: (qmail 1918 invoked by alias); 1 Nov 2010 01:18:57 -0000 Received: (qmail 1910 invoked by uid 22791); 1 Nov 2010 01:18:55 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, TW_AV, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 01 Nov 2010 01:18:51 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oA11Iocd021683 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 31 Oct 2010 21:18:50 -0400 Received: from stone.twiddle.home (ovpn-113-63.phx2.redhat.com [10.3.113.63]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oA11Ioeh009128 for ; Sun, 31 Oct 2010 21:18:50 -0400 Message-ID: <4CCE1580.2020100@redhat.com> Date: Sun, 31 Oct 2010 18:18:56 -0700 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc13 Thunderbird/3.1.4 MIME-Version: 1.0 To: GCC Patches Subject: Disable -mpreferred-stack-boundary tests for SEH X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org The previously posted patch disabled the switches in the compiler, but I missed including the testsuite changes at the same time. r~ * lib/target-supports.exp (check_effective_target_automatic_stack_alignment): True for x86 but not windows. * g++.dg/torture/stackalign/stackalign.exp: Use it to protect use of the preferred-stack-boundary arguments. * gcc.dg/torture/stackalign/stackalign.exp: Likewise. diff --git a/gcc/testsuite/g++.dg/torture/stackalign/stackalign.exp b/gcc/testsuite/g++.dg/torture/stackalign/stackalign.exp index bfa413e..e68337d 100644 --- a/gcc/testsuite/g++.dg/torture/stackalign/stackalign.exp +++ b/gcc/testsuite/g++.dg/torture/stackalign/stackalign.exp @@ -18,19 +18,15 @@ # This harness is for tests that should be run at all optimisation levels. load_lib g++-dg.exp - -# Only run on targets which support automatic stack alignment. -if { ![check_effective_target_automatic_stack_alignment] } then { - return -} - +dg-init set additional_flags "" -if { [istarget i?86*-*-*] || [istarget x86_64-*-*] } then { + +# If automatic stack alignment is supported, force it on. +if { [check_effective_target_automatic_stack_alignment] } then { lappend additional_flags "-mstackrealign" lappend additional_flags "-mpreferred-stack-boundary=5" } -dg-init gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.C]] $additional_flags if { [check_effective_target_fpic] } then { lappend additional_flags "-fpic" diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp b/gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp index ef45dbe..83c6239 100644 --- a/gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp +++ b/gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp @@ -19,15 +19,12 @@ load_lib gcc-dg.exp -# Only run on targets which support automatic stack alignment. -if { ![check_effective_target_automatic_stack_alignment] } then { - return -} - set additional_flags "" -if { [istarget i?86*-*-*] || [istarget x86_64-*-*] } then { +if { [check_effective_target_automatic_stack_alignment] } then { lappend additional_flags "-mstackrealign" lappend additional_flags "-mpreferred-stack-boundary=5" +} +if { [istarget i?86*-*-*] || [istarget x86_64-*-*] } then { lappend additional_flags "-mno-mmx" } @@ -40,7 +37,7 @@ if { [check_effective_target_fpic] } then { gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] $pic_additional_flags } -if { [istarget i?86*-*-*] || [istarget x86_64-*-*] } then { +if { [check_effective_target_automatic_stack_alignment] } then { lappend additional_flags "-mforce-drap" gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] $additional_flags if { [check_effective_target_fpic] } then { diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 0ae003a..87b234d 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -3551,8 +3551,15 @@ proc check_effective_target_4byte_wchar_t { } { # Return 1 if the target supports automatic stack alignment. proc check_effective_target_automatic_stack_alignment { } { - # Not "stack alignment" per se, but proper stack alignment of decls. - return 1; + # Ordinarily x86 supports automatic stack alignment ... + if { [istarget i?86*-*-*] || [istarget x86_64-*-*] } then { + if { [istarget *-*-mingw*] || [istarget *-*-cygwin*] } { + # ... except Win64 SEH doesn't. Succeed for Win32 though. + return [check_effective_target_ilp32]; + } + return 1; + } + return 0; } # Return 1 if avx instructions can be compiled.