diff mbox

[testsuite] Fix gcc.dg/ipa/ipa-icf-2[18].c on Solaris

Message ID yddtx2wqhl4.fsf@lokon.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Oct. 22, 2014, 2:55 p.m. UTC
Two of the new gcc.dg/ipa/ipa-icf-*.c tests were FAILing on Solaris:

FAIL: gcc.dg/ipa/ipa-icf-21.c (test for excess errors)
UNRESOLVED: gcc.dg/ipa/ipa-icf-21.c scan-ipa-dump icf "Equal symbols: 1"
UNRESOLVED: gcc.dg/ipa/ipa-icf-21.c scan-ipa-dump icf "Semantic equality hit:bar->foo"
FAIL: gcc.dg/ipa/ipa-icf-28.c (test for excess errors)
UNRESOLVED: gcc.dg/ipa/ipa-icf-28.c scan-ipa-dump icf "Equal symbols: 0"
UNRESOLVED: gcc.dg/ipa/ipa-icf-28.c scan-ipa-dump icf "attribute values are different"

The former requires <xmmintrin.h> which is x86-only, thus cannot work
anywhere else.  The other uses constructor priorities, but doesn't
declare this dependency.

The following patch fixes both, so far tested with the appropriate
runtest invocation on sparc-sun-solaris2.11; will commit to mainline
once they've also been included in a current x86_64-unknown-linux-gnu
bootstrap.

	Rainer


2014-10-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* gcc.dg/ipa/ipa-icf-21.c: Restrict to i?86-*-* x86_64-*-*.
	* gcc.dg/ipa/ipa-icf-28.c: Require init_priority.

Comments

Rainer Orth Oct. 23, 2014, 9:16 a.m. UTC | #1
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> Two of the new gcc.dg/ipa/ipa-icf-*.c tests were FAILing on Solaris:
>
> FAIL: gcc.dg/ipa/ipa-icf-21.c (test for excess errors)
> UNRESOLVED: gcc.dg/ipa/ipa-icf-21.c scan-ipa-dump icf "Equal symbols: 1"
> UNRESOLVED: gcc.dg/ipa/ipa-icf-21.c scan-ipa-dump icf "Semantic equality
> hit:bar->foo"
> FAIL: gcc.dg/ipa/ipa-icf-28.c (test for excess errors)
> UNRESOLVED: gcc.dg/ipa/ipa-icf-28.c scan-ipa-dump icf "Equal symbols: 0"
> UNRESOLVED: gcc.dg/ipa/ipa-icf-28.c scan-ipa-dump icf "attribute values are
> different"
>
> The former requires <xmmintrin.h> which is x86-only, thus cannot work
> anywhere else.  The other uses constructor priorities, but doesn't
> declare this dependency.
>
> The following patch fixes both, so far tested with the appropriate
> runtest invocation on sparc-sun-solaris2.11; will commit to mainline
> once they've also been included in a current x86_64-unknown-linux-gnu
> bootstrap.

I've now installed the patch to remove the obvious testsuite failures,
but it turned out that the ipa-icf-21.c testcase has further issues on
i686-unknown-linux-gnu:

FAIL: gcc.dg/ipa/ipa-icf-21.c (test for excess errors)
Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/ipa/ipa-icf-21.c:10:10: warning: SSE vector return without SSE enabled changes the ABI [-Wpsabi]
/var/gcc/regression/trunk/3.14.17-gcc-gas-gld-32/build/gcc/include/xmmintrin.h:909:1: error: inlining failed in call to always_inline '_mm_load1_ps': target specific option mismatch
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/ipa/ipa-icf-21.c:10:10: error: called from here

The former can be cured by adding -Wno-psabi to dg-options, but I've no
idea what to do about the latter, especially since it doesn't occur on
i386-pc-solaris2.11.

	Rainer
