Patchwork [testsuite] gcc.target/arm/div64-unwinding.c: xfail for linux

login
register
mail settings
Submitter Janis Johnson
Date Sept. 27, 2012, 12:02 a.m.
Message ID <5063977A.1060704@mentor.com>
Download mbox | patch
Permalink /patch/187248/
State New
Headers show

Comments

Janis Johnson - Sept. 27, 2012, 12:02 a.m.
Test gcc.target/arm/div64-unwinding.c is known to fail for GNU/Linux 
targets, as described in PR54732.  This patch adds an XFAIL.

Tested on arm-none-eabi and arm-none-linux-gnueabi, checked in on trunk.

Janis
2012-09-26  Janis Johnson  <janisjo@codesourcery.com>

	* gcc.target/arm/div64-unwinding.c: XFAIL for GNU/Linux.
Richard Earnshaw - Oct. 9, 2012, 2:39 p.m.
On 27/09/12 01:02, Janis Johnson wrote:
> Test gcc.target/arm/div64-unwinding.c is known to fail for GNU/Linux
> targets, as described in PR54732.  This patch adds an XFAIL.
>
> Tested on arm-none-eabi and arm-none-linux-gnueabi, checked in on trunk.
>
> Janis
>
>
> gcc-20120926-5
>
>
> 2012-09-26  Janis Johnson  <janisjo@codesourcery.com>
>
> 	* gcc.target/arm/div64-unwinding.c: XFAIL for GNU/Linux.
>
> Index: gcc.target/arm/div64-unwinding.c
> ===================================================================
> --- gcc.target/arm/div64-unwinding.c	(revision 191765)
> +++ gcc.target/arm/div64-unwinding.c	(working copy)
> @@ -1,6 +1,7 @@
>   /* Performing a 64-bit division should not pull in the unwinder.  */
>
> -/* { dg-do run } */
> +/* The test is expected to fail for GNU/Linux; see PR54723.  */
> +/* { dg-do run { xfail *-*-linux* } } */
>   /* { dg-options "-O0" } */
>
>   #include <stdlib.h>
>

I don't like this.  To me, XFAIL means "there's a bug here, but we're 
not too worried about it".  The behaviour on linux targets is correct, 
so this test should either PASS or be skipped.

R.
Janis Johnson - Oct. 10, 2012, 2:11 a.m.
On 10/09/2012 07:39 AM, Richard Earnshaw wrote:
> On 27/09/12 01:02, Janis Johnson wrote:
>> Test gcc.target/arm/div64-unwinding.c is known to fail for GNU/Linux
>> targets, as described in PR54732.  This patch adds an XFAIL.
>>
>> Tested on arm-none-eabi and arm-none-linux-gnueabi, checked in on trunk.
>>
>> Janis
>>
>>
>> gcc-20120926-5
>>
>>
>> 2012-09-26  Janis Johnson  <janisjo@codesourcery.com>
>>
>> 	* gcc.target/arm/div64-unwinding.c: XFAIL for GNU/Linux.
>>
>> Index: gcc.target/arm/div64-unwinding.c
>> ===================================================================
>> --- gcc.target/arm/div64-unwinding.c	(revision 191765)
>> +++ gcc.target/arm/div64-unwinding.c	(working copy)
>> @@ -1,6 +1,7 @@
>>   /* Performing a 64-bit division should not pull in the unwinder.  */
>>
>> -/* { dg-do run } */
>> +/* The test is expected to fail for GNU/Linux; see PR54723.  */
>> +/* { dg-do run { xfail *-*-linux* } } */
>>   /* { dg-options "-O0" } */
>>
>>   #include <stdlib.h>
>>
> 
> I don't like this.  To me, XFAIL means "there's a bug here, but we're 
> not too worried about it".  The behaviour on linux targets is correct, 
> so this test should either PASS or be skipped.

Richard,

The impression I got from Julian is "there's a bug here, but we're not
too worried about it".  If you think it should be skipped instead then
I'll gladly change the test.

Janis
Richard Earnshaw - Oct. 10, 2012, 9:57 a.m.
On 10/10/12 03:11, Janis Johnson wrote:
> On 10/09/2012 07:39 AM, Richard Earnshaw wrote:
>> On 27/09/12 01:02, Janis Johnson wrote:
>>> Test gcc.target/arm/div64-unwinding.c is known to fail for GNU/Linux
>>> targets, as described in PR54732.  This patch adds an XFAIL.
>>>
>>> Tested on arm-none-eabi and arm-none-linux-gnueabi, checked in on trunk.
>>>
>>> Janis
>>>
>>>
>>> gcc-20120926-5
>>>
>>>
>>> 2012-09-26  Janis Johnson  <janisjo@codesourcery.com>
>>>
>>> 	* gcc.target/arm/div64-unwinding.c: XFAIL for GNU/Linux.
>>>
>>> Index: gcc.target/arm/div64-unwinding.c
>>> ===================================================================
>>> --- gcc.target/arm/div64-unwinding.c	(revision 191765)
>>> +++ gcc.target/arm/div64-unwinding.c	(working copy)
>>> @@ -1,6 +1,7 @@
>>>    /* Performing a 64-bit division should not pull in the unwinder.  */
>>>
>>> -/* { dg-do run } */
>>> +/* The test is expected to fail for GNU/Linux; see PR54723.  */
>>> +/* { dg-do run { xfail *-*-linux* } } */
>>>    /* { dg-options "-O0" } */
>>>
>>>    #include <stdlib.h>
>>>
>>
>> I don't like this.  To me, XFAIL means "there's a bug here, but we're
>> not too worried about it".  The behaviour on linux targets is correct,
>> so this test should either PASS or be skipped.
>
> Richard,
>
> The impression I got from Julian is "there's a bug here, but we're not
> too worried about it".  If you think it should be skipped instead then
> I'll gladly change the test.
>
> Janis
>
>

