Re: dg-require-ifunc syntax

2019-05-21 Thread Rainer Orth
Rainer Orth  writes:

> Hi Iain,
>
>> Hi Dominique,
>>
>>> On 19 May 2019, at 15:10, Dominique d'Humières  wrote:
>>> 
>>> AFAICT the syntax for dg-require-ifunc seems to be
>>> 
>>> /* { dg-require-ifunc "" } */
>>> 
>>> with two sets of exceptions:
>>> 
>>> (1) gcc.target/i386/pr90500-*.c
>>> 
>>> which explains
>>> 
>>> FAIL: gcc.target/i386/pr90500-1.c  (test for errors, line 6)
>>> FAIL: gcc.target/i386/pr90500-1.c  (test for warnings, line 6)
>>> FAIL: gcc.target/i386/pr90500-1.c (test for excess errors)
>>> FAIL: gcc.target/i386/pr90500-2.c  (test for errors, line 6)
>>> FAIL: gcc.target/i386/pr90500-2.c  (test for warnings, line 6)
>>> FAIL: gcc.target/i386/pr90500-2.c (test for excess errors)
>>> 
>>> and is fixed with the trivial patch
>>> 
>>> --- ../_clean/gcc/testsuite/gcc.target/i386/pr90500-1.c 2019-05-16
>>> 17:34:09.0 +0200
>>> +++ gcc/testsuite/gcc.target/i386/pr90500-1.c 2019-05-18
>>> 14:28:12.0 +0200
>>> @@ -1,6 +1,6 @@
>>> /* PR middle-end/84723 */
>>> /* { dg-do compile } */
>>> -/* { dg-require-ifunc } */
>>> +/* { dg-require-ifunc "" } */
>>> 
>>> __attribute__((target_clones("arch=haswell", "default"))) int __tanh() {}
>>> __typeof(__tanh) tanhf64 __attribute__((alias("__tanh")))/* { dg-error
>>> "clones for .target_clones. attribute cannot be created" } */
>>
>> From a Darwin point of view, this is OK (it seems obvious to me, also).
>
> indeed: I have the same issue on Solaris, too.
>
>>> --- ../_clean/gcc/testsuite/gcc.target/i386/pr90500-2.c 2019-05-16
>>> 17:34:09.0 +0200
>>> +++ gcc/testsuite/gcc.target/i386/pr90500-2.c 2019-05-18
>>> 14:28:25.0 +0200
>>> @@ -1,6 +1,6 @@
>>> /* PR middle-end/84723 */
>>> /* { dg-do compile } */
>>> -/* { dg-require-ifunc } */
>>> +/* { dg-require-ifunc "" } */
>>> 
>>> __attribute__((target_clones("arch=haswell", "default"))) int __tanh() {}
>>> __typeof(__tanh) tanhf64
>>> __attribute__((alias("__tanh"),target_clones("arch=haswell",
>>> "default"))); /* { dg-error "clones for .target_clones. attribute cannot
>>> be created" } */
>>> 
>>> (2) gcc.target/i386/pr84723-*.c
>>> 
>>> which succeed on darwin. What is the suitable fix for that?
>>
>> My assumption here is that the tests should not be run on a non-ifuncs 
>> target, 
>> but that it happens to be that they are testing for an erroneous condition 
>> - which by chance also gives the correct error on a non-ifuncs target.
>>> 
>>> (a) Fix the dg-require-ifunc as above?
>>
>> I would prefer this, (it’s confusing to run tests for an unsupported
>> functionality)
>> - unless there is some other value to running the tests (will wait for 
>> comments
>> on that).
>
> Right: I guess we can wait for Jakub's take on that.  The tests PASS on
> Solaris/x86 as well, which hasn't ifunc support either, and there are no
> gcc-testresults postings showing failures for this test anywhere.
>
> Prompted by the initial bug, I looked around a bit and found some more
> instances of the dg-require-* syntax problem.  I'll commit them either
> together with the rest of separately, since this stuff tends to be
> copied around.

Given no response from Jakub and no indication that
gcc.target/i386/pr84723-?.c fails anywhere, I've installed the following
patch on mainline.

Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, and x86_64-pc-linux-gnu.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2019-05-17  Rainer Orth  

* gcc.dg/Wattribute-alias.c: Pass emtpy arg to dg-require-ifunc.

* gcc.c-torture/execute/20030125-1.c: Pass emtpy arg to dg-require-weak.

* gcc.dg/torture/ftrapv-2.c: Pass empty arg to dg-require-fork.

