Module Name:    src
Committed By:   kalvisd
Date:           Mon Sep 30 00:35:49 UTC 2024

Modified Files:
        src/sys/arch/vax/boot/boot: boot.c

Log Message:
vax/boot: loadpcs: Silence GCC12 -Warray-bounds for 0-th page accesss

    as done for evbppc:
    
http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/src/sys/arch/evbppc/wii/mainbus.c#rev1.4

    (from rin@)
    OK rin@


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/vax/boot/boot/boot.c

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

Modified files:

Index: src/sys/arch/vax/boot/boot/boot.c
diff -u src/sys/arch/vax/boot/boot/boot.c:1.34 src/sys/arch/vax/boot/boot/boot.c:1.35
--- src/sys/arch/vax/boot/boot/boot.c:1.34	Sat Jun 11 06:42:27 2016
+++ src/sys/arch/vax/boot/boot/boot.c	Mon Sep 30 00:35:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.34 2016/06/11 06:42:27 dholland Exp $ */
+/*	$NetBSD: boot.c,v 1.35 2024/09/30 00:35:49 kalvisd Exp $ */
 /*-
  * Copyright (c) 1982, 1986 The Regents of the University of California.
  * All rights reserved.
@@ -317,6 +317,14 @@ loadpcs(void)
 	 * Load PCS microcode 20 bits at a time.
 	 */
 	ip = (int *)PCS_PCSADDR;
+
+	/*
+	 * XXXGCC12
+	 * GCC2 blames pointer access to 0-th page, [0, 0xfff] as
+	 * -Warray-bounds. Just silence as it is harmless.
+	 */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
 	jp = (int *)1024;
 	for (i=j=0; j < PCS_MICRONUM * 4; i+=20, j++) {
 		extzv(i,*jp,*ip++,20);
@@ -326,6 +334,8 @@ loadpcs(void)
 	 * Enable PCS.
 	 */
 	i = *jp;		/* get 1st 20 bits of microcode again */
+#pragma GCC diagnostic pop
+
 	i &= 0xfffff;
 	i |= PCS_ENABLE;	/* reload these bits with PCS enable set */
 	*((int *)PCS_PCSADDR) = i;

Reply via email to