Source-Changes-HG archive

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

[src/trunk]: src GCC 9.3 miscompiles dwarf2{expr,loc}.c with -O2 for earmv5hf...



details:   https://anonhg.NetBSD.org/src/rev/30d04dcecd95
branches:  trunk
changeset: 955687:30d04dcecd95
user:      rin <rin%NetBSD.org@localhost>
date:      Thu Oct 08 08:31:37 2020 +0000

description:
GCC 9.3 miscompiles dwarf2{expr,loc}.c with -O2 for earmv5hf{,eb}
(-O1 is fine). This is a new regression introduced in GCC9.

For everyone's safety, extend -O0 hack to dwarf2{expr,loc}.c for
all arm variants with GCC >= 8.

diffstat:

 doc/HACKS                                 |  17 +++++++++--------
 external/gpl3/gdb.old/lib/libgdb/Makefile |  16 +++++++++-------
 2 files changed, 18 insertions(+), 15 deletions(-)

diffs (64 lines):

diff -r 6e717a3d38ba -r 30d04dcecd95 doc/HACKS
--- a/doc/HACKS Thu Oct 08 04:30:04 2020 +0000
+++ b/doc/HACKS Thu Oct 08 08:31:37 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: HACKS,v 1.213 2020/10/07 07:35:28 rin Exp $
+# $NetBSD: HACKS,v 1.214 2020/10/08 08:31:37 rin Exp $
 #
 # This file is intended to document workarounds for currently unsolved
 # (mostly) compiler bugs.
@@ -975,16 +975,17 @@
        function "__int64_t llvm::MachineFrameInfo::getObjectOffset(int) const"
 kcah
 
-port   earmv7hf*
-hack   compile gdb/dwarf2expr.c with -O0 for GCC[89] (toolchain/54820, 54877)
+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  Mon Oct  5 22:30:00 JST 2020
+mdate  Thu Oct  8 17:00:00 JST 2020
 who    rin
 file   src/external/gpl3/gdb/lib/libgdb/Makefile: 1.22
-descr  GCC 8.4 and 9.3 miscompile dwarf2expr.c with -O[21], which results in
-       crashes with 'gdb_exception_RETURN_MASK_ERROR'. Note that this occurs
-       only for earmv7hf{,eb} as far as I can see. Neither earmv6hf{,eb} nor
-       earmv7{,eb} (softfloat) are affected.
+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
diff -r 6e717a3d38ba -r 30d04dcecd95 external/gpl3/gdb.old/lib/libgdb/Makefile
--- a/external/gpl3/gdb.old/lib/libgdb/Makefile Thu Oct 08 04:30:04 2020 +0000
+++ b/external/gpl3/gdb.old/lib/libgdb/Makefile Thu Oct 08 08:31:37 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.10 2020/09/14 00:40:43 christos Exp $
+#      $NetBSD: Makefile,v 1.11 2020/10/08 08:31:37 rin Exp $
 
 NOCTF=
 HOSTPROG_CXX=   1
@@ -54,12 +54,14 @@
 
 ada-exp.c: ada-lex.c
 
-.if defined(HAVE_GCC) && ${HAVE_GCC} >= 8 && ${ACTIVE_CC} == "gcc"
-.if !empty(MACHINE_ARCH:Mearmv7hf*)
-# GCC 8.4 miscompiles this with -O2 or -O1 for earmv7hf{,eb}.
-# Neither earmv6hf{,eb} nor earmv7{,eb} are affected.
-COPTS.dwarf2expr.c+=-O0
-.endif
+.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



Home | Main Index | Thread Index | Old Index