* gcc.target/i386/pr84723-1.c: Remove dg-require-ifunc.
* gcc.target/i386/pr84723-2.c: Likewise.
* gcc.target/i386/pr84723-3.c: Likewise.
* gcc.target/i386/pr84723-4.c: Likewise.
* gcc.target/i386/pr84723-5.c: Likewise.

# HG changeset patch
# Parent  20c3c82fdcb626b5183ad78d127d3c0679bc257c
Fix dg-require-* syntax

diff --git a/gcc/testsuite/gcc.c-torture/execute/20030125-1.c b/gcc/testsuite/gcc.c-torture/execute/20030125-1.c
--- a/gcc/testsuite/gcc.c-torture/execute/20030125-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20030125-1.c
@@ -1,6 +1,6 @@
 /* Verify whether math functions are simplified.  */
 /* { dg-require-effective-target c99_runtime } */
-/* { dg-require-weak } */
+/* { dg-require-weak "" } */
 double sin(double);
 double floor(double);
 float 
diff --git a/gcc/testsuite/gcc.dg/Wattribute-alias.c b/gcc/testsuite/gcc.dg/Wattribute-alias.c
--- a/gcc/testsuite/gcc.dg/Wattribute-alias.c
+++ b/gcc/testsuite/gcc.dg/Wattribute-alias.c
@@ -1,6 +1,6 @@
 /* PR middle-end/81824 - Warn for missing attributes with function aliases
{ dg-do compile }
-   { dg-require-ifunc "require ifunc support" }
+   { dg-require-ifunc "" }
{ dg-options "-Wall -Wattribute-alias=2" } */
 
 

Re: dg-require-ifunc syntax

2019-05-20 Thread Rainer Orth
Hi Iain,

> Hi Dominique,
>
>> On 19 May 2019, at 15:10, Dominique d'Humières  wrote:
>> 
>> AFAICT the syntax for dg-require-ifunc seems to be
>> 
>> /* { dg-require-ifunc "" } */
>> 
>> with two sets of exceptions:
>> 
>> (1) gcc.target/i386/pr90500-*.c
>> 
>> which explains
>> 
>> FAIL: gcc.target/i386/pr90500-1.c  (test for errors, line 6)
>> FAIL: gcc.target/i386/pr90500-1.c  (test for warnings, line 6)
>> FAIL: gcc.target/i386/pr90500-1.c (test for excess errors)
>> FAIL: gcc.target/i386/pr90500-2.c  (test for errors, line 6)
>> FAIL: gcc.target/i386/pr90500-2.c  (test for warnings, line 6)
>> FAIL: gcc.target/i386/pr90500-2.c (test for excess errors)
>> 
>> and is fixed with the trivial patch
>> 
>> --- ../_clean/gcc/testsuite/gcc.target/i386/pr90500-1.c 2019-05-16
>> 17:34:09.0 +0200
>> +++ gcc/testsuite/gcc.target/i386/pr90500-1.c 2019-05-18
>> 14:28:12.0 +0200
>> @@ -1,6 +1,6 @@
>> /* PR middle-end/84723 */
>> /* { dg-do compile } */
>> -/* { dg-require-ifunc } */
>> +/* { dg-require-ifunc "" } */
>> 
>> __attribute__((target_clones("arch=haswell", "default"))) int __tanh() {}
>> __typeof(__tanh) tanhf64 __attribute__((alias("__tanh")))/* { dg-error
>> "clones for .target_clones. attribute cannot be created" } */
>
> From a Darwin point of view, this is OK (it seems obvious to me, also).

indeed: I have the same issue on Solaris, too.

>> --- ../_clean/gcc/testsuite/gcc.target/i386/pr90500-2.c 2019-05-16
>> 17:34:09.0 +0200
>> +++ gcc/testsuite/gcc.target/i386/pr90500-2.c 2019-05-18
>> 14:28:25.0 +0200
>> @@ -1,6 +1,6 @@
>> /* PR middle-end/84723 */
>> /* { dg-do compile } */
>> -/* { dg-require-ifunc } */
>> +/* { dg-require-ifunc "" } */
>> 
>> __attribute__((target_clones("arch=haswell", "default"))) int __tanh() {}
>> __typeof(__tanh) tanhf64
>> __attribute__((alias("__tanh"),target_clones("arch=haswell",
>> "default"))); /* { dg-error "clones for .target_clones. attribute cannot
>> be created" } */
>> 
>> (2) gcc.target/i386/pr84723-*.c
>> 
>> which succeed on darwin. What is the suitable fix for that?
>
> My assumption here is that the tests should not be run on a non-ifuncs 
> target, 
> but that it happens to be that they are testing for an erroneous condition 
> - which by chance also gives the correct error on a non-ifuncs target.
>> 
>> (a) Fix the dg-require-ifunc as above?
>
> I would prefer this, (it’s confusing to run tests for an unsupported
> functionality)
> - unless there is some other value to running the tests (will wait for 
> comments
> on that).