I don't believe there's a bug here.   The ARM EABI defines __aeabi_idiv0 
as a hook that will be called if division by zero occurs.  While the 
default implementation simply raises SIGFPE on linux, it is perfectly 
possible to provide your own definition of this hook and then throw() a 
C++ exception.  In order to do that you'd need unwind information in the 
divdi implementation ([u]divsi tailcalls the hook).

Technically you could argue the same for bare metal, but in that case 
the arguments against the code bloat outweigh this very small corner 
case and users wanting this will have to rebuild their support code.

On linux, I think the presence of the unwind information is correct, 
since the code bloat problem is very much a secondary concern.

So yes, please could you make the test be skipped on linux.

R.
Michael Hope - Oct. 14, 2012, 10:36 p.m.
On 10 October 2012 22:57, Richard Earnshaw <rearnsha@arm.com> wrote:
> On 10/10/12 03:11, Janis Johnson wrote:
>>
>> On 10/09/2012 07:39 AM, Richard Earnshaw wrote:
>>>
>>> On 27/09/12 01:02, Janis Johnson wrote:
>>>>
>>>> Test gcc.target/arm/div64-unwinding.c is known to fail for GNU/Linux
>>>> targets, as described in PR54732.  This patch adds an XFAIL.
>>>>
>>>> Tested on arm-none-eabi and arm-none-linux-gnueabi, checked in on trunk.
>>>>
>>>> Janis
>>>>
>>>>
>>>> gcc-20120926-5
>>>>
>>>>
>>>> 2012-09-26  Janis Johnson  <janisjo@codesourcery.com>
>>>>
>>>>         * gcc.target/arm/div64-unwinding.c: XFAIL for GNU/Linux.
>>>>
>>>> Index: gcc.target/arm/div64-unwinding.c
>>>> ===================================================================
>>>> --- gcc.target/arm/div64-unwinding.c    (revision 191765)
>>>> +++ gcc.target/arm/div64-unwinding.c    (working copy)
>>>> @@ -1,6 +1,7 @@
>>>>    /* Performing a 64-bit division should not pull in the unwinder.  */
>>>>
>>>> -/* { dg-do run } */
>>>> +/* The test is expected to fail for GNU/Linux; see PR54723.  */
>>>> +/* { dg-do run { xfail *-*-linux* } } */
>>>>    /* { dg-options "-O0" } */
>>>>
>>>>    #include <stdlib.h>
>>>>
>>>
>>> I don't like this.  To me, XFAIL means "there's a bug here, but we're
>>> not too worried about it".  The behaviour on linux targets is correct,
>>> so this test should either PASS or be skipped.
>>
>>
>> Richard,
>>
>> The impression I got from Julian is "there's a bug here, but we're not
>> too worried about it".  If you think it should be skipped instead then
>> I'll gladly change the test.
>>
>> Janis
>>
>>
>
> I don't believe there's a bug here.   The ARM EABI defines __aeabi_idiv0 as
> a hook that will be called if division by zero occurs.  While the default
> implementation simply raises SIGFPE on linux, it is perfectly possible to
> provide your own definition of this hook and then throw() a C++ exception.
> In order to do that you'd need unwind information in the divdi
> implementation ([u]divsi tailcalls the hook).
>
> Technically you could argue the same for bare metal, but in that case the
> arguments against the code bloat outweigh this very small corner case and
> users wanting this will have to rebuild their support code.
>
> On linux, I think the presence of the unwind information is correct, since
> the code bloat problem is very much a secondary concern.
>
> So yes, please could you make the test be skipped on linux.

Julian's patch turns off the unwinding information for all ARM systems
including Linux.  The test currently fails as something else (glibc?)
ends up pulling in the unwinder.

-- Michael

Patch

Index: gcc.target/arm/div64-unwinding.c
===================================================================
--- gcc.target/arm/div64-unwinding.c	(revision 191765)
+++ gcc.target/arm/div64-unwinding.c	(working copy)
@@ -1,6 +1,7 @@ 
 /* Performing a 64-bit division should not pull in the unwinder.  */
 
-/* { dg-do run } */
+/* The test is expected to fail for GNU/Linux; see PR54723.  */
+/* { dg-do run { xfail *-*-linux* } } */
 /* { dg-options "-O0" } */
 
 #include <stdlib.h>