Source-Changes-HG archive

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

[src/trunk]: src PR port-alpha/54307



details:   https://anonhg.NetBSD.org/src/rev/32c99ab44f1d
branches:  trunk
changeset: 955677:32c99ab44f1d
user:      rin <rin%NetBSD.org@localhost>
date:      Wed Oct 07 07:35:28 2020 +0000

description:
PR port-alpha/54307

GCC 9.3 seems to be able to compile rtree.c with -O2:

- No new regressions in ATF.
- System survives over a night, at least, under heavy loads.

On the other hand, unfortunately, GCC 9.3 still miscompiles tcache.c
with -O2 or -O1. For example, even ``gcc -g hello.c'' fails with ICE
if tcache.c is compiled with -O[12] in libc.

diffstat:

 doc/HACKS                              |  10 ++++++----
 external/bsd/jemalloc/lib/Makefile.inc |   6 +++---
 2 files changed, 9 insertions(+), 7 deletions(-)

diffs (50 lines):

diff -r e993e3f563e5 -r 32c99ab44f1d doc/HACKS
--- a/doc/HACKS Wed Oct 07 07:31:47 2020 +0000
+++ b/doc/HACKS Wed Oct 07 07:35:28 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: HACKS,v 1.212 2020/10/05 13:32:31 rin Exp $
+# $NetBSD: HACKS,v 1.213 2020/10/07 07:35:28 rin Exp $
 #
 # This file is intended to document workarounds for currently unsolved
 # (mostly) compiler bugs.
@@ -951,12 +951,14 @@
 kcah
 
 port   alpha
-hack   GCC 7.4/8.3: userland binaries crash randomly (port-alpha/54307)
+hack   GCC 7.4/8.3/9.3: userland binaries crash randomly (port-alpha/54307)
 cdate  Fri Nov  1 20:43:35 UTC 2019
+mdate  Wed Oct  7 16:00:00 JST 2020
 who    rin
 file   src/external/bsd/jemalloc/lib/Makefile.inc: 1.11
-descr  rtree.c and tcache.c need to be compiled with -O0, alternatively,
-       you can compile whole jemalloc with -DJEMALLOC_DEBUG.
+descr  GCC miscompiles rtree.c (for 7.4 and 8.3) and tcache.c (for 7.4, 8.3,
+       and 9.3) with optimization levels -O[12]. Compile these files with -O0,
+       alternatively, compile whole jemalloc with -DJEMALLOC_DEBUG.
 kcah
 
 port   powerpc
diff -r e993e3f563e5 -r 32c99ab44f1d external/bsd/jemalloc/lib/Makefile.inc
--- a/external/bsd/jemalloc/lib/Makefile.inc    Wed Oct 07 07:31:47 2020 +0000
+++ b/external/bsd/jemalloc/lib/Makefile.inc    Wed Oct 07 07:35:28 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.11 2019/11/01 20:53:10 rin Exp $
+#      $NetBSD: Makefile.inc,v 1.12 2020/10/07 07:35:28 rin Exp $
 
 JEMALLOC:=${.PARSEDIR}/..
 
@@ -51,11 +51,11 @@
 COPTS.stats.c+=-Wno-error=stack-protector
 COPTS.tcache.c+=-Wno-error=stack-protector
 
-.if ${MACHINE} == "alpha"
+.if ${MACHINE} == "alpha" && ${ACTIVE_CC} == "gcc"
 # These files need to be compiled with -O0, or build everything with
 # -DJEMALLOC_DEBUG. Otherwise, userland binaries crash randomly, as
 # reported in port-alpha/54307.
-COPTS.rtree.c+=-O0
+COPTS.rtree.c+=        ${${HAVE_GCC:U0} < 9:? -O0 :}
 COPTS.tcache.c+=-O0
 .endif
 



Home | Main Index | Thread Index | Old Index