Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/ibm4xx Work around clang 13.0.0 bug; copy{i...



details:   https://anonhg.NetBSD.org/src/rev/9132077c756c
branches:  trunk
changeset: 370008:9132077c756c
user:      rin <rin%NetBSD.org@localhost>
date:      Mon Sep 12 08:06:36 2022 +0000

description:
Work around clang 13.0.0 bug; copy{in,out}() are miscompiled with -O[12],
by which /sbin/init cannot be executed.

diffstat:

 sys/arch/powerpc/ibm4xx/trap.c |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (58 lines):

diff -r 04344d9365ef -r 9132077c756c sys/arch/powerpc/ibm4xx/trap.c
--- a/sys/arch/powerpc/ibm4xx/trap.c    Mon Sep 12 08:02:44 2022 +0000
+++ b/sys/arch/powerpc/ibm4xx/trap.c    Mon Sep 12 08:06:36 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.98 2022/09/12 08:02:44 rin Exp $    */
+/*     $NetBSD: trap.c,v 1.99 2022/09/12 08:06:36 rin Exp $    */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -69,7 +69,7 @@
 #define        __UFETCHSTORE_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.98 2022/09/12 08:02:44 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.99 2022/09/12 08:06:36 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -427,6 +427,9 @@
 static int bigcopyin(const void *, void *, size_t );
 static int bigcopyout(const void *, void *, size_t );
 
+#ifdef __clang__
+#pragma clang optimize off
+#endif
 int
 copyin(const void *uaddr, void *kaddr, size_t len)
 {
@@ -509,6 +512,9 @@
        curpcb->pcb_onfault = NULL;
        return 0;
 }
+#ifdef __clang__
+#pragma clang optimize on
+#endif
 
 static int
 bigcopyin(const void *uaddr, void *kaddr, size_t len)
@@ -542,6 +548,9 @@
        return error;
 }
 
+#ifdef __clang__
+#pragma clang optimize off
+#endif
 int
 copyout(const void *kaddr, void *uaddr, size_t len)
 {
@@ -625,6 +634,9 @@
        curpcb->pcb_onfault = NULL;
        return 0;
 }
+#ifdef __clang__
+#pragma clang optimize on
+#endif
 
 static int
 bigcopyout(const void *kaddr, void *uaddr, size_t len)



Home | Main Index | Thread Index | Old Index