1 /* With -fnon-call-exceptions 0 / 0 should not be eliminated. The .x
2 file sets the option. */
6 #elif defined (__powerpc__) || defined (__PPC__) || defined (__ppc__) || defined (__POWERPC__) || defined (__ppc)
7 /* On PPC division by zero does not trap. */
9 #elif defined (__SPU__)
10 /* On SPU division by zero does not trap. */
12 #elif defined (__sh__)
13 /* On SH division by zero does not trap. */
15 #elif defined (__TMS320C6X__)
16 /* On TI C6X division by zero does not trap. */
18 #elif defined (__arm__)
19 /* We cannot rely on division by zero generating a trap. */
21 #elif defined (__mips__) && !defined(__linux__)
22 /* MIPS divisions do trap by default, but libgloss targets do not
23 intercept the trap and raise a SIGFPE. The same is probably
24 true of other bare-metal environments, so restrict the test to
25 systems that use the Linux kernel. */
27 #elif defined (__mips16) && defined(__linux__)
28 /* Not all Linux kernels deal correctly the breakpoints generated by
29 MIPS16 divisions by zero. They show up as a SIGTRAP instead. */
31 #elif defined (__epiphany__)
32 /* Epiphany does not have hardware division, and the software implementation
33 has truly undefined behaviour for division by 0. */
44 sigfpe (int signum __attribute__ ((unused)))
51 /* When optimizing, the compiler is smart enough to constant fold the
52 static unset variables i and j to produce 0 / 0, but it can't
53 eliminate the assignment to the global k. */
62 signal (SIGFPE, sigfpe);