Message ID | 528A5621.3050602@codesourcery.com |
---|---|
State | New |
Headers | show |
On 11/18/13 11:02, Cesar Philippidis wrote: > On 11/18/13, 10:01 AM, Andrew Pinski wrote: >> On Mon, Nov 18, 2013 at 9:58 AM, Cesar Philippidis >> <cesar@codesourcery.com> wrote: >>> This patch addresses the failures caused by the >>> gcc.c-torture/execute/20101011-1.c test on aarch64. The reason why this >>> test fails is because aarch64 does not trap on integer division by zero. >>> >>> Is this OK for trunk? If so, please commit it because I do not have an >>> svn account. >> >> ENOPATCH > > Sorry about that. I attached the patch this time. Is there any reference you can point at which states that division by zero does not trap? There's clearly some confusion here since the old code claimed that the trap occurs, but that it might not raise a SIGFPE on some systems. Or if one of the aarch64 maintainers could chime in, that'd be helpful too. jeff
On 18 November 2013 18:02, Cesar Philippidis <cesar@codesourcery.com> wrote: >>> gcc.c-torture/execute/20101011-1.c test on aarch64. The reason why this >>> test fails is because aarch64 does not trap on integer division by zero. >>> >>> Is this OK for trunk? If so, please commit it because I do not have an >>> svn account. This is OK. The comment Jeff highlighted is incorrect. AArch64 does not trap on integer division. To get integer trap on divide by zero behavior we would have to go the mips route and add -mdivide-traps to explicitly check and generate a brk #XXX instruction. /Marcus
On 11/19/13, 1:37 AM, Marcus Shawcroft wrote: > On 18 November 2013 18:02, Cesar Philippidis <cesar@codesourcery.com> wrote: > >>>> gcc.c-torture/execute/20101011-1.c test on aarch64. The reason why this >>>> test fails is because aarch64 does not trap on integer division by zero. >>>> >>>> Is this OK for trunk? If so, please commit it because I do not have an >>>> svn account. > > This is OK. > > The comment Jeff highlighted is incorrect. AArch64 does not trap on > integer division. > > To get integer trap on divide by zero behavior we would have to go the > mips route and add -mdivide-traps to explicitly check and generate a > brk #XXX instruction. Can someone please commit it for me? Thanks, Cesar
On 19 November 2013 15:29, Cesar Philippidis <cesar@codesourcery.com> wrote: > Can someone please commit it for me? > > Thanks, > Cesar Done, with CangeLog 2013-11-19 Cesar Philippidis <cesar@codesourcery.com> * gcc.c-torture/execute/20101011-1.c (__aarch64__): Remove defined(__linux__).
Index: gcc/testsuite/gcc.c-torture/execute/20101011-1.c =================================================================== --- gcc/testsuite/gcc.c-torture/execute/20101011-1.c (revision 204752) +++ gcc/testsuite/gcc.c-torture/execute/20101011-1.c (working copy) @@ -12,10 +12,9 @@ #elif defined (__sh__) /* On SH division by zero does not trap. */ # define DO_TEST 0 -#elif defined (__aarch64__) && !defined(__linux__) - /* AArch64 divisions do trap by default, but libgloss targets do not - intercept the trap and raise a SIGFPE. So restrict the test to - AArch64 systems that use the Linux kernel. */ +#elif defined (__aarch64__) + /* On AArch64 integer division by zero does not trap. */ +# define DO_TEST 0 #elif defined (__TMS320C6X__) /* On TI C6X division by zero does not trap. */ # define DO_TEST 0