Jakub Jelinek Oct. 23, 2014, 9:33 a.m. UTC | #2
On Thu, Oct 23, 2014 at 11:16:39AM +0200, Rainer Orth wrote:
> Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
> 
> > Two of the new gcc.dg/ipa/ipa-icf-*.c tests were FAILing on Solaris:
> >
> > FAIL: gcc.dg/ipa/ipa-icf-21.c (test for excess errors)
> > UNRESOLVED: gcc.dg/ipa/ipa-icf-21.c scan-ipa-dump icf "Equal symbols: 1"
> > UNRESOLVED: gcc.dg/ipa/ipa-icf-21.c scan-ipa-dump icf "Semantic equality
> > hit:bar->foo"
> > FAIL: gcc.dg/ipa/ipa-icf-28.c (test for excess errors)
> > UNRESOLVED: gcc.dg/ipa/ipa-icf-28.c scan-ipa-dump icf "Equal symbols: 0"
> > UNRESOLVED: gcc.dg/ipa/ipa-icf-28.c scan-ipa-dump icf "attribute values are
> > different"
> >
> > The former requires <xmmintrin.h> which is x86-only, thus cannot work
> > anywhere else.  The other uses constructor priorities, but doesn't
> > declare this dependency.
> >
> > The following patch fixes both, so far tested with the appropriate
> > runtest invocation on sparc-sun-solaris2.11; will commit to mainline
> > once they've also been included in a current x86_64-unknown-linux-gnu
> > bootstrap.
> 
> I've now installed the patch to remove the obvious testsuite failures,
> but it turned out that the ipa-icf-21.c testcase has further issues on
> i686-unknown-linux-gnu:
> 
> FAIL: gcc.dg/ipa/ipa-icf-21.c (test for excess errors)
> Excess errors:
> /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/ipa/ipa-icf-21.c:10:10: warning: SSE vector return without SSE enabled changes the ABI [-Wpsabi]
> /var/gcc/regression/trunk/3.14.17-gcc-gas-gld-32/build/gcc/include/xmmintrin.h:909:1: error: inlining failed in call to always_inline '_mm_load1_ps': target specific option mismatch
> /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/ipa/ipa-icf-21.c:10:10: error: called from here
> 
> The former can be cured by adding -Wno-psabi to dg-options, but I've no
> idea what to do about the latter, especially since it doesn't occur on
> i386-pc-solaris2.11.

The testcase is clearly i?86/x86_64 specific, so it must be guarded with
{ target i?86-*-* x86_64-*-* }, and as it is a compile time test, no need
for assembler support, so just adding -msse2 option to dg-option is the
right thing to do.

	Jakub
Rainer Orth Oct. 23, 2014, 9:35 a.m. UTC | #3
Jakub Jelinek <jakub@redhat.com> writes:

> On Thu, Oct 23, 2014 at 11:16:39AM +0200, Rainer Orth wrote:
>> Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
>> 
>> > Two of the new gcc.dg/ipa/ipa-icf-*.c tests were FAILing on Solaris:
>> >
>> > FAIL: gcc.dg/ipa/ipa-icf-21.c (test for excess errors)
>> > UNRESOLVED: gcc.dg/ipa/ipa-icf-21.c scan-ipa-dump icf "Equal symbols: 1"
>> > UNRESOLVED: gcc.dg/ipa/ipa-icf-21.c scan-ipa-dump icf "Semantic equality
>> > hit:bar->foo"
>> > FAIL: gcc.dg/ipa/ipa-icf-28.c (test for excess errors)
>> > UNRESOLVED: gcc.dg/ipa/ipa-icf-28.c scan-ipa-dump icf "Equal symbols: 0"
>> > UNRESOLVED: gcc.dg/ipa/ipa-icf-28.c scan-ipa-dump icf "attribute values are
>> > different"
>> >
>> > The former requires <xmmintrin.h> which is x86-only, thus cannot work
>> > anywhere else.  The other uses constructor priorities, but doesn't
>> > declare this dependency.
>> >
>> > The following patch fixes both, so far tested with the appropriate
>> > runtest invocation on sparc-sun-solaris2.11; will commit to mainline
>> > once they've also been included in a current x86_64-unknown-linux-gnu
>> > bootstrap.
>> 
>> I've now installed the patch to remove the obvious testsuite failures,
>> but it turned out that the ipa-icf-21.c testcase has further issues on
>> i686-unknown-linux-gnu:
>> 
>> FAIL: gcc.dg/ipa/ipa-icf-21.c (test for excess errors)
>> Excess errors:
>> /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/ipa/ipa-icf-21.c:10:10:
>> warning: SSE vector return without SSE enabled changes the ABI [-Wpsabi]
>> /var/gcc/regression/trunk/3.14.17-gcc-gas-gld-32/build/gcc/include/xmmintrin.h:909:1:
>> error: inlining failed in call to always_inline '_mm_load1_ps': target
>> specific option mismatch
>> /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/ipa/ipa-icf-21.c:10:10:
>> error: called from here
>> 
>> The former can be cured by adding -Wno-psabi to dg-options, but I've no
>> idea what to do about the latter, especially since it doesn't occur on
>> i386-pc-solaris2.11.
>
> The testcase is clearly i?86/x86_64 specific, so it must be guarded with
> { target i?86-*-* x86_64-*-* }, and as it is a compile time test, no need

