From patchwork Wed Jan 15 17:05:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 311204 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5E0B32C0091 for ; Thu, 16 Jan 2014 04:05:37 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=U1afRp0gXZLeEdOpZc yXTcessZv2wKanbSSBaXwruxQWwE6Mq3VcpmXylVP4luw1ajFGEmpqXCUCBD6AcG 0qVu5hMGVajFLSq/w/huF0W/6xEUviiZ3NW9eU+HAPSxnfa8YV4uT7vmTos5u5Fy nmA6n47lYV/RgUSz1Y+YLmM9I= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=xBj2cDoIPtjdd+NbEEQF+bbL kio=; b=a6B/tnEn7c1jfePIHQwYBmYEWM/rVUf1oqvGDNae/YG36Fl/tJLC59q5 f2XmQuV/NPUXPeoaSgL972xWLZ2+x3MGDu/0ZdSJPUhUR2eUuaRhzfWiDXfmsLCM vTQk4Fb4caSAY779rYP3lvig6TkBOzX7+RmeVT/HL1EANSCxTG8= Received: (qmail 9487 invoked by alias); 15 Jan 2014 17:05:30 -0000 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 Received: (qmail 9478 invoked by uid 89); 15 Jan 2014 17:05:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f182.google.com Received: from mail-ob0-f182.google.com (HELO mail-ob0-f182.google.com) (209.85.214.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 15 Jan 2014 17:05:28 +0000 Received: by mail-ob0-f182.google.com with SMTP id wn1so1448259obc.41 for ; Wed, 15 Jan 2014 09:05:27 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.182.153.226 with SMTP id vj2mr2754462obb.26.1389805526900; Wed, 15 Jan 2014 09:05:26 -0800 (PST) Received: by 10.76.105.174 with HTTP; Wed, 15 Jan 2014 09:05:26 -0800 (PST) In-Reply-To: <20140115070947.GV892@tucnak.redhat.com> References: <20140114141822.GA30946@intel.com> <20140115070947.GV892@tucnak.redhat.com> Date: Wed, 15 Jan 2014 09:05:26 -0800 Message-ID: Subject: Re: PATCH: PR target/59794: [4.7/4.8/4.9 Regression] i386 backend fails to detect MMX/SSE/AVX ABI changes From: "H.J. Lu" To: Jakub Jelinek Cc: GCC Patches , Uros Bizjak X-IsSubscribed: yes On Tue, Jan 14, 2014 at 11:09 PM, Jakub Jelinek wrote: > On Tue, Jan 14, 2014 at 06:18:22AM -0800, H.J. Lu wrote: >> 2014-01-14 H.J. Lu >> >> PR target/59794 >> * config/i386/i386.c (type_natural_mode): Add a bool parameter >> to indicate if type is used for function return value. Warn >> ABI change if the vector mode isn't available for function >> return value. >> (ix86_function_arg_advance): Pass false to type_natural_mode. >> (ix86_function_arg): Likewise. >> (ix86_gimplify_va_arg): Likewise. >> (function_arg_32): Don't warn ABI change. >> (ix86_function_value): Pass true to type_natural_mode. >> (ix86_return_in_memory): Likewise. >> (ix86_struct_value_rtx): Removed. >> (TARGET_STRUCT_VALUE_RTX): Likewise. > > This has added many FAILs on i686-linux (make sure to configure for a CPU > that doesn't automatically turn on -msse or -mmmx, say i686): > > +FAIL: gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c (test for excess errors) > +FAIL: gcc.dg/pr53060.c (test for excess errors) > +FAIL: c-c++-common/convert-vec-1.c -Wc++-compat (test for excess errors) > +FAIL: c-c++-common/scal-to-vec2.c -Wc++-compat (test for excess errors) > +FAIL: c-c++-common/vector-compare-2.c -Wc++-compat (test for excess errors) > +FAIL: g++.dg/conversion/simd1.C -std=c++98 (test for excess errors) > +FAIL: g++.dg/conversion/simd1.C -std=c++11 (test for excess errors) > +FAIL: g++.dg/cpp0x/constexpr-53094-2.C (test for excess errors) > +FAIL: g++.dg/ext/attribute-test-1.C -std=gnu++98 (test for excess errors) > +FAIL: g++.dg/ext/attribute-test-1.C -std=gnu++11 (test for excess errors) > +FAIL: g++.dg/ext/attribute-test-2.C -std=gnu++98 (test for excess errors) > +FAIL: g++.dg/ext/attribute-test-2.C -std=gnu++11 (test for excess errors) > +FAIL: g++.dg/ext/attribute-test-3.C -std=c++98 (test for excess errors) > +FAIL: g++.dg/ext/attribute-test-3.C -std=c++11 (test for excess errors) > +FAIL: g++.dg/ext/attribute-test-4.C -std=c++98 (test for excess errors) > +FAIL: g++.dg/ext/attribute-test-4.C -std=c++11 (test for excess errors) > +FAIL: g++.dg/ext/pr56790-1.C -std=gnu++98 (test for excess errors) > +FAIL: g++.dg/ext/pr56790-1.C -std=gnu++11 (test for excess errors) > +FAIL: c-c++-common/convert-vec-1.c -std=c++98 (test for excess errors) > +FAIL: c-c++-common/convert-vec-1.c -std=c++11 (test for excess errors) > +FAIL: c-c++-common/scal-to-vec2.c -std=gnu++98 (test for excess errors) > +FAIL: c-c++-common/scal-to-vec2.c -std=gnu++11 (test for excess errors) > +FAIL: c-c++-common/vector-compare-2.c -std=gnu++98 (test for excess errors) > +FAIL: c-c++-common/vector-compare-2.c -std=gnu++11 (test for excess errors) > +FAIL: g++.dg/torture/pr38565.C -O0 (test for excess errors) > +FAIL: g++.dg/torture/pr38565.C -O1 (test for excess errors) > +FAIL: g++.dg/torture/pr38565.C -O2 (test for excess errors) > +FAIL: g++.dg/torture/pr38565.C -O3 -fomit-frame-pointer (test for excess errors) > +FAIL: g++.dg/torture/pr38565.C -O3 -g (test for excess errors) > +FAIL: g++.dg/torture/pr38565.C -Os (test for excess errors) > +FAIL: g++.dg/torture/pr38565.C -O2 -flto -flto-partition=none (test for excess errors) > +FAIL: g++.dg/torture/pr38565.C -O2 -flto (test for excess errors) > > Excess errors: > /usr/src/gcc/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c:9:1: warning: SSE vector return without SSE enabled changes the ABI [enabled by default] > /usr/src/gcc/gcc/testsuite/gcc.dg/pr53060.c:13:1: warning: SSE vector return without SSE enabled changes the ABI [enabled by default] > /usr/src/gcc/gcc/testsuite/c-c++-common/convert-vec-1.c:3:1: warning: MMX vector return without MMX enabled changes the ABI [enabled by default] > /usr/src/gcc/gcc/testsuite/c-c++-common/scal-to-vec2.c:19:1: warning: SSE vector return without SSE enabled changes the ABI [enabled by default] > /usr/src/gcc/gcc/testsuite/c-c++-common/vector-compare-2.c:20:1: warning: SSE vector return without SSE enabled changes the ABI [enabled by default] > /usr/src/gcc/gcc/testsuite/g++.dg/conversion/simd1.C:8:59: warning: SSE vector return without SSE enabled changes the ABI [enabled by default] > /usr/src/gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-53094-2.C:7:46: warning: SSE vector return without SSE enabled changes the ABI [enabled by default] > /usr/src/gcc/gcc/testsuite/g++.dg/ext/attribute-test-1.C:10:52: warning: SSE vector return without SSE enabled changes the ABI [enabled by default] > /usr/src/gcc/gcc/testsuite/g++.dg/ext/attribute-test-2.C:14:59: warning: SSE vector return without SSE enabled changes the ABI [enabled by default] > /usr/src/gcc/gcc/testsuite/g++.dg/ext/attribute-test-3.C:26:26: warning: SSE vector return without SSE enabled changes the ABI [enabled by default] > /usr/src/gcc/gcc/testsuite/g++.dg/ext/attribute-test-4.C:26:24: warning: SSE vector return without SSE enabled changes the ABI [enabled by default] > /usr/src/gcc/gcc/testsuite/g++.dg/ext/pr56790-1.C:6:12: warning: MMX vector return without MMX enabled changes the ABI [enabled by default] > /usr/src/gcc/gcc/testsuite/g++.dg/torture/pr38565.C:5:28: warning: SSE vector return without SSE enabled changes the ABI [enabled by default] > > Please review this if the warnings are really desirable in all those tests and if yes, > dg-prune-output them (or add -Wno-psabi or whatever else turns them off). > All those warnings are valid. We didn't see them before my change due to the regression I fixed. I am checking in this patch to silence those warnings. Thanks. diff --git a/gcc/testsuite/c-c++-common/convert-vec-1.c b/gcc/testsuite/c-c++-common/convert-vec-1.c index 4987298..862190d 100644 --- a/gcc/testsuite/c-c++-common/convert-vec-1.c +++ b/gcc/testsuite/c-c++-common/convert-vec-1.c @@ -1,3 +1,4 @@ /* { dg-do compile } */ +/* { dg-prune-output "changes the ABI" } */ typedef float v2sf __attribute__ ((vector_size (8))); v2sf sub (void) { return (v2sf) 0.0; } /* { dg-error "can't convert" } */ diff --git a/gcc/testsuite/c-c++-common/scal-to-vec2.c b/gcc/testsuite/c-c++-common/scal-to-vec2.c index 2721aa0..e2c93ee 100644 --- a/gcc/testsuite/c-c++-common/scal-to-vec2.c +++ b/gcc/testsuite/c-c++-common/scal-to-vec2.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-fno-common" { target hppa*-*-hpux* } } */ /* { dg-options "-mabi=altivec" { target { { powerpc*-*-linux* } && ilp32 } } } */ +/* { dg-options "-msse2" { target { i?86-*-* x86_64-*-* } } } */ /* Ignore warning on some powerpc-ibm-aix configurations. */ /* { dg-prune-output "non-standard ABI extension" } */ diff --git a/gcc/testsuite/c-c++-common/vector-compare-2.c b/gcc/testsuite/c-c++-common/vector-compare-2.c index d17a1b4..5ebe9e3 100644 --- a/gcc/testsuite/c-c++-common/vector-compare-2.c +++ b/gcc/testsuite/c-c++-common/vector-compare-2.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-fno-common" { target hppa*-*-hpux* } } */ /* { dg-options "-mabi=altivec" { target { { powerpc*-*-linux* } && ilp32 } } } */ +/* { dg-options "-msse2" { target { i?86-*-* x86_64-*-* } } } */ /* Ignore warning on some powerpc-ibm-aix configurations. */ /* { dg-prune-output "non-standard ABI extension" } */ diff --git a/gcc/testsuite/g++.dg/conversion/simd1.C b/gcc/testsuite/g++.dg/conversion/simd1.C index fa40b0e..522d8b5 100644 --- a/gcc/testsuite/g++.dg/conversion/simd1.C +++ b/gcc/testsuite/g++.dg/conversion/simd1.C @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-options "-msse2" { target { i?86-*-* x86_64-*-* } } } */ /* Test overload resolution of vector types. From Janis Johnson and Paolo Bonzini, based on PR/16882 */ @@ -17,7 +18,7 @@ extern const vector signed short *cvssp; void foo () { vss = vld(i, vscp); /* { dg-error "no matching function for call" } */ - // { dg-message "candidate" "candidate note" { target *-*-* } 19 } + // { dg-message "candidate" "candidate note" { target *-*-* } 20 } vss = vld(i, vssp); vss = vld(i, cvssp); } diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-53094-2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-53094-2.C index 3f66c4e..1c5129d 100644 --- a/gcc/testsuite/g++.dg/cpp0x/constexpr-53094-2.C +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-53094-2.C @@ -2,6 +2,7 @@ // { dg-options "-std=gnu++11" } // Ignore warning on some powerpc-ibm-aix configurations. // { dg-prune-output "non-standard ABI extension" } +// { dg-prune-output "changes the ABI" } typedef float __attribute__ ((vector_size (4 * sizeof (float)))) V4; constexpr V4 build (float x, float y, float z) { return (V4){ x, y, z, 0 };} diff --git a/gcc/testsuite/g++.dg/ext/attribute-test-1.C b/gcc/testsuite/g++.dg/ext/attribute-test-1.C index 7df6893..93e08d7 100644 --- a/gcc/testsuite/g++.dg/ext/attribute-test-1.C +++ b/gcc/testsuite/g++.dg/ext/attribute-test-1.C @@ -36,3 +36,4 @@ int main() /* Ignore a warning that is irrelevant to the purpose of this test. */ /* { dg-prune-output ".*GCC vector returned by reference.*" } */ +/* { dg-prune-output "changes the ABI" } */ diff --git a/gcc/testsuite/g++.dg/ext/attribute-test-2.C b/gcc/testsuite/g++.dg/ext/attribute-test-2.C index 1870673..d7c417d 100644 --- a/gcc/testsuite/g++.dg/ext/attribute-test-2.C +++ b/gcc/testsuite/g++.dg/ext/attribute-test-2.C @@ -50,3 +50,4 @@ int main() /* Ignore a warning that is irrelevant to the purpose of this test. */ /* { dg-prune-output ".*GCC vector returned by reference.*" } */ +/* { dg-prune-output "changes the ABI" } */ diff --git a/gcc/testsuite/g++.dg/ext/attribute-test-3.C b/gcc/testsuite/g++.dg/ext/attribute-test-3.C index 050cbb4..4b0939e 100644 --- a/gcc/testsuite/g++.dg/ext/attribute-test-3.C +++ b/gcc/testsuite/g++.dg/ext/attribute-test-3.C @@ -52,3 +52,4 @@ int main() { /* Ignore a warning that is irrelevant to the purpose of this test. */ /* { dg-prune-output ".*GCC vector returned by reference.*" } */ +/* { dg-prune-output "changes the ABI" } */ diff --git a/gcc/testsuite/g++.dg/ext/attribute-test-4.C b/gcc/testsuite/g++.dg/ext/attribute-test-4.C index 4783ee8..c3e949a 100644 --- a/gcc/testsuite/g++.dg/ext/attribute-test-4.C +++ b/gcc/testsuite/g++.dg/ext/attribute-test-4.C @@ -49,3 +49,4 @@ int main() { /* Ignore a warning that is irrelevant to the purpose of this test. */ /* { dg-prune-output ".*GCC vector returned by reference.*" } */ +/* { dg-prune-output "changes the ABI" } */ diff --git a/gcc/testsuite/g++.dg/ext/pr56790-1.C b/gcc/testsuite/g++.dg/ext/pr56790-1.C index 84feca1..ae465fa 100644 --- a/gcc/testsuite/g++.dg/ext/pr56790-1.C +++ b/gcc/testsuite/g++.dg/ext/pr56790-1.C @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-ccp1" } */ +/* { dg-prune-output "changes the ABI" } */ typedef long vec __attribute__ ((vector_size (2 * sizeof (long)))); diff --git a/gcc/testsuite/g++.dg/torture/pr38565.C b/gcc/testsuite/g++.dg/torture/pr38565.C index 8cd1e1d..7216b1c 100644 --- a/gcc/testsuite/g++.dg/torture/pr38565.C +++ b/gcc/testsuite/g++.dg/torture/pr38565.C @@ -1,6 +1,7 @@ // { dg-do compile } // Ignore warning on some powerpc-linux configurations. // { dg-prune-output "non-standard ABI extension" } +// { dg-prune-output "changes the ABI" } #define vector __attribute__((vector_size(16) )) vector unsigned int f(int a) { diff --git a/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c b/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c index 42b3935..b1bee33 100644 --- a/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c +++ b/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-O2 -Wall" } */ /* { dg-options "-O2 -Wall -mabi=altivec" { target { { powerpc*-*-linux* } && ilp32 } } } */ +/* { dg-options "-O2 -Wall -msse2" { target { i?86-*-* x86_64-*-* } } } */ typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__)); diff --git a/gcc/testsuite/gcc.dg/pr53060.c b/gcc/testsuite/gcc.dg/pr53060.c index db5acbd..503f054 100644 --- a/gcc/testsuite/gcc.dg/pr53060.c +++ b/gcc/testsuite/gcc.dg/pr53060.c @@ -25,3 +25,4 @@ int main() /* Ignore a warning that is irrelevant to the purpose of this test. */ /* { dg-prune-output ".*GCC vector returned by reference.*" } */ +/* { dg-prune-output "changes the ABI" } */