Right: I guess we can wait for Jakub's take on that.  The tests PASS on
Solaris/x86 as well, which hasn't ifunc support either, and there are no
gcc-testresults postings showing failures for this test anywhere.

Prompted by the initial bug, I looked around a bit and found some more
instances of the dg-require-* syntax problem.  I'll commit them either
together with the rest of separately, since this stuff tends to be
copied around.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


# HG changeset patch
# Parent  4fe3c3e82cdf35ee95d5171062e5392c901f89f2
Fix dg-require-* syntax

	gcc/testsuite:
	* gcc.dg/Wattribute-alias.c: Pass emtpy arg to dg-require-ifunc.
	* gcc.target/i386/pr90500-1.c: Likewise.
	* gcc.target/i386/pr90500-2.c: Likewise.

	* gcc.c-torture/execute/20030125-1.c: Pass emtpy arg to dg-require-weak.

	* gcc.dg/torture/ftrapv-2.c: Pass empty arg to dg-require-fork.

	* gcc.target/i386/pr84723-1.c: Remove dg-require-ifunc.
	* gcc.target/i386/pr84723-2.c: Likewise.
	* gcc.target/i386/pr84723-3.c: Likewise.
	* gcc.target/i386/pr84723-4.c: Likewise.
	* gcc.target/i386/pr84723-5.c: Likewise.

diff --git a/gcc/testsuite/gcc.c-torture/execute/20030125-1.c b/gcc/testsuite/gcc.c-torture/execute/20030125-1.c
--- a/gcc/testsuite/gcc.c-torture/execute/20030125-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20030125-1.c
@@ -1,6 +1,6 @@
 /* Verify whether math functions are simplified.  */
 /* { dg-require-effective-target c99_runtime } */
-/* { dg-require-weak } */
+/* { dg-require-weak "" } */
 double sin(double);
 double floor(double);
 float 
diff --git a/gcc/testsuite/gcc.dg/Wattribute-alias.c b/gcc/testsuite/gcc.dg/Wattribute-alias.c
--- a/gcc/testsuite/gcc.dg/Wattribute-alias.c
+++ b/gcc/testsuite/gcc.dg/Wattribute-alias.c
@@ -1,6 +1,6 @@
 /* PR middle-end/81824 - Warn for missing attributes with function aliases
{ dg-do compile }
-   { dg-require-ifunc "require ifunc support" }
+   { dg-require-ifunc "" }
{ dg-options "-Wall -Wattribute-alias=2" } */
 
 #define ATTR(...)   __attribute__ ((__VA_ARGS__))
diff --git a/gcc/testsuite/gcc.dg/torture/ftrapv-2.c b/gcc/testsuite/gcc.dg/torture/ftrapv-2.c
--- a/gcc/testsuite/gcc.dg/torture/ftrapv-2.c
+++ b/gcc/testsuite/gcc.dg/torture/ftrapv-2.c
@@ -3,7 +3,7 @@
 /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
 /* { 

Re: dg-require-ifunc syntax

2019-05-19 Thread Iain Sandoe
Hi Dominique,

> On 19 May 2019, at 15:10, Dominique d'Humières  wrote:
> 
> AFAICT the syntax for dg-require-ifunc seems to be
> 
> /* { dg-require-ifunc "" } */
> 
> with two sets of exceptions:
> 
> (1) gcc.target/i386/pr90500-*.c
> 
> which explains
> 
> FAIL: gcc.target/i386/pr90500-1.c  (test for errors, line 6)
> FAIL: gcc.target/i386/pr90500-1.c  (test for warnings, line 6)
> FAIL: gcc.target/i386/pr90500-1.c (test for excess errors)
> FAIL: gcc.target/i386/pr90500-2.c  (test for errors, line 6)
> FAIL: gcc.target/i386/pr90500-2.c  (test for warnings, line 6)
> FAIL: gcc.target/i386/pr90500-2.c (test for excess errors)
> 
> and is fixed with the trivial patch
> 
> --- ../_clean/gcc/testsuite/gcc.target/i386/pr90500-1.c   2019-05-16 
> 17:34:09.0 +0200
> +++ gcc/testsuite/gcc.target/i386/pr90500-1.c 2019-05-18 14:28:12.0 
> +0200
> @@ -1,6 +1,6 @@
> /* PR middle-end/84723 */
> /* { dg-do compile } */
> -/* { dg-require-ifunc } */
> +/* { dg-require-ifunc "" } */
> 
> __attribute__((target_clones("arch=haswell", "default"))) int __tanh() {}
> __typeof(__tanh) tanhf64 __attribute__((alias("__tanh")))/* { dg-error 
> "clones for .target_clones. attribute cannot be created" } */