Right, that's what my patch already does.

> for assembler support, so just adding -msse2 option to dg-option is the
> right thing to do.

Ok, will try that.  Still no idea why Linux/x86 and Solaris/x86 are
different here.

	Rainer
Jakub Jelinek Oct. 23, 2014, 9:38 a.m. UTC | #4
On Thu, Oct 23, 2014 at 11:35:44AM +0200, Rainer Orth wrote:
> > The testcase is clearly i?86/x86_64 specific, so it must be guarded with
> > { target i?86-*-* x86_64-*-* }, and as it is a compile time test, no need
> 
> Right, that's what my patch already does.
> 
> > for assembler support, so just adding -msse2 option to dg-option is the
> > right thing to do.
> 
> Ok, will try that.  Still no idea why Linux/x86 and Solaris/x86 are
> different here.

Why do you think so?  I certainly have:
FAIL: gcc.dg/ipa/ipa-icf-21.c (test for excess errors)
UNRESOLVED: gcc.dg/ipa/ipa-icf-21.c scan-ipa-dump icf "Equal symbols: 1"
UNRESOLVED: gcc.dg/ipa/ipa-icf-21.c scan-ipa-dump icf "Semantic equality hit:bar->foo"
in my i686-linux test_summary log.  It really depends on how the compiler
is configured, if it defaults to march that has sse/sse2 by default, it will
succeed, otherwise it will not.

	Jakub
Rainer Orth Oct. 23, 2014, 11:36 a.m. UTC | #5
Jakub Jelinek <jakub@redhat.com> writes:

> On Thu, Oct 23, 2014 at 11:35:44AM +0200, Rainer Orth wrote:
>> > The testcase is clearly i?86/x86_64 specific, so it must be guarded with
>> > { target i?86-*-* x86_64-*-* }, and as it is a compile time test, no need
>> 
>> Right, that's what my patch already does.
>> 
>> > for assembler support, so just adding -msse2 option to dg-option is the
>> > right thing to do.
>> 
>> Ok, will try that.  Still no idea why Linux/x86 and Solaris/x86 are
>> different here.
>
> Why do you think so?  I certainly have:
> FAIL: gcc.dg/ipa/ipa-icf-21.c (test for excess errors)
> UNRESOLVED: gcc.dg/ipa/ipa-icf-21.c scan-ipa-dump icf "Equal symbols: 1"
> UNRESOLVED: gcc.dg/ipa/ipa-icf-21.c scan-ipa-dump icf "Semantic equality
> hit:bar->foo"
> in my i686-linux test_summary log.  It really depends on how the compiler

Right, but on i386-pc-solaris2.11 it passes.

> is configured, if it defaults to march that has sse/sse2 by default, it will
> succeed, otherwise it will not.

I had a terrible time figuring out what march value
i686-unknown-linux-gnu uses; only in gcc -v it's possible to see that it
uses pentiumpro, unlike pentium4 on Solaris/x86, which explains the
difference.

Thanks.
	Rainer
