Module Name:    src
Committed By:   rin
Date:           Wed Apr 29 11:04:58 UTC 2020

Modified Files:
        src/external/gpl3/gdb/lib/libgdb: Makefile

Log Message:
PR toolchain/54820
PR toolchain/54877

GCC 8.4 miscompiles dwarf2expr.c with -O2 or -O1 for earmv7hf{,eb}, which
results in crashes described in the PRs. No upstream fixes up to now. So,
let us disable optimization for this file.

Note that this affects only earmv7hf{,eb} as far as I can see. Crashes do
not occur neither for earmv6hf{,eb} nor earmv7{,eb}.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/external/gpl3/gdb/lib/libgdb/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/lib/libgdb/Makefile
diff -u src/external/gpl3/gdb/lib/libgdb/Makefile:1.21 src/external/gpl3/gdb/lib/libgdb/Makefile:1.22
--- src/external/gpl3/gdb/lib/libgdb/Makefile:1.21	Fri Jul 12 22:45:07 2019
+++ src/external/gpl3/gdb/lib/libgdb/Makefile	Wed Apr 29 11:04:58 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.21 2019/07/12 22:45:07 christos Exp $
+#	$NetBSD: Makefile,v 1.22 2020/04/29 11:04:58 rin Exp $
 
 NOCTF=
 HOSTPROG_CXX=   1
@@ -58,6 +58,14 @@ ada-exp.c: ada-lex.c
 COPTS.dwarf2-frame.c+=-O1
 .endif
 
+.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
+.endif
+
 # These are generated by implicit rules and are not easy to generate
 CLEANDIRFILES+= \
 	ada-exp.c ada-lex.c \

Reply via email to