From a Darwin point of view, this is OK (it seems obvious to me, also).

> --- ../_clean/gcc/testsuite/gcc.target/i386/pr90500-2.c   2019-05-16 
> 17:34:09.0 +0200
> +++ gcc/testsuite/gcc.target/i386/pr90500-2.c 2019-05-18 14:28:25.0 
> +0200
> @@ -1,6 +1,6 @@
> /* PR middle-end/84723 */
> /* { dg-do compile } */
> -/* { dg-require-ifunc } */
> +/* { dg-require-ifunc "" } */
> 
> __attribute__((target_clones("arch=haswell", "default"))) int __tanh() {}
> __typeof(__tanh) tanhf64 
> __attribute__((alias("__tanh"),target_clones("arch=haswell", "default"))); /* 
> { dg-error "clones for .target_clones. attribute cannot be created" } */
> 
> (2) gcc.target/i386/pr84723-*.c
> 
> which succeed on darwin. What is the suitable fix for that?

My assumption here is that the tests should not be run on a non-ifuncs target, 
but that it happens to be that they are testing for an erroneous condition 
- which by chance also gives the correct error on a non-ifuncs target.
> 
> (a) Fix the dg-require-ifunc as above?

I would prefer this, (it’s confusing to run tests for an unsupported 
functionality)
- unless there is some other value to running the tests (will wait for comments
on that).

thanks for the patch.
Iain

> (b) Remove the line?
> 
> TIA
> 
> Dominique
> 



dg-require-ifunc syntax

2019-05-19 Thread Dominique d'Humières
AFAICT the syntax for dg-require-ifunc seems to be

/* { dg-require-ifunc "" } */

with two sets of exceptions:

(1) gcc.target/i386/pr90500-*.c

which explains

FAIL: gcc.target/i386/pr90500-1.c  (test for errors, line 6)
FAIL: gcc.target/i386/pr90500-1.c  (test for warnings, line 6)
FAIL: gcc.target/i386/pr90500-1.c (test for excess errors)
FAIL: gcc.target/i386/pr90500-2.c  (test for errors, line 6)
FAIL: gcc.target/i386/pr90500-2.c  (test for warnings, line 6)
FAIL: gcc.target/i386/pr90500-2.c (test for excess errors)

and is fixed with the trivial patch

--- ../_clean/gcc/testsuite/gcc.target/i386/pr90500-1.c 2019-05-16 
17:34:09.0 +0200
+++ gcc/testsuite/gcc.target/i386/pr90500-1.c   2019-05-18 14:28:12.0 
+0200
@@ -1,6 +1,6 @@
 /* PR middle-end/84723 */
 /* { dg-do compile } */
-/* { dg-require-ifunc } */
+/* { dg-require-ifunc "" } */
 
 __attribute__((target_clones("arch=haswell", "default"))) int __tanh() {}
 __typeof(__tanh) tanhf64 __attribute__((alias("__tanh")))/* { dg-error "clones 
for .target_clones. attribute cannot be created" } */
--- ../_clean/gcc/testsuite/gcc.target/i386/pr90500-2.c 2019-05-16 
17:34:09.0 +0200
+++ gcc/testsuite/gcc.target/i386/pr90500-2.c   2019-05-18 14:28:25.0 
+0200
@@ -1,6 +1,6 @@
 /* PR middle-end/84723 */
 /* { dg-do compile } */
-/* { dg-require-ifunc } */
+/* { dg-require-ifunc "" } */
 
 __attribute__((target_clones("arch=haswell", "default"))) int __tanh() {}
 __typeof(__tanh) tanhf64 
__attribute__((alias("__tanh"),target_clones("arch=haswell", "default"))); /* { 
dg-error "clones for .target_clones. attribute cannot be created" } */

(2) gcc.target/i386/pr84723-*.c

which succeed on darwin. What is the suitable fix for that?

(a) Fix the dg-require-ifunc as above?
(b) Remove the line?

TIA

Dominique