Jan Hubicka Oct. 23, 2014, 3:35 p.m. UTC | #6
> Jakub Jelinek <jakub@redhat.com> writes:
> 
> > On Thu, Oct 23, 2014 at 11:35:44AM +0200, Rainer Orth wrote:
> >> > The testcase is clearly i?86/x86_64 specific, so it must be guarded with
> >> > { target i?86-*-* x86_64-*-* }, and as it is a compile time test, no need
> >> 
> >> Right, that's what my patch already does.
> >> 
> >> > for assembler support, so just adding -msse2 option to dg-option is the
> >> > right thing to do.
> >> 
> >> Ok, will try that.  Still no idea why Linux/x86 and Solaris/x86 are
> >> different here.
> >
> > Why do you think so?  I certainly have:
> > FAIL: gcc.dg/ipa/ipa-icf-21.c (test for excess errors)
> > UNRESOLVED: gcc.dg/ipa/ipa-icf-21.c scan-ipa-dump icf "Equal symbols: 1"
> > UNRESOLVED: gcc.dg/ipa/ipa-icf-21.c scan-ipa-dump icf "Semantic equality
> > hit:bar->foo"
> > in my i686-linux test_summary log.  It really depends on how the compiler
> 
> Right, but on i386-pc-solaris2.11 it passes.
> 
> > is configured, if it defaults to march that has sse/sse2 by default, it will
> > succeed, otherwise it will not.
> 
> I had a terrible time figuring out what march value
> i686-unknown-linux-gnu uses; only in gcc -v it's possible to see that it
> uses pentiumpro, unlike pentium4 on Solaris/x86, which explains the
> difference.

What is the reason to use pentium4 for Solaris/x86? Is it -march setting or
-mtune? For -mtune it is a terrible choice....

Honza
> 
> Thanks.
> 	Rainer
> 
> -- 
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University
Rainer Orth Oct. 24, 2014, 9:19 a.m. UTC | #7
Jan Hubicka <hubicka@ucw.cz> writes:

>> I had a terrible time figuring out what march value
>> i686-unknown-linux-gnu uses; only in gcc -v it's possible to see that it
>> uses pentiumpro, unlike pentium4 on Solaris/x86, which explains the
>> difference.
>
> What is the reason to use pentium4 for Solaris/x86? Is it -march setting or
> -mtune? For -mtune it is a terrible choice....

This was changed in

	http://gcc.gnu.org/ml/gcc-patches/2010-03/msg01483.html
	http://gcc.gnu.org/ml/gcc-patches/2010-04/msg00254.html

It's with_arch_32=pentium4 and with_tune_32=generic now.

The latest Oracle Studio compilers default to -xarch=sse2, which is

          sse2      May use 386, MMX, Pentium_pro, SSE and SSE2
                    instructions.

The pentium4 over pentiumpro choice may well be the result of a
misunderstanding: as I said, the code in config.gcc setting with_arch*
is almost impossible to follow.

	Rainer
diff mbox

Patch

# HG changeset patch
# Parent 330f2b4b7c84284ef9d5575967a1aa8d00c9ec77
Fix gcc.dg/ipa/ipa-icf-2[18].c on Solaris

diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-icf-21.c b/gcc/testsuite/gcc.dg/ipa/ipa-icf-21.c
--- a/gcc/testsuite/gcc.dg/ipa/ipa-icf-21.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-icf-21.c
@@ -1,4 +1,4 @@ 
-/* { dg-do compile } */
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
 /* { dg-options "-O2 -fdump-ipa-icf"  } */
 
 #include <xmmintrin.h>
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-icf-28.c b/gcc/testsuite/gcc.dg/ipa/ipa-icf-28.c
--- a/gcc/testsuite/gcc.dg/ipa/ipa-icf-28.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-icf-28.c
@@ -1,4 +1,4 @@ 
-/* { dg-do compile } */
+/* { dg-do compile { target init_priority } } */
 /* { dg-options "-O2 -fdump-ipa-icf-details -fno-inline"  } */
 
 __attribute__ ((noinline, constructor(200)))