NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain/52660 (gcc on sparc crashes when optimizing)



The following reply was made to PR toolchain/52660; it has been noted by GNATS.

From: Valery Ushakov <uwe%stderr.spb.ru@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: toolchain/52660 (gcc on sparc crashes when optimizing)
Date: Thu, 21 Jun 2018 19:08:59 +0300

 On Wed, Jun 20, 2018 at 22:45:01 +0000, Michael wrote:
 
 >  Program received signal SIGFPE, Arithmetic exception.
 >  0xedd059b0 in __divdi3 () from /usr/lib/libgcc_s.so.1
 >  (gdb) bt
 >  #0  0xedd059b0 in __divdi3 () from /usr/lib/libgcc_s.so.1
 >  #1  0x003d2cf0 in sreal::operator/(sreal const&) const ()
 >  #2  0x00263e4c in estimate_bb_frequencies(bool) ()
 >  #3  0x00265ea0 in tree_estimate_probability() ()
 >  #4  0x0026698c in ?? ()
 >  Backtrace stopped: previous frame identical to this frame (corrupt stack?)
 >  (gdb) disassemble __divdi3
 >  Dump of assembler code for function __divdi3:
 >  ...
 >     0xedd059a8 <+336>:   nop 
 >     0xedd059ac <+340>:   udiv  %g1, 0, %g2
 >  => 0xedd059b0 <+344>:   clr  %g1
 >     0xedd059b4 <+348>:   wr  %g1, %y
 >     0xedd059b8 <+352>:   nop 
 >  ... err, what?
 >  Ok, my userland was built with -mcpu=hypersparc, so udiv is allowed.
 >  But that's an explicit division by 0 if I read that correctly.
 >  How on earth did it get there?
 
 In __udivmoddi4 (always inlined):
 
 	  if (d0 == 0)
 	    d0 = 1 / d0;	/* Divide intentionally by zero.  */
 
 -uwe
 


Home | Main Index | Thread Index | Old Index