https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109374

--- Comment #5 from John David Anglin <danglin at gcc dot gnu.org> ---
I'm not sure what is expected here:

(gdb) r
Starting program: /home/dave/gnu/gcc/objdir/gcc/testsuite/gnat/div_zero.exe
warning: Unable to find libthread_db matching inferior's thread library, thread
debugging will not be available.

Program received signal SIGFPE, Arithmetic exception.
$$divoI () at ../../../gcc/libgcc/config/pa/milli64.S:448
448             addit,= 0,arg1,r0       /*  trap if divisor == 0 */
(gdb) c
Continuing.

Breakpoint 1, __gnat_error_handler (sig=8, si=0xf8f02488, ucontext=0xf8f02508)
at init.c:538
538          now, before we possibly trigger a recursive fault below.  */
(gdb) p/x ((ucontext_t *) ucontext)->uc_mcontext.sc_iaoq[0]
$2 = 0x1d1bf
(gdb) bt
#0  __gnat_error_handler (sig=8, si=0xf8f02488, ucontext=0xf8f02508) at
init.c:538
#1  <signal handler called>
#2  $$divoI () at ../../../gcc/libgcc/config/pa/milli64.S:448
#3  0x0001a124 in div_zero ()
(gdb) frame 2
#2  $$divoI () at ../../../gcc/libgcc/config/pa/milli64.S:448
448             addit,= 0,arg1,r0       /*  trap if divisor == 0 */
(gdb) disass $pc-16,$pc+16
Dump of assembler code from 0x1d1ac to 0x1d1cc:
   0x0001d1ac <$$divoI+428>:    bv,n r0(r31)
   0x0001d1b0 <$$divoI+432>:    nop
   0x0001d1b4 <$$divoI+436>:    blr,n r25,r0
   0x0001d1b8 <$$divoI+440>:    nop
=> 0x0001d1bc <$$divoI+444>:    addi,tc,= 0,r25,r0
   0x0001d1c0 <$$divoI+448>:    nop
   0x0001d1c4 <$$divoI+452>:    bv r0(r31)
   0x0001d1c8 <$$divoI+456>:    copy r26,ret1
End of assembler dump.
(gdb) frame 0
#0  __gnat_error_handler (sig=8, si=0xf8f02488, ucontext=0xf8f02508) at
init.c:538
538          now, before we possibly trigger a recursive fault below.  */
(gdb) ptype ((ucontext_t *) ucontext)->uc_mcontext.sc_iaoq[0]
type = unsigned long

As things stands, the pc (head iaoq value) points at the nop after the
addi,tc,= which caused the trap.

As far as I can tell, this test has always failed on both 32-bit linux and
hpux.

Reply via email to