PR toolchain/55837

Get rid of -O0 hack for GDB for hard-float arm. This was necessary because
libunwind did not support s0-s31. Note that for *most* cases (not all!),
-O0 stops using VFP registers for general purposes.

Also note that this hack was incomplete. We had to compile every functions
with -O0, that can be unwinded. Otherwise, GDB crashed every time exceptions
were raised.
This commit is contained in:
rin 2021-05-31 22:33:19 +00:00
parent 9a3318469d
commit c9540f6f13
3 changed files with 3 additions and 37 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: HACKS,v 1.217 2021/05/08 12:27:21 christos Exp $
# $NetBSD: HACKS,v 1.218 2021/05/31 22:33:19 rin Exp $
#
# This file is intended to document workarounds for currently unsolved
# (mostly) compiler bugs.
@ -975,19 +975,6 @@ descr Disable optimization on tc.c, logerr.c, ubsan.c crashes:
function "__int64_t llvm::MachineFrameInfo::getObjectOffset(int) const"
kcah
port arm
hack compile gdb/dwarf2{expr,loc}.c with -O0 for GCC[89] (PR/54820, 54877)
cdate Wed Apr 29 11:04:58 UTC 2020
mdate Thu Oct 8 17:00:00 JST 2020
who rin
file src/external/gpl3/gdb/lib/libgdb/Makefile: 1.22
descr For earmv7hf{,eb}, GCC 8.4 and 9.3 miscompile dwarf2expr.c with -O[21].
For earmv5hf{,eb}, GCC 9.3 miscompiles dwarf2{expr,loc}.c with -O2
(GCC9 -O1 and GCC8 -O2 work fine). These result in GDB crash with
``gdb_exception_RETURN_MASK_ERROR''. For everyone's safety, compile
these files with -O0 for all arm variants with GCC >= 8.
kcah
port m68k
hack compile aes_ccm_tag() with -O0 for GCC8 and GCC9
cdate Mon Aug 10 06:27:29 UTC 2020

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.12 2021/05/07 12:19:48 rin Exp $
# $NetBSD: Makefile,v 1.13 2021/05/31 22:33:19 rin Exp $
NOCTF=
HOSTPROG_CXX= 1
@ -54,16 +54,6 @@ CFLAGS:= ${CXXFLAGS} -std=gnu++11 -Wno-error=stack-protector
ada-exp.c: ada-lex.c
.if ${MACHINE_CPU} == "arm"
. if ${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8
# GCC 8.4/9.3 miscompile this with -O[21] for earmv7hf{,eb}.
# GCC 9.3 miscompile this with -O2 for earmv5hf{,eb}.
COPTS.dwarf2expr.c+= -O0
# GCC 9.3 miscompile this with -O2 for earmv5hf{,eb}.
COPTS.dwarf2loc.c+= -O0
. endif
.endif
# These are generated by implicit rules and are not easy to generate
CLEANDIRFILES+= \
ada-exp.c ada-lex.c \

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.30 2021/05/30 02:23:25 joerg Exp $
# $NetBSD: Makefile,v 1.31 2021/05/31 22:33:19 rin Exp $
NOCTF=
HOSTPROG_CXX= 1
@ -59,17 +59,6 @@ CFLAGS:= ${CXXFLAGS} -std=gnu++17 -Wno-error=stack-protector
ada-exp.c: ada-lex.c
.if ${MACHINE_CPU} == "arm"
. if ${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8
# XXX taken from GDB 8.3; not tested for GDB 11:
# GCC 8.4/9.3 miscompile this with -O[21] for earmv7hf{,eb}.
# GCC 9.3 miscompile this with -O2 for earmv5hf{,eb}.
COPTS.expr.c+= -O0
# GCC 9.3 miscompile this with -O2 for earmv5hf{,eb}.
COPTS.loc.c+= -O0
. endif
.endif
.if ${MACHINE} == "vax"
. if ${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8
COPTS.read.c+= -O0