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: Michael <>
Subject: Re: toolchain/52660 (gcc on sparc crashes when optimizing)
Date: Wed, 20 Jun 2018 18:41:39 -0400

 Here's what I get with a userland from a few days ago:
 /home/work/benchmarks/flops/work> gcc -DUNIX -O2 -wrapper gdb,--args -o flops flops.c -lm
 GNU gdb (GDB) 8.0.1
 Copyright (C) 2017 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later <>
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
 and "show warranty" for details.
 This GDB was configured as "sparc--netbsdelf".
 Type "show configuration" for configuration details.
 For bug reporting instructions, please see:
 Find the GDB manual and other documentation resources online at:
 For help, type "help".
 Type "apropos word" to search for commands related to "word"...
 Reading symbols from /usr/libexec/cc1...(no debugging symbols found)...done.
 (gdb) run
 Starting program: /usr/libexec/cc1 -quiet -D UNIX flops.c -quiet -dumpbase flops.c -mcpu=v7 -auxbase flops -O2 -o /var/tmp//ccbu0R7N.s
 flops.c: In function 'main':
 flops.c:226:4: warning: implicit declaration of function 'dtime' [-Wimplicit-function-declaration]
 flops.c:641:4: warning: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
 flops.c:641:4: warning: incompatible implicit declaration of built-in function 'exit'
 flops.c:641:4: note: include '<stdlib.h>' or provide a declaration of 'exit'
 flops.c: At top level:
 flops.c:719:1: warning: return type defaults to 'int' [-Wimplicit-int]
 Program received signal SIGFPE, Arithmetic exception.
 0xedd059b0 in __divdi3 () from /usr/lib/
 (gdb) bt
 #0  0xedd059b0 in __divdi3 () from /usr/lib/
 #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?
 have fun

Home | Main Index | Thread Index | Old Index