* [PR 87339, testsuite] Fix failure of gcc.dg/warn-abs-1.c on some targets
@ 2018-09-24 19:09 Martin Jambor
2018-09-24 19:19 ` Mike Stump
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: Martin Jambor @ 2018-09-24 19:09 UTC (permalink / raw)
To: GCC Patches
Hi,
the test added to check whether _Float128 types are handled correctly by
the new warning about suspicious calls to abs-like functions fails on
many platforms. The patch below circumvents the problem by running on
i686/x86_64 only. I understand that the proper solution would be to
come up with a deja-gnu predicate and skip-if it was not provided but I
think that for one simple test that is a bit of an overkill and testing
it on x86_64 will provide all the test coverage we need.
Tested on x86_64-linux and aarch64-linux, testing on i686-linux
pending. OK for trunk?
Thanks,
Martin
2018-09-24 Martin Jambor <mjambor@suse.cz>
PR testsuite/87339
* gcc.dg/warn-abs-1.c: Do not test _Float128. Remove dg-skip-if.
* gcc.target/i386/warn-abs-3.c: New test.
---
gcc/testsuite/gcc.dg/warn-abs-1.c | 4 +---
gcc/testsuite/gcc.target/i386/warn-abs-3.c | 12 ++++++++++++
2 files changed, 13 insertions(+), 3 deletions(-)
create mode 100644 gcc/testsuite/gcc.target/i386/warn-abs-3.c
diff --git a/gcc/testsuite/gcc.dg/warn-abs-1.c b/gcc/testsuite/gcc.dg/warn-abs-1.c
index 129a3af8ac6..b494b14f4a9 100644
--- a/gcc/testsuite/gcc.dg/warn-abs-1.c
+++ b/gcc/testsuite/gcc.dg/warn-abs-1.c
@@ -1,5 +1,4 @@
/* { dg-do compile { target float128 } } */
-/* { dg-skip-if "incomplete long double support" { { newlib } && large_long_double } } */
/* { dg-options "-Wabsolute-value" } */
#include <stdlib.h>
@@ -41,12 +40,11 @@ tst_notfloat (int *pi, long *pl, complex double *pc)
}
void
-tst_float_size (double *pd, long double *pld, _Float128 *pf128)
+tst_float_size (double *pd, long double *pld)
{
*pd = fabsf (*pd); /* { dg-warning "may cause truncation of value" } */
*pld = fabs (*pld); /* { dg-warning "may cause truncation of value" } */
*pld = fabs ((double) *pld);
- *pf128 = fabsl (*pf128); /* { dg-warning "may cause truncation of value" } */
}
void tst_notcomplex (int *pi, long *pl, long double *pld)
diff --git a/gcc/testsuite/gcc.target/i386/warn-abs-3.c b/gcc/testsuite/gcc.target/i386/warn-abs-3.c
new file mode 100644
index 00000000000..21feaff7d8a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/warn-abs-3.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target float128 } } */
+/* { dg-options "-Wabsolute-value" } */
+
+#include <stdlib.h>
+#include <inttypes.h>
+#include <math.h>
+
+void
+tst_float128_size (_Float128 *pf128)
+{
+ *pf128 = fabsl (*pf128); /* { dg-warning "may cause truncation of value" } */
+}
--
2.18.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR 87339, testsuite] Fix failure of gcc.dg/warn-abs-1.c on some targets
2018-09-24 19:09 [PR 87339, testsuite] Fix failure of gcc.dg/warn-abs-1.c on some targets Martin Jambor
@ 2018-09-24 19:19 ` Mike Stump
2018-09-24 21:46 ` Christophe Lyon
2018-09-25 18:26 ` Jeff Law
2 siblings, 0 replies; 15+ messages in thread
From: Mike Stump @ 2018-09-24 19:19 UTC (permalink / raw)
To: Martin Jambor; +Cc: GCC Patches
On Sep 24, 2018, at 11:45 AM, Martin Jambor <mjambor@suse.cz> wrote:
>
> the test added to check whether _Float128 types are handled correctly by
> the new warning about suspicious calls to abs-like functions fails on
> many platforms. The patch below circumvents the problem by running on
> i686/x86_64 only. I understand that the proper solution would be to
> come up with a deja-gnu predicate and skip-if it was not provided but I
> think that for one simple test that is a bit of an overkill and testing
> it on x86_64 will provide all the test coverage we need.
>
> Tested on x86_64-linux and aarch64-linux, testing on i686-linux
> pending. OK for trunk?
Ok.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR 87339, testsuite] Fix failure of gcc.dg/warn-abs-1.c on some targets
2018-09-24 19:09 [PR 87339, testsuite] Fix failure of gcc.dg/warn-abs-1.c on some targets Martin Jambor
2018-09-24 19:19 ` Mike Stump
@ 2018-09-24 21:46 ` Christophe Lyon
2018-09-25 15:53 ` Martin Jambor
2018-09-25 18:26 ` Jeff Law
2 siblings, 1 reply; 15+ messages in thread
From: Christophe Lyon @ 2018-09-24 21:46 UTC (permalink / raw)
To: Martin Jambor; +Cc: gcc Patches
On Mon, 24 Sep 2018 at 20:46, Martin Jambor <mjambor@suse.cz> wrote:
>
> Hi,
>
> the test added to check whether _Float128 types are handled correctly by
> the new warning about suspicious calls to abs-like functions fails on
> many platforms. The patch below circumvents the problem by running on
> i686/x86_64 only. I understand that the proper solution would be to
> come up with a deja-gnu predicate and skip-if it was not provided but I
> think that for one simple test that is a bit of an overkill and testing
> it on x86_64 will provide all the test coverage we need.
>
> Tested on x86_64-linux and aarch64-linux, testing on i686-linux
> pending. OK for trunk?
>
> Thanks,
>
> Martin
>
>
>
> 2018-09-24 Martin Jambor <mjambor@suse.cz>
>
> PR testsuite/87339
> * gcc.dg/warn-abs-1.c: Do not test _Float128. Remove dg-skip-if.
> * gcc.target/i386/warn-abs-3.c: New test.
> ---
> gcc/testsuite/gcc.dg/warn-abs-1.c | 4 +---
> gcc/testsuite/gcc.target/i386/warn-abs-3.c | 12 ++++++++++++
> 2 files changed, 13 insertions(+), 3 deletions(-)
> create mode 100644 gcc/testsuite/gcc.target/i386/warn-abs-3.c
>
> diff --git a/gcc/testsuite/gcc.dg/warn-abs-1.c b/gcc/testsuite/gcc.dg/warn-abs-1.c
> index 129a3af8ac6..b494b14f4a9 100644
> --- a/gcc/testsuite/gcc.dg/warn-abs-1.c
> +++ b/gcc/testsuite/gcc.dg/warn-abs-1.c
> @@ -1,5 +1,4 @@
> /* { dg-do compile { target float128 } } */
Don't you want to remove the {target float128} part?
> -/* { dg-skip-if "incomplete long double support" { { newlib } && large_long_double } } */
> /* { dg-options "-Wabsolute-value" } */
>
> #include <stdlib.h>
> @@ -41,12 +40,11 @@ tst_notfloat (int *pi, long *pl, complex double *pc)
> }
>
> void
> -tst_float_size (double *pd, long double *pld, _Float128 *pf128)
> +tst_float_size (double *pd, long double *pld)
> {
> *pd = fabsf (*pd); /* { dg-warning "may cause truncation of value" } */
> *pld = fabs (*pld); /* { dg-warning "may cause truncation of value" } */
> *pld = fabs ((double) *pld);
> - *pf128 = fabsl (*pf128); /* { dg-warning "may cause truncation of value" } */
> }
>
> void tst_notcomplex (int *pi, long *pl, long double *pld)
> diff --git a/gcc/testsuite/gcc.target/i386/warn-abs-3.c b/gcc/testsuite/gcc.target/i386/warn-abs-3.c
> new file mode 100644
> index 00000000000..21feaff7d8a
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/i386/warn-abs-3.c
> @@ -0,0 +1,12 @@
> +/* { dg-do compile { target float128 } } */
> +/* { dg-options "-Wabsolute-value" } */
> +
> +#include <stdlib.h>
> +#include <inttypes.h>
> +#include <math.h>
> +
> +void
> +tst_float128_size (_Float128 *pf128)
> +{
> + *pf128 = fabsl (*pf128); /* { dg-warning "may cause truncation of value" } */
> +}
> --
> 2.18.0
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR 87339, testsuite] Fix failure of gcc.dg/warn-abs-1.c on some targets
2018-09-24 21:46 ` Christophe Lyon
@ 2018-09-25 15:53 ` Martin Jambor
2018-09-26 15:06 ` Christophe Lyon
0 siblings, 1 reply; 15+ messages in thread
From: Martin Jambor @ 2018-09-25 15:53 UTC (permalink / raw)
To: Christophe Lyon; +Cc: gcc Patches, Mike Stump
Hi,
On Mon, Sep 24 2018, Christophe Lyon wrote:
> On Mon, 24 Sep 2018 at 20:46, Martin Jambor <mjambor@suse.cz> wrote:
>>
>> Hi,
>>
>> the test added to check whether _Float128 types are handled correctly by
>> the new warning about suspicious calls to abs-like functions fails on
>> many platforms. The patch below circumvents the problem by running on
>> i686/x86_64 only. I understand that the proper solution would be to
>> come up with a deja-gnu predicate and skip-if it was not provided but I
>> think that for one simple test that is a bit of an overkill and testing
>> it on x86_64 will provide all the test coverage we need.
>>
>> Tested on x86_64-linux and aarch64-linux, testing on i686-linux
>> pending. OK for trunk?
>>
>> Thanks,
>>
>> Martin
>>
>>
>>
>> 2018-09-24 Martin Jambor <mjambor@suse.cz>
>>
>> PR testsuite/87339
>> * gcc.dg/warn-abs-1.c: Do not test _Float128. Remove dg-skip-if.
>> * gcc.target/i386/warn-abs-3.c: New test.
>> ---
>> gcc/testsuite/gcc.dg/warn-abs-1.c | 4 +---
>> gcc/testsuite/gcc.target/i386/warn-abs-3.c | 12 ++++++++++++
>> 2 files changed, 13 insertions(+), 3 deletions(-)
>> create mode 100644 gcc/testsuite/gcc.target/i386/warn-abs-3.c
>>
>> diff --git a/gcc/testsuite/gcc.dg/warn-abs-1.c b/gcc/testsuite/gcc.dg/warn-abs-1.c
>> index 129a3af8ac6..b494b14f4a9 100644
>> --- a/gcc/testsuite/gcc.dg/warn-abs-1.c
>> +++ b/gcc/testsuite/gcc.dg/warn-abs-1.c
>> @@ -1,5 +1,4 @@
>> /* { dg-do compile { target float128 } } */
>
> Don't you want to remove the {target float128} part?
I did notice it but yes, I do want to remove it. I am therefore going
to commit the following after re-testing on x86_64-linux and
aarch64-linux.
Thank you,
Martin
2018-09-25 Martin Jambor <mjambor@suse.cz>
PR testsuite/87339
* gcc.dg/warn-abs-1.c: Do not test _Float128. Remove dg-skip-if and
float125 target.
* gcc.target/i386/warn-abs-3.c: New test.
---
gcc/testsuite/gcc.dg/warn-abs-1.c | 6 ++----
gcc/testsuite/gcc.target/i386/warn-abs-3.c | 12 ++++++++++++
2 files changed, 14 insertions(+), 4 deletions(-)
create mode 100644 gcc/testsuite/gcc.target/i386/warn-abs-3.c
diff --git a/gcc/testsuite/gcc.dg/warn-abs-1.c b/gcc/testsuite/gcc.dg/warn-abs-1.c
index 129a3af8ac6..1c487270042 100644
--- a/gcc/testsuite/gcc.dg/warn-abs-1.c
+++ b/gcc/testsuite/gcc.dg/warn-abs-1.c
@@ -1,5 +1,4 @@
-/* { dg-do compile { target float128 } } */
-/* { dg-skip-if "incomplete long double support" { { newlib } && large_long_double } } */
+/* { dg-do compile } */
/* { dg-options "-Wabsolute-value" } */
#include <stdlib.h>
@@ -41,12 +40,11 @@ tst_notfloat (int *pi, long *pl, complex double *pc)
}
void
-tst_float_size (double *pd, long double *pld, _Float128 *pf128)
+tst_float_size (double *pd, long double *pld)
{
*pd = fabsf (*pd); /* { dg-warning "may cause truncation of value" } */
*pld = fabs (*pld); /* { dg-warning "may cause truncation of value" } */
*pld = fabs ((double) *pld);
- *pf128 = fabsl (*pf128); /* { dg-warning "may cause truncation of value" } */
}
void tst_notcomplex (int *pi, long *pl, long double *pld)
diff --git a/gcc/testsuite/gcc.target/i386/warn-abs-3.c b/gcc/testsuite/gcc.target/i386/warn-abs-3.c
new file mode 100644
index 00000000000..21feaff7d8a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/warn-abs-3.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target float128 } } */
+/* { dg-options "-Wabsolute-value" } */
+
+#include <stdlib.h>
+#include <inttypes.h>
+#include <math.h>
+
+void
+tst_float128_size (_Float128 *pf128)
+{
+ *pf128 = fabsl (*pf128); /* { dg-warning "may cause truncation of value" } */
+}
--
2.18.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR 87339, testsuite] Fix failure of gcc.dg/warn-abs-1.c on some targets
2018-09-24 19:09 [PR 87339, testsuite] Fix failure of gcc.dg/warn-abs-1.c on some targets Martin Jambor
2018-09-24 19:19 ` Mike Stump
2018-09-24 21:46 ` Christophe Lyon
@ 2018-09-25 18:26 ` Jeff Law
2 siblings, 0 replies; 15+ messages in thread
From: Jeff Law @ 2018-09-25 18:26 UTC (permalink / raw)
To: Martin Jambor, GCC Patches
On 9/24/18 12:45 PM, Martin Jambor wrote:
> Hi,
>
> the test added to check whether _Float128 types are handled correctly by
> the new warning about suspicious calls to abs-like functions fails on
> many platforms. The patch below circumvents the problem by running on
> i686/x86_64 only. I understand that the proper solution would be to
> come up with a deja-gnu predicate and skip-if it was not provided but I
> think that for one simple test that is a bit of an overkill and testing
> it on x86_64 will provide all the test coverage we need.
>
> Tested on x86_64-linux and aarch64-linux, testing on i686-linux
> pending. OK for trunk?
>
> Thanks,
>
> Martin
>
>
>
> 2018-09-24 Martin Jambor <mjambor@suse.cz>
>
> PR testsuite/87339
> * gcc.dg/warn-abs-1.c: Do not test _Float128. Remove dg-skip-if.
> * gcc.target/i386/warn-abs-3.c: New test.
OK
jeff
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR 87339, testsuite] Fix failure of gcc.dg/warn-abs-1.c on some targets
2018-09-25 15:53 ` Martin Jambor
@ 2018-09-26 15:06 ` Christophe Lyon
2018-09-26 15:30 ` Martin Jambor
0 siblings, 1 reply; 15+ messages in thread
From: Christophe Lyon @ 2018-09-26 15:06 UTC (permalink / raw)
To: Martin Jambor; +Cc: gcc Patches, Mike Stump
On Tue, 25 Sep 2018 at 17:50, Martin Jambor <mjambor@suse.cz> wrote:
>
> Hi,
>
> On Mon, Sep 24 2018, Christophe Lyon wrote:
> > On Mon, 24 Sep 2018 at 20:46, Martin Jambor <mjambor@suse.cz> wrote:
> >>
> >> Hi,
> >>
> >> the test added to check whether _Float128 types are handled correctly by
> >> the new warning about suspicious calls to abs-like functions fails on
> >> many platforms. The patch below circumvents the problem by running on
> >> i686/x86_64 only. I understand that the proper solution would be to
> >> come up with a deja-gnu predicate and skip-if it was not provided but I
> >> think that for one simple test that is a bit of an overkill and testing
> >> it on x86_64 will provide all the test coverage we need.
> >>
> >> Tested on x86_64-linux and aarch64-linux, testing on i686-linux
> >> pending. OK for trunk?
> >>
> >> Thanks,
> >>
> >> Martin
> >>
> >>
> >>
> >> 2018-09-24 Martin Jambor <mjambor@suse.cz>
> >>
> >> PR testsuite/87339
> >> * gcc.dg/warn-abs-1.c: Do not test _Float128. Remove dg-skip-if.
> >> * gcc.target/i386/warn-abs-3.c: New test.
> >> ---
> >> gcc/testsuite/gcc.dg/warn-abs-1.c | 4 +---
> >> gcc/testsuite/gcc.target/i386/warn-abs-3.c | 12 ++++++++++++
> >> 2 files changed, 13 insertions(+), 3 deletions(-)
> >> create mode 100644 gcc/testsuite/gcc.target/i386/warn-abs-3.c
> >>
> >> diff --git a/gcc/testsuite/gcc.dg/warn-abs-1.c b/gcc/testsuite/gcc.dg/warn-abs-1.c
> >> index 129a3af8ac6..b494b14f4a9 100644
> >> --- a/gcc/testsuite/gcc.dg/warn-abs-1.c
> >> +++ b/gcc/testsuite/gcc.dg/warn-abs-1.c
> >> @@ -1,5 +1,4 @@
> >> /* { dg-do compile { target float128 } } */
> >
> > Don't you want to remove the {target float128} part?
>
> I did notice it but yes, I do want to remove it. I am therefore going
> to commit the following after re-testing on x86_64-linux and
> aarch64-linux.
>
> Thank you,
>
Hi, thanks for this fix.
Now the test runs on ARM, but fails because of two missing warnings:
gcc.dg/warn-abs-1.c (test for warnings, line 46)
gcc.dg/warn-abs-1.c (test for warnings, line 60)
which correspond to:
*pld = fabs (*pld); /* { dg-warning "may cause truncation of value" } */
*pcld = cabs (*pcld); /* { dg-warning "may cause truncation of value" } */
Christophe
> Martin
>
>
> 2018-09-25 Martin Jambor <mjambor@suse.cz>
>
> PR testsuite/87339
> * gcc.dg/warn-abs-1.c: Do not test _Float128. Remove dg-skip-if and
> float125 target.
> * gcc.target/i386/warn-abs-3.c: New test.
> ---
> gcc/testsuite/gcc.dg/warn-abs-1.c | 6 ++----
> gcc/testsuite/gcc.target/i386/warn-abs-3.c | 12 ++++++++++++
> 2 files changed, 14 insertions(+), 4 deletions(-)
> create mode 100644 gcc/testsuite/gcc.target/i386/warn-abs-3.c
>
> diff --git a/gcc/testsuite/gcc.dg/warn-abs-1.c b/gcc/testsuite/gcc.dg/warn-abs-1.c
> index 129a3af8ac6..1c487270042 100644
> --- a/gcc/testsuite/gcc.dg/warn-abs-1.c
> +++ b/gcc/testsuite/gcc.dg/warn-abs-1.c
> @@ -1,5 +1,4 @@
> -/* { dg-do compile { target float128 } } */
> -/* { dg-skip-if "incomplete long double support" { { newlib } && large_long_double } } */
> +/* { dg-do compile } */
> /* { dg-options "-Wabsolute-value" } */
>
> #include <stdlib.h>
> @@ -41,12 +40,11 @@ tst_notfloat (int *pi, long *pl, complex double *pc)
> }
>
> void
> -tst_float_size (double *pd, long double *pld, _Float128 *pf128)
> +tst_float_size (double *pd, long double *pld)
> {
> *pd = fabsf (*pd); /* { dg-warning "may cause truncation of value" } */
> *pld = fabs (*pld); /* { dg-warning "may cause truncation of value" } */
> *pld = fabs ((double) *pld);
> - *pf128 = fabsl (*pf128); /* { dg-warning "may cause truncation of value" } */
> }
>
> void tst_notcomplex (int *pi, long *pl, long double *pld)
> diff --git a/gcc/testsuite/gcc.target/i386/warn-abs-3.c b/gcc/testsuite/gcc.target/i386/warn-abs-3.c
> new file mode 100644
> index 00000000000..21feaff7d8a
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/i386/warn-abs-3.c
> @@ -0,0 +1,12 @@
> +/* { dg-do compile { target float128 } } */
> +/* { dg-options "-Wabsolute-value" } */
> +
> +#include <stdlib.h>
> +#include <inttypes.h>
> +#include <math.h>
> +
> +void
> +tst_float128_size (_Float128 *pf128)
> +{
> + *pf128 = fabsl (*pf128); /* { dg-warning "may cause truncation of value" } */
> +}
> --
> 2.18.0
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR 87339, testsuite] Fix failure of gcc.dg/warn-abs-1.c on some targets
2018-09-26 15:06 ` Christophe Lyon
@ 2018-09-26 15:30 ` Martin Jambor
2018-09-26 17:12 ` Joseph Myers
2018-09-27 18:57 ` Christophe Lyon
0 siblings, 2 replies; 15+ messages in thread
From: Martin Jambor @ 2018-09-26 15:30 UTC (permalink / raw)
To: Christophe Lyon; +Cc: gcc Patches, Mike Stump
Hi,
On Wed, Sep 26 2018, Christophe Lyon wrote:
> On Tue, 25 Sep 2018 at 17:50, Martin Jambor <mjambor@suse.cz> wrote:
>>
>> Hi,
>>
>> On Mon, Sep 24 2018, Christophe Lyon wrote:
>> > On Mon, 24 Sep 2018 at 20:46, Martin Jambor <mjambor@suse.cz> wrote:
>> >>
>> >> Hi,
>> >>
>> >> the test added to check whether _Float128 types are handled correctly by
>> >> the new warning about suspicious calls to abs-like functions fails on
>> >> many platforms. The patch below circumvents the problem by running on
>> >> i686/x86_64 only. I understand that the proper solution would be to
>> >> come up with a deja-gnu predicate and skip-if it was not provided but I
>> >> think that for one simple test that is a bit of an overkill and testing
>> >> it on x86_64 will provide all the test coverage we need.
>> >>
>> >> Tested on x86_64-linux and aarch64-linux, testing on i686-linux
>> >> pending. OK for trunk?
>> >>
>> >> Thanks,
>> >>
>> >> Martin
>> >>
>> >>
>> >>
>> >> 2018-09-24 Martin Jambor <mjambor@suse.cz>
>> >>
>> >> PR testsuite/87339
>> >> * gcc.dg/warn-abs-1.c: Do not test _Float128. Remove dg-skip-if.
>> >> * gcc.target/i386/warn-abs-3.c: New test.
>> >> ---
>> >> gcc/testsuite/gcc.dg/warn-abs-1.c | 4 +---
>> >> gcc/testsuite/gcc.target/i386/warn-abs-3.c | 12 ++++++++++++
>> >> 2 files changed, 13 insertions(+), 3 deletions(-)
>> >> create mode 100644 gcc/testsuite/gcc.target/i386/warn-abs-3.c
>> >>
>> >> diff --git a/gcc/testsuite/gcc.dg/warn-abs-1.c b/gcc/testsuite/gcc.dg/warn-abs-1.c
>> >> index 129a3af8ac6..b494b14f4a9 100644
>> >> --- a/gcc/testsuite/gcc.dg/warn-abs-1.c
>> >> +++ b/gcc/testsuite/gcc.dg/warn-abs-1.c
>> >> @@ -1,5 +1,4 @@
>> >> /* { dg-do compile { target float128 } } */
>> >
>> > Don't you want to remove the {target float128} part?
>>
>> I did notice it but yes, I do want to remove it. I am therefore going
>> to commit the following after re-testing on x86_64-linux and
>> aarch64-linux.
>>
>> Thank you,
>>
>
> Hi, thanks for this fix.
> Now the test runs on ARM, but fails because of two missing warnings:
> gcc.dg/warn-abs-1.c (test for warnings, line 46)
> gcc.dg/warn-abs-1.c (test for warnings, line 60)
> which correspond to:
> *pld = fabs (*pld); /* { dg-warning "may cause truncation of value" } */
> *pcld = cabs (*pcld); /* { dg-warning "may cause truncation of value" } */
>
I see, I guess the easiest is to skip the test on targets that do not
really have long double, although if someone thinks that is too
restrictive, I can also split the test again and move long double bits
to a separate test.
Can you please test whether the following helps?
Thanks and sorry for the disruptions,
Martin
diff --git a/gcc/testsuite/gcc.dg/warn-abs-1.c b/gcc/testsuite/gcc.dg/warn-abs-1.c
index 1c487270042..88389ec6be8 100644
--- a/gcc/testsuite/gcc.dg/warn-abs-1.c
+++ b/gcc/testsuite/gcc.dg/warn-abs-1.c
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-require-effective-target large_long_double } */
/* { dg-options "-Wabsolute-value" } */
#include <stdlib.h>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR 87339, testsuite] Fix failure of gcc.dg/warn-abs-1.c on some targets
2018-09-26 15:30 ` Martin Jambor
@ 2018-09-26 17:12 ` Joseph Myers
2018-10-10 11:19 ` Martin Jambor
2018-09-27 18:57 ` Christophe Lyon
1 sibling, 1 reply; 15+ messages in thread
From: Joseph Myers @ 2018-09-26 17:12 UTC (permalink / raw)
To: Martin Jambor; +Cc: Christophe Lyon, gcc Patches, Mike Stump
On Wed, 26 Sep 2018, Martin Jambor wrote:
> I see, I guess the easiest is to skip the test on targets that do not
> really have long double, although if someone thinks that is too
> restrictive, I can also split the test again and move long double bits
> to a separate test.
You should be able to use
{ dg-warning "warning regex" "test name" { target { large_long_double } } }
to make the expectation of a warning conditional without making the whole
test conditional.
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR 87339, testsuite] Fix failure of gcc.dg/warn-abs-1.c on some targets
2018-09-26 15:30 ` Martin Jambor
2018-09-26 17:12 ` Joseph Myers
@ 2018-09-27 18:57 ` Christophe Lyon
2018-09-28 9:11 ` Christophe Lyon
1 sibling, 1 reply; 15+ messages in thread
From: Christophe Lyon @ 2018-09-27 18:57 UTC (permalink / raw)
To: Martin Jambor; +Cc: gcc Patches, Mike Stump
On Wed, 26 Sep 2018 at 17:26, Martin Jambor <mjambor@suse.cz> wrote:
>
> Hi,
>
> On Wed, Sep 26 2018, Christophe Lyon wrote:
> > On Tue, 25 Sep 2018 at 17:50, Martin Jambor <mjambor@suse.cz> wrote:
> >>
> >> Hi,
> >>
> >> On Mon, Sep 24 2018, Christophe Lyon wrote:
> >> > On Mon, 24 Sep 2018 at 20:46, Martin Jambor <mjambor@suse.cz> wrote:
> >> >>
> >> >> Hi,
> >> >>
> >> >> the test added to check whether _Float128 types are handled correctly by
> >> >> the new warning about suspicious calls to abs-like functions fails on
> >> >> many platforms. The patch below circumvents the problem by running on
> >> >> i686/x86_64 only. I understand that the proper solution would be to
> >> >> come up with a deja-gnu predicate and skip-if it was not provided but I
> >> >> think that for one simple test that is a bit of an overkill and testing
> >> >> it on x86_64 will provide all the test coverage we need.
> >> >>
> >> >> Tested on x86_64-linux and aarch64-linux, testing on i686-linux
> >> >> pending. OK for trunk?
> >> >>
> >> >> Thanks,
> >> >>
> >> >> Martin
> >> >>
> >> >>
> >> >>
> >> >> 2018-09-24 Martin Jambor <mjambor@suse.cz>
> >> >>
> >> >> PR testsuite/87339
> >> >> * gcc.dg/warn-abs-1.c: Do not test _Float128. Remove dg-skip-if.
> >> >> * gcc.target/i386/warn-abs-3.c: New test.
> >> >> ---
> >> >> gcc/testsuite/gcc.dg/warn-abs-1.c | 4 +---
> >> >> gcc/testsuite/gcc.target/i386/warn-abs-3.c | 12 ++++++++++++
> >> >> 2 files changed, 13 insertions(+), 3 deletions(-)
> >> >> create mode 100644 gcc/testsuite/gcc.target/i386/warn-abs-3.c
> >> >>
> >> >> diff --git a/gcc/testsuite/gcc.dg/warn-abs-1.c b/gcc/testsuite/gcc.dg/warn-abs-1.c
> >> >> index 129a3af8ac6..b494b14f4a9 100644
> >> >> --- a/gcc/testsuite/gcc.dg/warn-abs-1.c
> >> >> +++ b/gcc/testsuite/gcc.dg/warn-abs-1.c
> >> >> @@ -1,5 +1,4 @@
> >> >> /* { dg-do compile { target float128 } } */
> >> >
> >> > Don't you want to remove the {target float128} part?
> >>
> >> I did notice it but yes, I do want to remove it. I am therefore going
> >> to commit the following after re-testing on x86_64-linux and
> >> aarch64-linux.
> >>
> >> Thank you,
> >>
> >
> > Hi, thanks for this fix.
> > Now the test runs on ARM, but fails because of two missing warnings:
> > gcc.dg/warn-abs-1.c (test for warnings, line 46)
> > gcc.dg/warn-abs-1.c (test for warnings, line 60)
> > which correspond to:
> > *pld = fabs (*pld); /* { dg-warning "may cause truncation of value" } */
> > *pcld = cabs (*pcld); /* { dg-warning "may cause truncation of value" } */
> >
>
> I see, I guess the easiest is to skip the test on targets that do not
> really have long double, although if someone thinks that is too
> restrictive, I can also split the test again and move long double bits
> to a separate test.
>
> Can you please test whether the following helps?
>
Sorry for the delay, yes it is better in the sense that the tests are
now skipped.
I haven't tried Joseph's suggestion yet.
> Thanks and sorry for the disruptions,
>
> Martin
>
>
>
> diff --git a/gcc/testsuite/gcc.dg/warn-abs-1.c b/gcc/testsuite/gcc.dg/warn-abs-1.c
> index 1c487270042..88389ec6be8 100644
> --- a/gcc/testsuite/gcc.dg/warn-abs-1.c
> +++ b/gcc/testsuite/gcc.dg/warn-abs-1.c
> @@ -1,4 +1,5 @@
> /* { dg-do compile } */
> +/* { dg-require-effective-target large_long_double } */
> /* { dg-options "-Wabsolute-value" } */
>
> #include <stdlib.h>
>
>
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR 87339, testsuite] Fix failure of gcc.dg/warn-abs-1.c on some targets
2018-09-27 18:57 ` Christophe Lyon
@ 2018-09-28 9:11 ` Christophe Lyon
0 siblings, 0 replies; 15+ messages in thread
From: Christophe Lyon @ 2018-09-28 9:11 UTC (permalink / raw)
To: Martin Jambor; +Cc: gcc Patches, Mike Stump
On Thu, 27 Sep 2018 at 20:48, Christophe Lyon
<christophe.lyon@linaro.org> wrote:
>
> On Wed, 26 Sep 2018 at 17:26, Martin Jambor <mjambor@suse.cz> wrote:
> >
> > Hi,
> >
> > On Wed, Sep 26 2018, Christophe Lyon wrote:
> > > On Tue, 25 Sep 2018 at 17:50, Martin Jambor <mjambor@suse.cz> wrote:
> > >>
> > >> Hi,
> > >>
> > >> On Mon, Sep 24 2018, Christophe Lyon wrote:
> > >> > On Mon, 24 Sep 2018 at 20:46, Martin Jambor <mjambor@suse.cz> wrote:
> > >> >>
> > >> >> Hi,
> > >> >>
> > >> >> the test added to check whether _Float128 types are handled correctly by
> > >> >> the new warning about suspicious calls to abs-like functions fails on
> > >> >> many platforms. The patch below circumvents the problem by running on
> > >> >> i686/x86_64 only. I understand that the proper solution would be to
> > >> >> come up with a deja-gnu predicate and skip-if it was not provided but I
> > >> >> think that for one simple test that is a bit of an overkill and testing
> > >> >> it on x86_64 will provide all the test coverage we need.
> > >> >>
> > >> >> Tested on x86_64-linux and aarch64-linux, testing on i686-linux
> > >> >> pending. OK for trunk?
> > >> >>
> > >> >> Thanks,
> > >> >>
> > >> >> Martin
> > >> >>
> > >> >>
> > >> >>
> > >> >> 2018-09-24 Martin Jambor <mjambor@suse.cz>
> > >> >>
> > >> >> PR testsuite/87339
> > >> >> * gcc.dg/warn-abs-1.c: Do not test _Float128. Remove dg-skip-if.
> > >> >> * gcc.target/i386/warn-abs-3.c: New test.
> > >> >> ---
> > >> >> gcc/testsuite/gcc.dg/warn-abs-1.c | 4 +---
> > >> >> gcc/testsuite/gcc.target/i386/warn-abs-3.c | 12 ++++++++++++
> > >> >> 2 files changed, 13 insertions(+), 3 deletions(-)
> > >> >> create mode 100644 gcc/testsuite/gcc.target/i386/warn-abs-3.c
> > >> >>
> > >> >> diff --git a/gcc/testsuite/gcc.dg/warn-abs-1.c b/gcc/testsuite/gcc.dg/warn-abs-1.c
> > >> >> index 129a3af8ac6..b494b14f4a9 100644
> > >> >> --- a/gcc/testsuite/gcc.dg/warn-abs-1.c
> > >> >> +++ b/gcc/testsuite/gcc.dg/warn-abs-1.c
> > >> >> @@ -1,5 +1,4 @@
> > >> >> /* { dg-do compile { target float128 } } */
> > >> >
> > >> > Don't you want to remove the {target float128} part?
> > >>
> > >> I did notice it but yes, I do want to remove it. I am therefore going
> > >> to commit the following after re-testing on x86_64-linux and
> > >> aarch64-linux.
> > >>
> > >> Thank you,
> > >>
> > >
> > > Hi, thanks for this fix.
> > > Now the test runs on ARM, but fails because of two missing warnings:
> > > gcc.dg/warn-abs-1.c (test for warnings, line 46)
> > > gcc.dg/warn-abs-1.c (test for warnings, line 60)
> > > which correspond to:
> > > *pld = fabs (*pld); /* { dg-warning "may cause truncation of value" } */
> > > *pcld = cabs (*pcld); /* { dg-warning "may cause truncation of value" } */
> > >
> >
> > I see, I guess the easiest is to skip the test on targets that do not
> > really have long double, although if someone thinks that is too
> > restrictive, I can also split the test again and move long double bits
> > to a separate test.
> >
> > Can you please test whether the following helps?
> >
> Sorry for the delay, yes it is better in the sense that the tests are
> now skipped.
>
> I haven't tried Joseph's suggestion yet.
>
So, I've tried:
/* { dg-warning "may cause truncation of value" "" { target {
large_long_double } } } */
which works well. Not sure if you'd want to put a comment instead of "" ?
Christophe
> > Thanks and sorry for the disruptions,
> >
> > Martin
> >
> >
> >
> > diff --git a/gcc/testsuite/gcc.dg/warn-abs-1.c b/gcc/testsuite/gcc.dg/warn-abs-1.c
> > index 1c487270042..88389ec6be8 100644
> > --- a/gcc/testsuite/gcc.dg/warn-abs-1.c
> > +++ b/gcc/testsuite/gcc.dg/warn-abs-1.c
> > @@ -1,4 +1,5 @@
> > /* { dg-do compile } */
> > +/* { dg-require-effective-target large_long_double } */
> > /* { dg-options "-Wabsolute-value" } */
> >
> > #include <stdlib.h>
> >
> >
> >
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR 87339, testsuite] Fix failure of gcc.dg/warn-abs-1.c on some targets
2018-09-26 17:12 ` Joseph Myers
@ 2018-10-10 11:19 ` Martin Jambor
2018-10-10 12:44 ` Christophe Lyon
0 siblings, 1 reply; 15+ messages in thread
From: Martin Jambor @ 2018-10-10 11:19 UTC (permalink / raw)
To: Joseph Myers; +Cc: Christophe Lyon, gcc Patches, Mike Stump
Hi,
On Wed, Sep 26 2018, Joseph Myers wrote:
> On Wed, 26 Sep 2018, Martin Jambor wrote:
>
>> I see, I guess the easiest is to skip the test on targets that do not
>> really have long double, although if someone thinks that is too
>> restrictive, I can also split the test again and move long double bits
>> to a separate test.
>
> You should be able to use
>
> { dg-warning "warning regex" "test name" { target { large_long_double } } }
>
> to make the expectation of a warning conditional without making the whole
> test conditional.
I hoped that Christophe would try this out because I do not have an easy
access to a problematic architecture, but I can at least confirm that
the following still passes on x86_64-linux (and should also pass on
archs without long double, if I understood Joseph well).
OK for trunk?
Thanks,
Martin
2018-10-10 Martin Jambor <mjambor@suse.cz>
testsuite/
* gcc.dg/warn-abs-1.c: Guard tests assuming size of long double is
greater that the size of double by target large_long double.
---
gcc/testsuite/gcc.dg/warn-abs-1.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/testsuite/gcc.dg/warn-abs-1.c b/gcc/testsuite/gcc.dg/warn-abs-1.c
index 1c487270042..3e8aa72d243 100644
--- a/gcc/testsuite/gcc.dg/warn-abs-1.c
+++ b/gcc/testsuite/gcc.dg/warn-abs-1.c
@@ -43,7 +43,7 @@ void
tst_float_size (double *pd, long double *pld)
{
*pd = fabsf (*pd); /* { dg-warning "may cause truncation of value" } */
- *pld = fabs (*pld); /* { dg-warning "may cause truncation of value" } */
+ *pld = fabs (*pld); /* { dg-warning "may cause truncation of value" "fabs trunc" { target { large_long_double } } } */
*pld = fabs ((double) *pld);
}
@@ -57,7 +57,7 @@ void tst_notcomplex (int *pi, long *pl, long double *pld)
void tst_cplx_size (complex double *pcd, complex long double *pcld)
{
*pcd = cabsf (*pcd); /* { dg-warning "may cause truncation of value" } */
- *pcld = cabs (*pcld); /* { dg-warning "may cause truncation of value" } */
+ *pcld = cabs (*pcld); /* { /* { dg-warning "may cause truncation of value" "cabs trunc" { target { large_long_double } } } */
*pcld = cabs ((complex double) *pcld);
}
--
2.19.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR 87339, testsuite] Fix failure of gcc.dg/warn-abs-1.c on some targets
2018-10-10 11:19 ` Martin Jambor
@ 2018-10-10 12:44 ` Christophe Lyon
2018-10-10 13:37 ` Martin Jambor
0 siblings, 1 reply; 15+ messages in thread
From: Christophe Lyon @ 2018-10-10 12:44 UTC (permalink / raw)
To: Martin Jambor, Joseph Myers; +Cc: Christophe Lyon, gcc Patches, Mike Stump
On 10/10/2018 13:17, Martin Jambor wrote:
> Hi,
>
> On Wed, Sep 26 2018, Joseph Myers wrote:
>> On Wed, 26 Sep 2018, Martin Jambor wrote:
>>
>>> I see, I guess the easiest is to skip the test on targets that do not
>>> really have long double, although if someone thinks that is too
>>> restrictive, I can also split the test again and move long double bits
>>> to a separate test.
>> You should be able to use
>>
>> { dg-warning "warning regex" "test name" { target { large_long_double } } }
>>
>> to make the expectation of a warning conditional without making the whole
>> test conditional.
> I hoped that Christophe would try this out because I do not have an easy
> access to a problematic architecture, but I can at least confirm that
> the following still passes on x86_64-linux (and should also pass on
> archs without long double, if I understood Joseph well).
I did: https://gcc.gnu.org/ml/gcc-patches/2018-09/msg01713.html
Sorry if I wasn't explicit enough
> OK for trunk?
>
> Thanks,
>
> Martin
>
>
> 2018-10-10 Martin Jambor <mjambor@suse.cz>
>
> testsuite/
> * gcc.dg/warn-abs-1.c: Guard tests assuming size of long double is
> greater that the size of double by target large_long double.
> ---
> gcc/testsuite/gcc.dg/warn-abs-1.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/testsuite/gcc.dg/warn-abs-1.c b/gcc/testsuite/gcc.dg/warn-abs-1.c
> index 1c487270042..3e8aa72d243 100644
> --- a/gcc/testsuite/gcc.dg/warn-abs-1.c
> +++ b/gcc/testsuite/gcc.dg/warn-abs-1.c
> @@ -43,7 +43,7 @@ void
> tst_float_size (double *pd, long double *pld)
> {
> *pd = fabsf (*pd); /* { dg-warning "may cause truncation of value" } */
> - *pld = fabs (*pld); /* { dg-warning "may cause truncation of value" } */
> + *pld = fabs (*pld); /* { dg-warning "may cause truncation of value" "fabs trunc" { target { large_long_double } } } */
> *pld = fabs ((double) *pld);
> }
>
> @@ -57,7 +57,7 @@ void tst_notcomplex (int *pi, long *pl, long double *pld)
> void tst_cplx_size (complex double *pcd, complex long double *pcld)
> {
> *pcd = cabsf (*pcd); /* { dg-warning "may cause truncation of value" } */
> - *pcld = cabs (*pcld); /* { dg-warning "may cause truncation of value" } */
> + *pcld = cabs (*pcld); /* { /* { dg-warning "may cause truncation of value" "cabs trunc" { target {
OK for me, except that you have an extra '/*' in the line above.
Christophe
> large_long_double } } } */
> *pcld = cabs ((complex double) *pcld);
> }
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR 87339, testsuite] Fix failure of gcc.dg/warn-abs-1.c on some targets
2018-10-10 12:44 ` Christophe Lyon
@ 2018-10-10 13:37 ` Martin Jambor
2018-10-10 14:02 ` Christophe Lyon
2018-10-10 18:07 ` Jeff Law
0 siblings, 2 replies; 15+ messages in thread
From: Martin Jambor @ 2018-10-10 13:37 UTC (permalink / raw)
To: Christophe Lyon, Joseph Myers; +Cc: Christophe Lyon, gcc Patches, Mike Stump
Hi,
On Wed, Oct 10 2018, Christophe Lyon wrote:
> On 10/10/2018 13:17, Martin Jambor wrote:
>> Hi,
>>
>> On Wed, Sep 26 2018, Joseph Myers wrote:
>>> On Wed, 26 Sep 2018, Martin Jambor wrote:
>>>
>>>> I see, I guess the easiest is to skip the test on targets that do not
>>>> really have long double, although if someone thinks that is too
>>>> restrictive, I can also split the test again and move long double bits
>>>> to a separate test.
>>> You should be able to use
>>>
>>> { dg-warning "warning regex" "test name" { target { large_long_double } } }
>>>
>>> to make the expectation of a warning conditional without making the whole
>>> test conditional.
>> I hoped that Christophe would try this out because I do not have an easy
>> access to a problematic architecture, but I can at least confirm that
>> the following still passes on x86_64-linux (and should also pass on
>> archs without long double, if I understood Joseph well).
>
> I did: https://gcc.gnu.org/ml/gcc-patches/2018-09/msg01713.html
> Sorry if I wasn't explicit enough
Oh, sorry, I somehow completely missed that. Thanks for testing then.
>> @@ -57,7 +57,7 @@ void tst_notcomplex (int *pi, long *pl, long double *pld)
>> void tst_cplx_size (complex double *pcd, complex long double *pcld)
>> {
>> *pcd = cabsf (*pcd); /* { dg-warning "may cause truncation of value" } */
>> - *pcld = cabs (*pcld); /* { dg-warning "may cause truncation of value" } */
>> + *pcld = cabs (*pcld); /* { /* { dg-warning "may cause truncation of value" "cabs trunc" { target {
>
> OK for me, except that you have an extra '/*' in the line above.
>
Silly me, the fixed patch is below. OK for trunk?
Martin
2018-10-10 Martin Jambor <mjambor@suse.cz>
testsuite/
* gcc.dg/warn-abs-1.c: Guard tests assuming size of long double is
greater that the size of double by target large_long double.
---
gcc/testsuite/gcc.dg/warn-abs-1.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/testsuite/gcc.dg/warn-abs-1.c b/gcc/testsuite/gcc.dg/warn-abs-1.c
index 1c487270042..c016ff620c4 100644
--- a/gcc/testsuite/gcc.dg/warn-abs-1.c
+++ b/gcc/testsuite/gcc.dg/warn-abs-1.c
@@ -43,7 +43,7 @@ void
tst_float_size (double *pd, long double *pld)
{
*pd = fabsf (*pd); /* { dg-warning "may cause truncation of value" } */
- *pld = fabs (*pld); /* { dg-warning "may cause truncation of value" } */
+ *pld = fabs (*pld); /* { dg-warning "may cause truncation of value" "fabs trunc" { target { large_long_double } } } */
*pld = fabs ((double) *pld);
}
@@ -57,7 +57,7 @@ void tst_notcomplex (int *pi, long *pl, long double *pld)
void tst_cplx_size (complex double *pcd, complex long double *pcld)
{
*pcd = cabsf (*pcd); /* { dg-warning "may cause truncation of value" } */
- *pcld = cabs (*pcld); /* { dg-warning "may cause truncation of value" } */
+ *pcld = cabs (*pcld); /* { dg-warning "may cause truncation of value" "cabs trunc" { target { large_long_double } } } */
*pcld = cabs ((complex double) *pcld);
}
--
2.19.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR 87339, testsuite] Fix failure of gcc.dg/warn-abs-1.c on some targets
2018-10-10 13:37 ` Martin Jambor
@ 2018-10-10 14:02 ` Christophe Lyon
2018-10-10 18:07 ` Jeff Law
1 sibling, 0 replies; 15+ messages in thread
From: Christophe Lyon @ 2018-10-10 14:02 UTC (permalink / raw)
To: Martin Jambor
Cc: christophe lyon St, Joseph S. Myers, gcc Patches, Mike Stump
On Wed, 10 Oct 2018 at 14:35, Martin Jambor <mjambor@suse.cz> wrote:
>
> Hi,
>
> On Wed, Oct 10 2018, Christophe Lyon wrote:
> > On 10/10/2018 13:17, Martin Jambor wrote:
> >> Hi,
> >>
> >> On Wed, Sep 26 2018, Joseph Myers wrote:
> >>> On Wed, 26 Sep 2018, Martin Jambor wrote:
> >>>
> >>>> I see, I guess the easiest is to skip the test on targets that do not
> >>>> really have long double, although if someone thinks that is too
> >>>> restrictive, I can also split the test again and move long double bits
> >>>> to a separate test.
> >>> You should be able to use
> >>>
> >>> { dg-warning "warning regex" "test name" { target { large_long_double } } }
> >>>
> >>> to make the expectation of a warning conditional without making the whole
> >>> test conditional.
> >> I hoped that Christophe would try this out because I do not have an easy
> >> access to a problematic architecture, but I can at least confirm that
> >> the following still passes on x86_64-linux (and should also pass on
> >> archs without long double, if I understood Joseph well).
> >
> > I did: https://gcc.gnu.org/ml/gcc-patches/2018-09/msg01713.html
> > Sorry if I wasn't explicit enough
>
> Oh, sorry, I somehow completely missed that. Thanks for testing then.
>
> >> @@ -57,7 +57,7 @@ void tst_notcomplex (int *pi, long *pl, long double *pld)
> >> void tst_cplx_size (complex double *pcd, complex long double *pcld)
> >> {
> >> *pcd = cabsf (*pcd); /* { dg-warning "may cause truncation of value" } */
> >> - *pcld = cabs (*pcld); /* { dg-warning "may cause truncation of value" } */
> >> + *pcld = cabs (*pcld); /* { /* { dg-warning "may cause truncation of value" "cabs trunc" { target {
> >
> > OK for me, except that you have an extra '/*' in the line above.
> >
>
> Silly me, the fixed patch is below. OK for trunk?
>
OK for me.
> Martin
>
>
> 2018-10-10 Martin Jambor <mjambor@suse.cz>
>
> testsuite/
> * gcc.dg/warn-abs-1.c: Guard tests assuming size of long double is
> greater that the size of double by target large_long double.
> ---
> gcc/testsuite/gcc.dg/warn-abs-1.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/testsuite/gcc.dg/warn-abs-1.c b/gcc/testsuite/gcc.dg/warn-abs-1.c
> index 1c487270042..c016ff620c4 100644
> --- a/gcc/testsuite/gcc.dg/warn-abs-1.c
> +++ b/gcc/testsuite/gcc.dg/warn-abs-1.c
> @@ -43,7 +43,7 @@ void
> tst_float_size (double *pd, long double *pld)
> {
> *pd = fabsf (*pd); /* { dg-warning "may cause truncation of value" } */
> - *pld = fabs (*pld); /* { dg-warning "may cause truncation of value" } */
> + *pld = fabs (*pld); /* { dg-warning "may cause truncation of value" "fabs trunc" { target { large_long_double } } } */
> *pld = fabs ((double) *pld);
> }
>
> @@ -57,7 +57,7 @@ void tst_notcomplex (int *pi, long *pl, long double *pld)
> void tst_cplx_size (complex double *pcd, complex long double *pcld)
> {
> *pcd = cabsf (*pcd); /* { dg-warning "may cause truncation of value" } */
> - *pcld = cabs (*pcld); /* { dg-warning "may cause truncation of value" } */
> + *pcld = cabs (*pcld); /* { dg-warning "may cause truncation of value" "cabs trunc" { target { large_long_double } } } */
> *pcld = cabs ((complex double) *pcld);
> }
>
> --
> 2.19.0
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR 87339, testsuite] Fix failure of gcc.dg/warn-abs-1.c on some targets
2018-10-10 13:37 ` Martin Jambor
2018-10-10 14:02 ` Christophe Lyon
@ 2018-10-10 18:07 ` Jeff Law
1 sibling, 0 replies; 15+ messages in thread
From: Jeff Law @ 2018-10-10 18:07 UTC (permalink / raw)
To: Martin Jambor, Christophe Lyon, Joseph Myers
Cc: Christophe Lyon, gcc Patches, Mike Stump
On 10/10/18 6:35 AM, Martin Jambor wrote:
> Hi,
>
> On Wed, Oct 10 2018, Christophe Lyon wrote:
>> On 10/10/2018 13:17, Martin Jambor wrote:
>>> Hi,
>>>
>>> On Wed, Sep 26 2018, Joseph Myers wrote:
>>>> On Wed, 26 Sep 2018, Martin Jambor wrote:
>>>>
>>>>> I see, I guess the easiest is to skip the test on targets that do not
>>>>> really have long double, although if someone thinks that is too
>>>>> restrictive, I can also split the test again and move long double bits
>>>>> to a separate test.
>>>> You should be able to use
>>>>
>>>> { dg-warning "warning regex" "test name" { target { large_long_double } } }
>>>>
>>>> to make the expectation of a warning conditional without making the whole
>>>> test conditional.
>>> I hoped that Christophe would try this out because I do not have an easy
>>> access to a problematic architecture, but I can at least confirm that
>>> the following still passes on x86_64-linux (and should also pass on
>>> archs without long double, if I understood Joseph well).
>>
>> I did: https://gcc.gnu.org/ml/gcc-patches/2018-09/msg01713.html
>> Sorry if I wasn't explicit enough
>
> Oh, sorry, I somehow completely missed that. Thanks for testing then.
>
>>> @@ -57,7 +57,7 @@ void tst_notcomplex (int *pi, long *pl, long double *pld)
>>> void tst_cplx_size (complex double *pcd, complex long double *pcld)
>>> {
>>> *pcd = cabsf (*pcd); /* { dg-warning "may cause truncation of value" } */
>>> - *pcld = cabs (*pcld); /* { dg-warning "may cause truncation of value" } */
>>> + *pcld = cabs (*pcld); /* { /* { dg-warning "may cause truncation of value" "cabs trunc" { target {
>>
>> OK for me, except that you have an extra '/*' in the line above.
>>
>
> Silly me, the fixed patch is below. OK for trunk?
>
> Martin
>
>
> 2018-10-10 Martin Jambor <mjambor@suse.cz>
>
> testsuite/
> * gcc.dg/warn-abs-1.c: Guard tests assuming size of long double is
> greater that the size of double by target large_long double.
OK
jeff
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2018-10-10 17:56 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-24 19:09 [PR 87339, testsuite] Fix failure of gcc.dg/warn-abs-1.c on some targets Martin Jambor
2018-09-24 19:19 ` Mike Stump
2018-09-24 21:46 ` Christophe Lyon
2018-09-25 15:53 ` Martin Jambor
2018-09-26 15:06 ` Christophe Lyon
2018-09-26 15:30 ` Martin Jambor
2018-09-26 17:12 ` Joseph Myers
2018-10-10 11:19 ` Martin Jambor
2018-10-10 12:44 ` Christophe Lyon
2018-10-10 13:37 ` Martin Jambor
2018-10-10 14:02 ` Christophe Lyon
2018-10-10 18:07 ` Jeff Law
2018-09-27 18:57 ` Christophe Lyon
2018-09-28 9:11 ` Christophe Lyon
2018-09-25 18:26 ` Jeff Law
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).