CVS commit: src/external/gpl3/gcc/dist/gcc

2023-09-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep  3 18:47:45 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/gcc: ubsan.cc

Log Message:
remap generated ubsan filename string labels. fixes reproducible builds.
reported by wiz@


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/gcc/ubsan.cc

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/gcc/dist/gcc/ubsan.cc
diff -u src/external/gpl3/gcc/dist/gcc/ubsan.cc:1.1.1.1 src/external/gpl3/gcc/dist/gcc/ubsan.cc:1.2
--- src/external/gpl3/gcc/dist/gcc/ubsan.cc:1.1.1.1	Sun Jul 30 01:20:53 2023
+++ src/external/gpl3/gcc/dist/gcc/ubsan.cc	Sun Sep  3 14:47:45 2023
@@ -49,6 +49,7 @@ along with GCC; see the file COPYING3.  
 #include "tree-cfg.h"
 #include "gimple-fold.h"
 #include "varasm.h"
+#include "file-prefix-map.h"
 
 /* Map from a tree to a VAR_DECL tree.  */
 
@@ -304,8 +305,9 @@ ubsan_source_location (location_t loc)
   else
 {
   /* Fill in the values from LOC.  */
-  size_t len = strlen (xloc.file) + 1;
-  str = build_string (len, xloc.file);
+  const char *file = remap_debug_filename (xloc.file);
+  size_t len = strlen (file) + 1;
+  str = build_string (len, file);
   TREE_TYPE (str) = build_array_type_nelts (char_type_node, len);
   TREE_READONLY (str) = 1;
   TREE_STATIC (str) = 1;



CVS commit: src/external/gpl3/gcc/dist/gcc

2023-09-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep  3 18:47:45 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/gcc: ubsan.cc

Log Message:
remap generated ubsan filename string labels. fixes reproducible builds.
reported by wiz@


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/gcc/ubsan.cc

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config/vax

2023-08-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 03:08:15 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/vax: vax.cc

Log Message:
gcc/vax: XXX: Forcibly disable gas(1) directives for CFI table

Otherwise, wired relocation occur for readonly section `.eh_frame',
by which libc.so cannot link:


warning: dynamic relocation to `?' in readonly section `.eh_frame'
warning: creating DT_TEXTREL in a shared object
.eh_frame_hdr refers to overlapping FDEs
final link failed: bad value


This workaround has been introduced by vax.c, v1.15:

http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/gcc/dist/gcc/config/vax/Attic/vax.c#rev1.15

but accidentally lost during GCC 12.3.0 merge.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/gcc/config/vax/vax.cc

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config/vax

2023-08-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 03:08:15 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/vax: vax.cc

Log Message:
gcc/vax: XXX: Forcibly disable gas(1) directives for CFI table

Otherwise, wired relocation occur for readonly section `.eh_frame',
by which libc.so cannot link:


warning: dynamic relocation to `?' in readonly section `.eh_frame'
warning: creating DT_TEXTREL in a shared object
.eh_frame_hdr refers to overlapping FDEs
final link failed: bad value


This workaround has been introduced by vax.c, v1.15:

http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/gcc/dist/gcc/config/vax/Attic/vax.c#rev1.15

but accidentally lost during GCC 12.3.0 merge.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/gcc/config/vax/vax.cc

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/gcc/dist/gcc/config/vax/vax.cc
diff -u src/external/gpl3/gcc/dist/gcc/config/vax/vax.cc:1.1.1.1 src/external/gpl3/gcc/dist/gcc/config/vax/vax.cc:1.2
--- src/external/gpl3/gcc/dist/gcc/config/vax/vax.cc:1.1.1.1	Sun Jul 30 05:21:07 2023
+++ src/external/gpl3/gcc/dist/gcc/config/vax/vax.cc	Thu Aug 17 03:08:15 2023
@@ -152,6 +152,11 @@ vax_option_override (void)
   if (TARGET_G_FLOAT)
 REAL_MODE_FORMAT (DFmode) = _g_format;
 
+  /* XXX For NetBSD, disable gas(1) directives for CFI tables.
+ Otherwise, wired relocations occur for readonly section
+ `.eh_frame', by which libc.so cannot link.  */
+  flag_dwarf2_cfi_asm = 0;
+
 #ifdef SUBTARGET_OVERRIDE_OPTIONS
   SUBTARGET_OVERRIDE_OPTIONS;
 #endif



CVS commit: src/external/gpl3/gcc/dist/gcc/config/vax

2023-08-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 02:55:25 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/vax: netbsd-elf.h

Log Message:
gcc/vax: Restore NetBSD-specific extra specs, lost during merge


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gcc/dist/gcc/config/vax/netbsd-elf.h

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/gcc/dist/gcc/config/vax/netbsd-elf.h
diff -u src/external/gpl3/gcc/dist/gcc/config/vax/netbsd-elf.h:1.11 src/external/gpl3/gcc/dist/gcc/config/vax/netbsd-elf.h:1.12
--- src/external/gpl3/gcc/dist/gcc/config/vax/netbsd-elf.h:1.11	Thu Aug  3 01:36:54 2023
+++ src/external/gpl3/gcc/dist/gcc/config/vax/netbsd-elf.h	Thu Aug 17 02:55:25 2023
@@ -45,8 +45,9 @@ along with GCC; see the file COPYING3.  
 #undef LINK_SPEC
 #define LINK_SPEC NETBSD_LINK_SPEC_ELF
 
-#define EXTRA_SPECS\
-  { "netbsd_entry_point", NETBSD_ENTRY_POINT },
+#undef EXTRA_SPECS
+#define EXTRA_SPECS NETBSD_SUBTARGET_EXTRA_SPECS
+#undef SUBTARGET_EXTRA_SPECS
 
 #undef INTPTR_TYPE
 #define INTPTR_TYPE "long int"



CVS commit: src/external/gpl3/gcc/dist/gcc/config/vax

2023-08-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 17 02:55:25 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/vax: netbsd-elf.h

Log Message:
gcc/vax: Restore NetBSD-specific extra specs, lost during merge


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gcc/dist/gcc/config/vax/netbsd-elf.h

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config/vax

2023-08-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug  1 06:05:14 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/vax: vax.h

Log Message:
fix merge botch.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gcc/dist/gcc/config/vax/vax.h

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/gcc/dist/gcc/config/vax/vax.h
diff -u src/external/gpl3/gcc/dist/gcc/config/vax/vax.h:1.13 src/external/gpl3/gcc/dist/gcc/config/vax/vax.h:1.14
--- src/external/gpl3/gcc/dist/gcc/config/vax/vax.h:1.13	Sun Jul 30 05:51:30 2023
+++ src/external/gpl3/gcc/dist/gcc/config/vax/vax.h	Tue Aug  1 06:05:13 2023
@@ -350,10 +350,6 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_
 	RETURN_ADDRESS_OFFSET))		\
: (rtx) 0)
 
-/* A C expression that is nonzero if X is a legitimate immediate operand
-   on the target machine when generating position independent code.  */
-
-#define LEGITIMATE_PIC_OPERAND_P(X) legitimate_pic_operand_p (X)
 
 /* Addressing modes, and classification of registers for them.  */
 



CVS commit: src/external/gpl3/gcc/dist/gcc/config/vax

2023-08-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug  1 06:05:14 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/vax: vax.h

Log Message:
fix merge botch.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gcc/dist/gcc/config/vax/vax.h

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



CVS commit: src/external/gpl3/gcc/dist/gcc

2023-08-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug  1 06:04:42 UTC 2023

Added Files:
src/external/gpl3/gcc/dist/gcc: regsub.cc
Removed Files:
src/external/gpl3/gcc/dist/gcc: regsub.c

Log Message:
rename our local .c that is c++ to .cc like upstream has.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r0 src/external/gpl3/gcc/dist/gcc/regsub.c
cvs rdiff -u -r0 -r1.1 src/external/gpl3/gcc/dist/gcc/regsub.cc

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

Added files:

Index: src/external/gpl3/gcc/dist/gcc/regsub.cc
diff -u /dev/null src/external/gpl3/gcc/dist/gcc/regsub.cc:1.1
--- /dev/null	Tue Aug  1 06:04:42 2023
+++ src/external/gpl3/gcc/dist/gcc/regsub.cc	Tue Aug  1 06:04:42 2023
@@ -0,0 +1,164 @@
+/*	$NetBSD: regsub.cc,v 1.1 2023/08/01 06:04:42 mrg Exp $	*/
+
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+extern "C" {
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+struct str {
+	char *s_ptr;
+	size_t s_max;
+	size_t s_len;
+	int s_fixed;
+};
+
+#define	REINCR	64
+
+static int
+addspace(struct str *s, size_t len)
+{
+	void *v;
+
+	if (s->s_max - s->s_len > len)
+		return 0;
+
+	if (s->s_fixed)
+		return -1;
+
+	s->s_max += len + REINCR;
+
+	v = realloc(s->s_ptr, s->s_max);
+	if (v == NULL)
+		return -1;
+	s->s_ptr = (char *)v;
+
+	return 0;
+}
+
+static void
+addchar(struct str *s, int c)
+{
+	if (addspace(s, 1) == -1)
+		s->s_len++;
+	else
+		s->s_ptr[s->s_len++] = c;
+	if (c == 0) {
+		--s->s_len;
+		s->s_ptr[s->s_max - 1] = c;	
+	}
+}
+
+static void
+addnstr(struct str *s, const char *buf, size_t len)
+{
+	if (addspace(s, len) != -1)
+		memcpy(s->s_ptr + s->s_len, buf, len);
+	s->s_len += len;
+}
+
+static int
+initstr(struct str *s, char *buf, size_t len)
+{
+	s->s_max = len;
+	s->s_ptr = (char *)(buf == NULL ? malloc(len) : buf);
+	s->s_fixed = buf != NULL;
+	s->s_len = 0;
+	return s->s_ptr == NULL ? -1 : 0;
+}
+
+static ssize_t
+regsub1(char **buf, size_t len, const char *sub,
+const regmatch_t *rm, const char *str)
+{
+ssize_t i;
+char c; 
+	struct str s;
+
+	if (initstr(, *buf, len) == -1)
+		return -1;
+
+while ((c = *sub++) != '\0') {
+
+		switch (c) {
+		case '&':
+			i = 0;
+			break;
+		case '\\':
+			if (isdigit((unsigned char)*sub))
+i = *sub++ - '0';
+			else
+i = -1;
+			break;
+		default:
+			i = -1;
+			break;
+		}
+
+if (i == -1) {
+if (c == '\\' && (*sub == '\\' || *sub == '&'))
+c = *sub++;
+			addchar(, c);
+} else if (rm[i].rm_so != -1 && rm[i].rm_eo != -1) {
+size_t l = (size_t)(rm[i].rm_eo - rm[i].rm_so);
+			addnstr(, str + rm[i].rm_so, l);
+}
+}
+
+	addchar(, '\0');
+	if (!s.s_fixed) {
+		if (s.s_len >= s.s_max) {
+			free(s.s_ptr);
+			return -1;
+		}
+		*buf = s.s_ptr;
+	}
+	return s.s_len;
+}
+
+ssize_t
+regnsub(char *buf, size_t len, const char *sub, const regmatch_t *rm,
+const char *str)
+{
+	return regsub1(, len, sub, rm, str);
+}
+
+ssize_t
+regasub(char **buf, const char *sub, const regmatch_t *rm, const char *str)
+{
+	*buf = NULL;
+	return regsub1(buf, REINCR, sub, rm, str);
+}
+
+}



CVS commit: src/external/gpl3/gcc/dist/gcc

2023-08-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug  1 06:04:42 UTC 2023

Added Files:
src/external/gpl3/gcc/dist/gcc: regsub.cc
Removed Files:
src/external/gpl3/gcc/dist/gcc: regsub.c

Log Message:
rename our local .c that is c++ to .cc like upstream has.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r0 src/external/gpl3/gcc/dist/gcc/regsub.c
cvs rdiff -u -r0 -r1.1 src/external/gpl3/gcc/dist/gcc/regsub.cc

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config

2023-07-30 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jul 31 01:46:32 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/gcc/config: netbsd.h

Log Message:
compiler include dir is gcc-12 here.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/external/gpl3/gcc/dist/gcc/config/netbsd.h

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config

2023-07-30 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jul 31 01:46:32 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/gcc/config: netbsd.h

Log Message:
compiler include dir is gcc-12 here.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/external/gpl3/gcc/dist/gcc/config/netbsd.h

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/gcc/dist/gcc/config/netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/netbsd.h:1.39 src/external/gpl3/gcc/dist/gcc/config/netbsd.h:1.40
--- src/external/gpl3/gcc/dist/gcc/config/netbsd.h:1.39	Sun Jul 30 05:51:22 2023
+++ src/external/gpl3/gcc/dist/gcc/config/netbsd.h	Mon Jul 31 01:46:31 2023
@@ -63,7 +63,7 @@ along with GCC; see the file COPYING3.  
  * XXX figure out a better way to do this
  */
 #undef GCC_INCLUDE_DIR
-#define GCC_INCLUDE_DIR "/usr/include/gcc-10"
+#define GCC_INCLUDE_DIR "/usr/include/gcc-12"
 
 /* Under NetBSD, the normal location of the various *crt*.o files is the
/usr/lib directory.  */



CVS commit: src/external/gpl3/gcc/dist/gcc/config/sh

2023-07-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul 18 02:50:18 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/sh: sh.md

Log Message:
gcc: Fix peephole optimization bug for sh3 (PR port-sh3/56311)

Cherry-picked from upstream:
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=4dbb3af1efe55174a714d15c2994cf2842ef8c28
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101469

Now, the PR confirmed fixed. No regression observed for full ATF run on
landisk (compared with GCC built with this peephole optimization being
removed by hand).

We thank Oleg Endo, the author of the upstream commit.

Also thanks hgutch@ and uwe@ for analysis.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gcc/dist/gcc/config/sh/sh.md

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/gcc/dist/gcc/config/sh/sh.md
diff -u src/external/gpl3/gcc/dist/gcc/config/sh/sh.md:1.2 src/external/gpl3/gcc/dist/gcc/config/sh/sh.md:1.3
--- src/external/gpl3/gcc/dist/gcc/config/sh/sh.md:1.2	Mon Jul  5 10:34:25 2021
+++ src/external/gpl3/gcc/dist/gcc/config/sh/sh.md	Tue Jul 18 02:50:18 2023
@@ -10681,6 +10681,45 @@
&& peep2_reg_dead_p (2, operands[1]) && peep2_reg_dead_p (3, operands[0])"
   [(const_int 0)]
 {
+  if (MEM_P (operands[3]) && reg_overlap_mentioned_p (operands[0], operands[3]))
+{
+  // Take care when the eliminated operand[0] register is part of
+  // the destination memory address.
+  rtx addr = XEXP (operands[3], 0);
+
+  if (REG_P (addr))
+	operands[3] = replace_equiv_address (operands[3], operands[1]);
+
+  else if (GET_CODE (addr) == PLUS && REG_P (XEXP (addr, 0))
+	   && CONST_INT_P (XEXP (addr, 1))
+	   && REGNO (operands[0]) == REGNO (XEXP (addr, 0)))
+	operands[3] = replace_equiv_address (operands[3],
+			gen_rtx_PLUS (SImode, operands[1], XEXP (addr, 1)));
+
+  else if (GET_CODE (addr) == PLUS && REG_P (XEXP (addr, 0))
+	   && REG_P (XEXP (addr, 1)))
+{
+  // register + register address  @(R0, Rn)
+  // can change only the Rn in the address, not R0.
+  if (REGNO (operands[0]) == REGNO (XEXP (addr, 0))
+	  && REGNO (XEXP (addr, 0)) != 0)
+	{
+	  operands[3] = replace_equiv_address (operands[3],
+			gen_rtx_PLUS (SImode, operands[1], XEXP (addr, 1)));
+	}
+  else if (REGNO (operands[0]) == REGNO (XEXP (addr, 1))
+		   && REGNO (XEXP (addr, 1)) != 0)
+{
+	  operands[3] = replace_equiv_address (operands[3],
+			gen_rtx_PLUS (SImode, XEXP (addr, 0), operands[1]));
+}
+  else
+FAIL;
+}
+  else
+FAIL;
+}
+
   emit_insn (gen_addsi3 (operands[1], operands[1], operands[2]));
   sh_peephole_emit_move_insn (operands[3], operands[1]);
 })



CVS commit: src/external/gpl3/gcc/dist/gcc/config/sh

2023-07-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul 18 02:50:18 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/sh: sh.md

Log Message:
gcc: Fix peephole optimization bug for sh3 (PR port-sh3/56311)

Cherry-picked from upstream:
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=4dbb3af1efe55174a714d15c2994cf2842ef8c28
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101469

Now, the PR confirmed fixed. No regression observed for full ATF run on
landisk (compared with GCC built with this peephole optimization being
removed by hand).

We thank Oleg Endo, the author of the upstream commit.

Also thanks hgutch@ and uwe@ for analysis.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gcc/dist/gcc/config/sh/sh.md

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2023-02-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Feb 20 01:16:38 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64-netbsd.h

Log Message:
add author info to this file.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2023-02-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Feb 20 01:16:38 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64-netbsd.h

Log Message:
add author info to this file.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h

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/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h:1.6 src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h:1.7
--- src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h:1.6	Tue Jul 13 06:56:24 2021
+++ src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h	Mon Feb 20 01:16:38 2023
@@ -1,5 +1,7 @@
 /* Definitions for AArch64 running NetBSD
Copyright (C) 2016-2020 Free Software Foundation, Inc.
+   Contributed by Matthew Green (m...@eterna.com.au) and Christos Zoulas
+   (chris...@netbsd.org.)
 
This file is part of GCC.
 



CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2022-07-24 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jul 24 10:53:18 UTC 2022

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: rs6000.c

Log Message:
Revert our local fix for GCC 10.3 introduced in rev. 1.25:
http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c#rev1.25

The problem has been fixed differently by upstream:
- master: 
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=77eccbf39ed55297802bb66dff5f62507a7239e3
- gcc-10: 
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=6142d65f4f528067f31e86bb97c07a661f2d66e7

No regression observed for ATF on oea (sandpoint), booke (evbppc), and
405 (evbppc). The system boots successfully on 403 (evbppc).


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2022-07-24 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jul 24 10:53:18 UTC 2022

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: rs6000.c

Log Message:
Revert our local fix for GCC 10.3 introduced in rev. 1.25:
http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c#rev1.25

The problem has been fixed differently by upstream:
- master: 
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=77eccbf39ed55297802bb66dff5f62507a7239e3
- gcc-10: 
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=6142d65f4f528067f31e86bb97c07a661f2d66e7

No regression observed for ATF on oea (sandpoint), booke (evbppc), and
405 (evbppc). The system boots successfully on 403 (evbppc).


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c

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/gcc/dist/gcc/config/rs6000/rs6000.c
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.30 src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.31
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.30	Fri Jul 22 20:22:35 2022
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c	Sun Jul 24 10:53:17 2022
@@ -5707,9 +5707,7 @@ rs6000_file_start (void)
 
 #ifdef USING_ELFOS_H
   rs6000_machine = rs6000_machine_from_flags ();
-  if (!(rs6000_default_cpu && rs6000_default_cpu[0])
-	&& !global_options_set.x_rs6000_cpu_index)
-emit_asm_machine ();
+  emit_asm_machine ();
 #endif
 
   if (DEFAULT_ABI == ABI_ELFv2)



CVS commit: src/external/gpl3/gcc/dist/gcc/config

2021-11-07 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sun Nov  7 09:22:58 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config: netbsd.h

Log Message:
Libtsan intercepts the pthread exported functions with
dlsym(RTLD_NEXT, func_name).  This fails for pthread_join() as it
is present both as a stub in libc and as real operation in libpthread
and the search order is "libtsan.so libc.so libpthread.so".

Force the order "libtsan.so libpthread.so libc.so" so symbols
get intercepted from libpthread first.

Ok: Matthew Green 


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/external/gpl3/gcc/dist/gcc/config/netbsd.h

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/gcc/dist/gcc/config/netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/netbsd.h:1.37 src/external/gpl3/gcc/dist/gcc/config/netbsd.h:1.38
--- src/external/gpl3/gcc/dist/gcc/config/netbsd.h:1.37	Mon Apr 12 00:05:54 2021
+++ src/external/gpl3/gcc/dist/gcc/config/netbsd.h	Sun Nov  7 09:22:58 2021
@@ -203,3 +203,9 @@ along with GCC; see the file COPYING3.  
   do {	\
 netbsd_patch_builtins ();		\
   } while(0)
+
+#if defined(HAVE_LD_STATIC_DYNAMIC)
+#undef LIBTSAN_EARLY_SPEC
+#define LIBTSAN_EARLY_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}"	\
+  " -ltsan %{static-libtsan:" LD_DYNAMIC_OPTION "} -lpthread"
+#endif



CVS commit: src/external/gpl3/gcc/dist/gcc/config

2021-11-07 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sun Nov  7 09:22:58 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config: netbsd.h

Log Message:
Libtsan intercepts the pthread exported functions with
dlsym(RTLD_NEXT, func_name).  This fails for pthread_join() as it
is present both as a stub in libc and as real operation in libpthread
and the search order is "libtsan.so libc.so libpthread.so".

Force the order "libtsan.so libpthread.so libc.so" so symbols
get intercepted from libpthread first.

Ok: Matthew Green 


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/external/gpl3/gcc/dist/gcc/config/netbsd.h

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2021-09-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 18 19:59:11 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64.h

Log Message:
oops, re-enable host_detect_local_cpu for NetBSD


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2021-09-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 18 19:59:11 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64.h

Log Message:
oops, re-enable host_detect_local_cpu for NetBSD


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h

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/gcc/dist/gcc/config/aarch64/aarch64.h
diff -u src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h:1.2 src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h:1.3
--- src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h:1.2	Sat Sep 18 10:45:11 2021
+++ src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h	Sat Sep 18 19:59:11 2021
@@ -1200,7 +1200,7 @@ extern const char *aarch64_rewrite_mcpu 
 #define MCPU_TO_MARCH_SPEC_FUNCTIONS \
   { "rewrite_mcpu", aarch64_rewrite_mcpu },
 
-#if defined(__aarch64__) && defined(__linux__)
+#if defined(__aarch64__) && (defined(__linux__) || defined(__NetBSD__))
 extern const char *host_detect_local_cpu (int argc, const char **argv);
 #define HAVE_LOCAL_CPU_DETECT
 # define EXTRA_SPEC_FUNCTIONS		\



re: CVS commit: src/external/gpl3/gcc/dist/gcc/config

2021-09-18 Thread matthew green
"Jared D. McNeill" writes:
> Module Name:  src
> Committed By: jmcneill
> Date: Sat Sep 18 10:45:11 UTC 2021
>
> Modified Files:
>   src/external/gpl3/gcc/dist/gcc/config: host-darwin.c
>   src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64.h
>
> Log Message:
> Fix build on macOS 11.6 arm64 hosts.
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.1.1.10 -r1.2 \
> src/external/gpl3/gcc/dist/gcc/config/host-darwin.c
> cvs rdiff -u -r1.1.1.13 -r1.2 \
> src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h

the 2nd change here likely broke netbsd, which also has
support for this.  it's probably fine to add || __NetBSD__
to this conditional since those are the only two ports
that support this feature.


.mrg.


CVS commit: src/external/gpl3/gcc/dist/gcc/config

2021-09-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 18 10:45:11 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config: host-darwin.c
src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64.h

Log Message:
Fix build on macOS 11.6 arm64 hosts.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.10 -r1.2 \
src/external/gpl3/gcc/dist/gcc/config/host-darwin.c
cvs rdiff -u -r1.1.1.13 -r1.2 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h

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/gcc/dist/gcc/config/host-darwin.c
diff -u src/external/gpl3/gcc/dist/gcc/config/host-darwin.c:1.1.1.10 src/external/gpl3/gcc/dist/gcc/config/host-darwin.c:1.2
--- src/external/gpl3/gcc/dist/gcc/config/host-darwin.c:1.1.1.10	Sat Apr 10 22:09:44 2021
+++ src/external/gpl3/gcc/dist/gcc/config/host-darwin.c	Sat Sep 18 10:45:11 2021
@@ -22,6 +22,8 @@
 #include "coretypes.h"
 #include "diagnostic-core.h"
 #include "config/host-darwin.h"
+#include "hosthooks.h"
+#include "hosthooks-def.h"
 
 /* Yes, this is really supposed to work.  */
 /* This allows for a pagesize of 16384, which we have on Darwin20, but should
@@ -78,3 +80,5 @@ darwin_gt_pch_use_address (void *addr, s
 
   return ret;
 }
+
+const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;

Index: src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h
diff -u src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h:1.1.1.13 src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h:1.2
--- src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h:1.1.1.13	Sat Apr 10 22:09:46 2021
+++ src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h	Sat Sep 18 10:45:11 2021
@@ -1200,7 +1200,7 @@ extern const char *aarch64_rewrite_mcpu 
 #define MCPU_TO_MARCH_SPEC_FUNCTIONS \
   { "rewrite_mcpu", aarch64_rewrite_mcpu },
 
-#if defined(__aarch64__)
+#if defined(__aarch64__) && defined(__linux__)
 extern const char *host_detect_local_cpu (int argc, const char **argv);
 #define HAVE_LOCAL_CPU_DETECT
 # define EXTRA_SPEC_FUNCTIONS		\



CVS commit: src/external/gpl3/gcc/dist/gcc/config

2021-09-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 18 10:45:11 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config: host-darwin.c
src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64.h

Log Message:
Fix build on macOS 11.6 arm64 hosts.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.10 -r1.2 \
src/external/gpl3/gcc/dist/gcc/config/host-darwin.c
cvs rdiff -u -r1.1.1.13 -r1.2 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h

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



Re: CVS commit: src/external/gpl3/gcc/dist/gcc/ginclude

2021-07-15 Thread Christos Zoulas


> On Jul 15, 2021, at 12:06 AM, matthew green  wrote:
> 
> "Christos Zoulas" writes:
>> Module Name: src
>> Committed By:christos
>> Date:Wed Jul 14 13:24:59 UTC 2021
>> 
>> Modified Files:
>>  src/external/gpl3/gcc/dist/gcc/ginclude: stddef.h
>> 
>> Log Message:
>> clang does not support __float128 in our configuration and i386
> 
> shouldn't you replace this with some other 128-bit aligned
> value then, instead of eliding it entirely?

Good idea! Let me do that.

christos


signature.asc
Description: Message signed with OpenPGP


re: CVS commit: src/external/gpl3/gcc/dist/gcc/ginclude

2021-07-14 Thread matthew green
"Christos Zoulas" writes:
> Module Name:  src
> Committed By: christos
> Date: Wed Jul 14 13:24:59 UTC 2021
>
> Modified Files:
>   src/external/gpl3/gcc/dist/gcc/ginclude: stddef.h
>
> Log Message:
> clang does not support __float128 in our configuration and i386

shouldn't you replace this with some other 128-bit aligned
value then, instead of eliding it entirely?


.mrg.


Re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2020-10-20 Thread Joerg Sonnenberger
On Wed, Oct 21, 2020 at 08:58:36AM +0900, Rin Okuyama wrote:
> I'm also one who feels hesitate to import Linux'ism into our basic
> components. However, for this problem in particular, I still think
> it is not a good choice to keep NetBSD support in driver-aarch64.c:
> 
> (a) Our sysctl(3)-based interface is not compliant to any standards,
> just like Linux's /proc/cpuinfo. But the latter is, unfortunately
> for us, the de facto standard.

It works properly in a chroot etc without needing new files. I would
call that a big plus.

Joerg


Re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2020-10-20 Thread Rin Okuyama

Hi,
(tech-toolchain@ added to cc)

On 2020/10/16 1:49, Kamil Rytarowski wrote:

On 15.10.2020 17:14, Rin Okuyama wrote:

On 2020/10/15 16:12, matthew green wrote:

Martin Husemann writes:

On Thu, Oct 15, 2020 at 05:28:12PM +1100, matthew green wrote:

you could try reverting most of our changes to this file and
making sure you run with /proc mounted -o linux.  ryo@ recently
added additional /proc/cpuinfo support that should make this
just work with the upstream version, but i haven't had chance
to update and see if this is the case.


I've confirmed that -mtune=native works fine at least for A53,
even if all the local changes to driver-aarch64.c is reverted.
I will commit it soon.


If we go this route, we should make the relevant procfs nodes
independent
of -o linux.


that would be fine by me.


Nowadays, -o linux is turned on by default (unless nolinux is
specified explicitly). Still, native apps probably should not
depend on it.

This needs MI changes to procfs, not MD to aarch64. Should we
enable /proc/cpuinfo unconditionally?



I'm against the policy of restoring the /proc dependency for this corner
case in one application.

We need to upstream the NetBSD specific patches to mainline GCC.


I'm also one who feels hesitate to import Linux'ism into our basic
components. However, for this problem in particular, I still think
it is not a good choice to keep NetBSD support in driver-aarch64.c:

(a) Our sysctl(3)-based interface is not compliant to any standards,
just like Linux's /proc/cpuinfo. But the latter is, unfortunately
for us, the de facto standard.

(b) Because of (a), driver-aarch64.c is deeply depended on
/proc/cpuinfo. Our NetBSD support code

see diff to vendor branch here:
http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c.diff?r1=1.1.1.7=1.10=h

is something like a "glue code" which converts our convention to
/proc/cpuinfo style. We already do this in procfs. Why twice?

(c) I imagine that there would be little benefits for upstream to
merge NetBSD support into their repository. If they will merge,
I don't think the code is kept updated.

(d) Only -march=native and -mtune=native depends on this feature. I'm
OK with /proc/cpuinfo is left as is; only enabled when -onolinux is
not specified. IMO, it is users' responsibility that such a
additional feature fails with their non-standard system settings.

In short, I'm worried about future when mrg@ or someone else have to
maintain our glue code eternally, if this code is not reverted.

Thanks,
rin


Re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2020-10-16 Thread Robert Elz
Date:Fri, 16 Oct 2020 04:07:31 +
From:"Thomas Mueller" 
Message-ID:  <20201016052422.e063084...@mail.netbsd.org>

  | Should I add ,linux to the end of the procfs line?

You can, but it isn't needed these days -- I used to mount procfs twice,
once without the linux option, on /proc, and once with, on /emul/linux/proc)
but there seems to be little point in that any more (even though the linux
/proc has a whole bunch of trash that has nothing to do with processes, and
should be, and generally is, available from /kern ... /proc/cpuinfo is an
example of that, though that one is missing from kernfs and should be added
there).

I do add "hidden" to the mount option list though, there's essentially
no point in including /proc /kern /dev/pts (or anything else like those)
in default df output (which is the only thing "hidden" generally affects).

kre



Re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2020-10-15 Thread Thomas Mueller
Excerpt from Rin Okuyama:

> Nowadays, -o linux is turned on by default (unless nolinux is
> specified explicitly). Still, native apps probably should not
> depend on it.
 
> This needs MI changes to procfs, not MD to aarch64. Should we
> enable /proc/cpuinfo unconditionally?

My NetBSD system has no /kern and no /proc, do I need to mkdir these 
directories?  I just did.

kernfs and procfs were commented out in /etc/fstab .

Do I need to revive, new /etc/fstab being as shown below, is this good now?

Should I add ,linux to the end of the procfs line?

I might want to run Linux programs.

# NetBSD /targetroot/etc/fstab
# See /usr/share/examples/fstab/ for more examples.
NAME=WD2G19  /  ffs rw,log   1 1
NAME=WD2G17  none   swapsw,dp0 0
kernfs  /kern   kernfs  rw
ptyfs   /dev/ptsptyfs   rw
procfs  /proc   procfs  rw
/dev/cd0a   /cdrom  cd9660  ro,noauto

tmpfs   /var/shmtmpfs   rw,-m1777,-sram%25

Tom


Re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2020-10-15 Thread Kamil Rytarowski
On 15.10.2020 17:14, Rin Okuyama wrote:
> On 2020/10/15 16:12, matthew green wrote:
>> Martin Husemann writes:
>>> On Thu, Oct 15, 2020 at 05:28:12PM +1100, matthew green wrote:
 you could try reverting most of our changes to this file and
 making sure you run with /proc mounted -o linux.  ryo@ recently
 added additional /proc/cpuinfo support that should make this
 just work with the upstream version, but i haven't had chance
 to update and see if this is the case.
> 
> I've confirmed that -mtune=native works fine at least for A53,
> even if all the local changes to driver-aarch64.c is reverted.
> I will commit it soon.
> 
>>> If we go this route, we should make the relevant procfs nodes
>>> independent
>>> of -o linux.
>>
>> that would be fine by me.
> 
> Nowadays, -o linux is turned on by default (unless nolinux is
> specified explicitly). Still, native apps probably should not
> depend on it.
> 
> This needs MI changes to procfs, not MD to aarch64. Should we
> enable /proc/cpuinfo unconditionally?


I'm against the policy of restoring the /proc dependency for this corner
case in one application.

We need to upstream the NetBSD specific patches to mainline GCC.



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2020-10-15 Thread Rin Okuyama

On 2020/10/15 16:12, matthew green wrote:

Martin Husemann writes:

On Thu, Oct 15, 2020 at 05:28:12PM +1100, matthew green wrote:

you could try reverting most of our changes to this file and
making sure you run with /proc mounted -o linux.  ryo@ recently
added additional /proc/cpuinfo support that should make this
just work with the upstream version, but i haven't had chance
to update and see if this is the case.


I've confirmed that -mtune=native works fine at least for A53,
even if all the local changes to driver-aarch64.c is reverted.
I will commit it soon.


If we go this route, we should make the relevant procfs nodes independent
of -o linux.


that would be fine by me.


Nowadays, -o linux is turned on by default (unless nolinux is
specified explicitly). Still, native apps probably should not
depend on it.

This needs MI changes to procfs, not MD to aarch64. Should we
enable /proc/cpuinfo unconditionally?


i had to write the netbsd version of that code twice so far.
once for gcc 8.3 and 8.4, once for gcc 8.5 and 9.3, and i'd
really rather avoid having to write another version :)


Oh... Thank you very much for your hard works!

Thanks,
rin


re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2020-10-15 Thread matthew green
Martin Husemann writes:
> On Thu, Oct 15, 2020 at 05:28:12PM +1100, matthew green wrote:
> > you could try reverting most of our changes to this file and
> > making sure you run with /proc mounted -o linux.  ryo@ recently
> > added additional /proc/cpuinfo support that should make this
> > just work with the upstream version, but i haven't had chance
> > to update and see if this is the case.
> 
> If we go this route, we should make the relevant procfs nodes independent
> of -o linux.

that would be fine by me.

i had to write the netbsd version of that code twice so far.
once for gcc 8.3 and 8.4, once for gcc 8.5 and 9.3, and i'd
really rather avoid having to write another version :)


.mrg.


Re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2020-10-15 Thread Martin Husemann
On Thu, Oct 15, 2020 at 05:28:12PM +1100, matthew green wrote:
> you could try reverting most of our changes to this file and
> making sure you run with /proc mounted -o linux.  ryo@ recently
> added additional /proc/cpuinfo support that should make this
> just work with the upstream version, but i haven't had chance
> to update and see if this is the case.

If we go this route, we should make the relevant procfs nodes independent
of -o linux.

Martin


re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2020-10-15 Thread matthew green
"Rin Okuyama" writes:
> Module Name:  src
> Committed By: rin
> Date: Tue Oct 13 07:12:00 UTC 2020
> 
> Modified Files:
>   src/external/gpl3/gcc/dist/gcc/config/aarch64: driver-aarch64.c
> 
> Log Message:
> Reduce diff with upstream a bit.
> No functional changes.

you could try reverting most of our changes to this file and
making sure you run with /proc mounted -o linux.  ryo@ recently
added additional /proc/cpuinfo support that should make this
just work with the upstream version, but i haven't had chance
to update and see if this is the case.

thanks!


.mrg.


Re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/m68k

2020-08-16 Thread Rin Okuyama

Sorry for the late reply.

On 2020/08/11 1:16, Valery Ushakov wrote:

This sounds eerily similar to port-macppc/54827 - there's quite a bit
of confusion early on on my part there, but scroll to the last couple
of mails.  http://gnats.netbsd.org/54827

It looks like some logic changed in MI gcc8 that broke netbsd MD
config headers and I wonder if you see the same problem here.  For
macppc the fix was also to undo the netbsd change to STACK_BOUNDARY in
favor of PREFERRED_STACK_BOUNDARY.


Thank you for remaining me that PR. I was following discussion at
that time, but I'd forgotten that it was due to STACK_BOUNDARY.

On 2020/08/11 10:27, matthew green wrote:

May be we should also check other ports for similar gotcha proactively?


good idea.  no other gcc/config/*/*netbsd* files define the
nasty STACK_BOUNDARY macro so hopefully we're good now.


Yes, powerpc and m68k were the last ones.

We somehow gained a bit more experience to overcome troubles
caused by GCC. I think that we can deal with similar problems
better in the next time :).

Thanks,
rin


re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/m68k

2020-08-10 Thread matthew green
> May be we should also check other ports for similar gotcha proactively?

good idea.  no other gcc/config/*/*netbsd* files define the
nasty STACK_BOUNDARY macro so hopefully we're good now.

thanks!


.mrg.


Re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/m68k

2020-08-10 Thread Valery Ushakov
On Mon, Aug 10, 2020 at 06:24:39 +, Rin Okuyama wrote:

> Modified Files:
>   src/external/gpl3/gcc/dist/gcc/config/m68k: netbsd-elf.h
> 
> Log Message:
> PR port-m68k/6
> 
> Reset STACK_BOUNDARY to default, 16, to fix strange freeze for amiga,
> when kernel is compiled by GCC8.

This sounds eerily similar to port-macppc/54827 - there's quite a bit
of confusion early on on my part there, but scroll to the last couple
of mails.  http://gnats.netbsd.org/54827

It looks like some logic changed in MI gcc8 that broke netbsd MD
config headers and I wonder if you see the same problem here.  For
macppc the fix was also to undo the netbsd change to STACK_BOUNDARY in
favor of PREFERRED_STACK_BOUNDARY.

May be we should also check other ports for similar gotcha proactively?

-uwe


Re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2020-05-18 Thread Jared McNeill
Unfortunately this breaks building on a 9.0 arm64 host because it is 
picking up /usr/include/aarch64/armreg.h and the one in 9.0 is missing a 
bunch of stuff. It works when using armreg.h from the source tree instead, 
eg:


-#include 
+#include "/path/to/src/sys/arch/aarch64/include/armreg.h"



On Tue, 28 Apr 2020, matthew green wrote:


Module Name:src
Committed By:   mrg
Date:   Tue Apr 28 03:00:23 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: driver-aarch64.c

Log Message:
slightly reduce the scope of #ifdef __NetBSD__ version of the
-m{cpu,tune,arch}=native handling code, and hopefully reduce
future effort by aligning inputs

- share common variables and setup more
- build a linux/arm64 like /proc/cpuinfo Features line and
 use that to match the new 'list of features' per gcc feature,
 based upon our sysctl(2) published info.  complete this list
 for all supported extensions.

now this feature works again.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
   src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c

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




CVS commit: src/external/gpl3/gcc/dist/gcc/config

2019-11-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Nov  6 10:42:00 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config: netbsd.h

Log Message:
update the comment above LIB_SPEC to remove 2 wrong things we fixed.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/external/gpl3/gcc/dist/gcc/config/netbsd.h

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config

2019-11-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Nov  6 10:42:00 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config: netbsd.h

Log Message:
update the comment above LIB_SPEC to remove 2 wrong things we fixed.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/external/gpl3/gcc/dist/gcc/config/netbsd.h

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/gcc/dist/gcc/config/netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/netbsd.h:1.32 src/external/gpl3/gcc/dist/gcc/config/netbsd.h:1.33
--- src/external/gpl3/gcc/dist/gcc/config/netbsd.h:1.32	Wed Oct  2 02:54:34 2019
+++ src/external/gpl3/gcc/dist/gcc/config/netbsd.h	Wed Nov  6 10:42:00 2019
@@ -99,13 +99,9 @@ along with GCC; see the file COPYING3.  
1. Select the appropriate set of libs, depending on whether we're
   profiling.
 
-   2. Include the pthread library if -pthread is specified (only
-  if threads are enabled).
+   2. Include the pthread library if -pthread is specified.
 
-   3. Include the posix library if -posix is specified.
-
-   FIXME: Could eliminate the duplication here if we were allowed to
-   use string concatenation.  */
+   3. Include the posix library if -posix is specified. */
 
 #define NETBSD_LIB_SPEC		\
   "%{pthread:			\



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-11-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Nov  6 09:10:50 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.gcc
src/external/gpl3/gcc/dist/gcc/config/rs6000: netbsd64.h

Log Message:
revert the powerpc config.gcc changes i made while merging,
they end up mis-ordering tm files.

revert the rs6000/netbsd64.h change and put it back as
SUBSUBTARGET_EXTRA_SPECS.

this seems to make the build work again, though mknative will
need a re-run for ppc*.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/external/gpl3/gcc/dist/gcc/config.gcc
cvs rdiff -u -r1.24 -r1.25 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h

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/gcc/dist/gcc/config.gcc
diff -u src/external/gpl3/gcc/dist/gcc/config.gcc:1.60 src/external/gpl3/gcc/dist/gcc/config.gcc:1.61
--- src/external/gpl3/gcc/dist/gcc/config.gcc:1.60	Wed Oct 16 07:35:14 2019
+++ src/external/gpl3/gcc/dist/gcc/config.gcc	Wed Nov  6 09:10:50 2019
@@ -2531,14 +2531,15 @@ powerpc*-*-freebsd*)
 	esac
 	;;
 powerpc*-*-netbsd*)
-	tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file} freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h"
+	tm_file="${tm_file} ${nbsd_tm_file} dbxelf.h elfos.h freebsd-spec.h"
 	case ${target} in
 	powerpc64*)
 		tm_file="rs6000/biarch64.h ${tm_file}"
-		tm_file="${tm_file} rs6000/default64.h rs6000/netbsd64.h"
+		tm_file="${tm_file} rs6000/sysv4.h rs6000/default64.h rs6000/netbsd64.h"
 		tmake_file="${tmake_file} rs6000/t-netbsd64"
 		;;
 	*)
+		tm_file="${tm_file} rs6000/sysv4.h rs6000/netbsd.h"
 		tmake_file="${tmake_file} rs6000/t-netbsd"
 		;;
 	esac

Index: src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.24 src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.25
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.24	Tue Nov  5 20:06:41 2019
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h	Wed Nov  6 09:10:50 2019
@@ -204,8 +204,8 @@ extern int dot_symbols;
 %{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}}" \
   ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
 
-#undef	EXTRA_SPECS
-#define EXTRA_SPECS \
+#undef	SUBSUBTARGET_EXTRA_SPECS
+#define SUBSUBTARGET_EXTRA_SPECS \
   { "asm_spec_common",		ASM_SPEC_COMMON },			\
   { "asm_spec32",		ASM_SPEC32 },\
   { "asm_spec64",		ASM_SPEC64 },\



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-11-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Nov  6 09:10:50 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.gcc
src/external/gpl3/gcc/dist/gcc/config/rs6000: netbsd64.h

Log Message:
revert the powerpc config.gcc changes i made while merging,
they end up mis-ordering tm files.

revert the rs6000/netbsd64.h change and put it back as
SUBSUBTARGET_EXTRA_SPECS.

this seems to make the build work again, though mknative will
need a re-run for ppc*.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/external/gpl3/gcc/dist/gcc/config.gcc
cvs rdiff -u -r1.24 -r1.25 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2019-11-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Nov  5 20:06:41 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: netbsd64.h

Log Message:
- Use EXTRA_SPECS like we did for aarch64 instead of SUBSUBTARGET_EXTRA_SPECS
  so that assembly specs get propagated (they were lost before)
- adjust the block register padding (like the other OS's) so that code compiles
- XXX: linker still broken for shared libraries because the os specific spec
  is not chosen


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2019-11-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Nov  5 20:06:41 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: netbsd64.h

Log Message:
- Use EXTRA_SPECS like we did for aarch64 instead of SUBSUBTARGET_EXTRA_SPECS
  so that assembly specs get propagated (they were lost before)
- adjust the block register padding (like the other OS's) so that code compiles
- XXX: linker still broken for shared libraries because the os specific spec
  is not chosen


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h

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/gcc/dist/gcc/config/rs6000/netbsd64.h
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.23 src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.24
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.23	Fri May 10 22:37:58 2019
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h	Tue Nov  5 15:06:41 2019
@@ -204,8 +204,8 @@ extern int dot_symbols;
 %{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}}" \
   ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
 
-#undef	SUBSUBTARGET_EXTRA_SPECS
-#define SUBSUBTARGET_EXTRA_SPECS \
+#undef	EXTRA_SPECS
+#define EXTRA_SPECS \
   { "asm_spec_common",		ASM_SPEC_COMMON },			\
   { "asm_spec32",		ASM_SPEC32 },\
   { "asm_spec64",		ASM_SPEC64 },\
@@ -296,7 +296,7 @@ extern int dot_symbols;
registers and memory.  FIRST is nonzero if this is the only
element.  */
 #define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \
-  (!(FIRST) ? upward : FUNCTION_ARG_PADDING (MODE, TYPE))
+  (!(FIRST) ? PAD_UPWARD : targetm.calls.function_arg_padding (MODE, TYPE))
 
 /* NetBSD doesn't support saving and restoring 64-bit regs in a 32-bit
process.  */



CVS commit: src/external/gpl3/gcc/dist/gcc/config/pa

2019-11-02 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov  3 01:03:30 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/pa: pa-netbsd.h

Log Message:
netbsd/hppa uses 16 byte alignment.  the inherited default changed..


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gcc/dist/gcc/config/pa/pa-netbsd.h

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config/pa

2019-11-02 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov  3 01:03:30 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/pa: pa-netbsd.h

Log Message:
netbsd/hppa uses 16 byte alignment.  the inherited default changed..


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gcc/dist/gcc/config/pa/pa-netbsd.h

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/gcc/dist/gcc/config/pa/pa-netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/pa/pa-netbsd.h:1.5 src/external/gpl3/gcc/dist/gcc/config/pa/pa-netbsd.h:1.6
--- src/external/gpl3/gcc/dist/gcc/config/pa/pa-netbsd.h:1.5	Fri Aug 19 05:11:10 2016
+++ src/external/gpl3/gcc/dist/gcc/config/pa/pa-netbsd.h	Sun Nov  3 01:03:30 2019
@@ -131,6 +131,10 @@ along with GCC; see the file COPYING3.  
 #undef PTRDIFF_TYPE
 #define PTRDIFF_TYPE "long int"
 
+/* NetBSD always uses 128 byte alignment.  */
+#undef MALLOC_ABI_ALIGNMENT
+#define MALLOC_ABI_ALIGNMENT 128
+
 #if 0
 #undef TARGET_SYNC_LIBCALL
 #define TARGET_SYNC_LIBCALL 1



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-10-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct 23 18:55:36 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: file-prefix-map.c

Log Message:
Since add_debug_regex_map is used in opts-global.c unconditionally, we can't
disable the code with #ifndef __NetBSD__ because it breaks cross-building.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gcc/dist/gcc/file-prefix-map.c

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



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-10-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct 23 18:55:36 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: file-prefix-map.c

Log Message:
Since add_debug_regex_map is used in opts-global.c unconditionally, we can't
disable the code with #ifndef __NetBSD__ because it breaks cross-building.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gcc/dist/gcc/file-prefix-map.c

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/gcc/dist/gcc/file-prefix-map.c
diff -u src/external/gpl3/gcc/dist/gcc/file-prefix-map.c:1.2 src/external/gpl3/gcc/dist/gcc/file-prefix-map.c:1.3
--- src/external/gpl3/gcc/dist/gcc/file-prefix-map.c:1.2	Tue Oct  1 17:17:28 2019
+++ src/external/gpl3/gcc/dist/gcc/file-prefix-map.c	Wed Oct 23 14:55:36 2019
@@ -123,7 +123,8 @@ remap_macro_filename (const char *filena
   return remap_filename (macro_prefix_maps, filename);
 }
 
-#ifndef __NetBSD__
+/* Original GCC version disabled. The NetBSD version handles regex */
+#if 0
 /* Remap using -fdebug-prefix-map.  Return the GC-allocated new name
corresponding to FILENAME or FILENAME if no remapping was performed.  */
 const char *
@@ -131,7 +132,12 @@ remap_debug_filename (const char *filena
 {
   return remap_filename (debug_prefix_maps, filename);
 }
-#else
+#endif
+
+/*
+ * The following code is a NetBSD extension that allows regex and
+ * \[0-9] substitutition arguments.
+ */
 
 /* Perform user-specified mapping of debug filename prefixes.  Return
the new name corresponding to FILENAME.  */
@@ -238,4 +244,3 @@ remap_debug_filename (const char *filena
 {
return remap_debug_regex_filename (remap_debug_prefix_filename (filename));
 }
-#endif



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-10-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Oct 16 07:35:14 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.gcc

Log Message:
make sure to include bpabi.h before arm.h.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/external/gpl3/gcc/dist/gcc/config.gcc

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



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-10-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Oct 16 07:35:14 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.gcc

Log Message:
make sure to include bpabi.h before arm.h.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/external/gpl3/gcc/dist/gcc/config.gcc

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/gcc/dist/gcc/config.gcc
diff -u src/external/gpl3/gcc/dist/gcc/config.gcc:1.59 src/external/gpl3/gcc/dist/gcc/config.gcc:1.60
--- src/external/gpl3/gcc/dist/gcc/config.gcc:1.59	Wed Oct  2 05:58:03 2019
+++ src/external/gpl3/gcc/dist/gcc/config.gcc	Wed Oct 16 07:35:14 2019
@@ -1148,7 +1148,7 @@ arm*-*-freebsd*)# ARM Fr
 	with_tls=${with_tls:-gnu}
 	;;
 arm*-*-netbsdelf*)
-	tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h arm/aout.h ${tm_file} arm/netbsd-elf.h"
+	tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h arm/aout.h arm/netbsd-elf.h"
 	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
 	tmake_file="${tmake_file} arm/t-arm"
 	case ${target} in
@@ -1169,6 +1169,7 @@ arm*-*-netbsdelf*)
 	with_cpu=${with_cpu:-strongarm}
 	;;
 	esac
+	tm_file="${tm_file} vxworks-dummy.h arm/arm.h"
 	case ${target} in
 	arm*-*-netbsdelf-*eabihf*)
 	tm_defines="${tm_defines} TARGET_DEFAULT_FLOAT_ABI=ARM_FLOAT_ABI_HARD"



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-10-04 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Oct  4 12:46:43 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: ira-color.c

Log Message:
We might've switched modes, re-init the move cost table again if necessary.

Fixes unlikely segfault on VAX.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc/dist/gcc/ira-color.c

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



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-10-04 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Oct  4 12:46:43 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: ira-color.c

Log Message:
We might've switched modes, re-init the move cost table again if necessary.

Fixes unlikely segfault on VAX.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc/dist/gcc/ira-color.c

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/gcc/dist/gcc/ira-color.c
diff -u src/external/gpl3/gcc/dist/gcc/ira-color.c:1.6 src/external/gpl3/gcc/dist/gcc/ira-color.c:1.7
--- src/external/gpl3/gcc/dist/gcc/ira-color.c:1.6	Tue Oct  1 10:38:16 2019
+++ src/external/gpl3/gcc/dist/gcc/ira-color.c	Fri Oct  4 12:46:43 2019
@@ -1377,6 +1377,7 @@ update_costs_from_allocno (ira_allocno_t
 	 e.g. DImode for AREG on x86.  For such cases the
 	 register move cost will be maximal.  */
 	  mode = narrower_subreg_mode (mode, ALLOCNO_MODE (cp->second));
+	  ira_init_register_move_cost_if_necessary (mode);
 	  
 	  cost = (cp->second == allocno
 		  ? ira_register_move_cost[mode][rclass][aclass]



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-10-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Oct  2 05:58:03 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.gcc

Log Message:
avoid multiple tm_file headers being listed and breaking builds.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/external/gpl3/gcc/dist/gcc/config.gcc

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/gcc/dist/gcc/config.gcc
diff -u src/external/gpl3/gcc/dist/gcc/config.gcc:1.58 src/external/gpl3/gcc/dist/gcc/config.gcc:1.59
--- src/external/gpl3/gcc/dist/gcc/config.gcc:1.58	Wed Oct  2 02:54:34 2019
+++ src/external/gpl3/gcc/dist/gcc/config.gcc	Wed Oct  2 05:58:03 2019
@@ -1156,7 +1156,7 @@ arm*-*-netbsdelf*)
 	esac
 	case ${target} in
 	arm*-*-netbsdelf-*eabi*)
-	tm_file="$tm_file arm/bpabi.h arm/netbsd-elf.h arm/netbsd-eabi.h"
+	tm_file="${tm_file} arm/bpabi.h arm/netbsd-eabi.h"
 	# GCC 7 vs NetBSD/eabi -> avoid arm unwinder
 	#tmake_file="$tmake_file arm/t-bpabi"
 	tmake_file="$tmake_file arm/t-netbsdeabi"
@@ -1164,13 +1164,11 @@ arm*-*-netbsdelf*)
 	default_use_cxa_atexit=yes
 	;;
 	*)
-	tm_file="$tm_file arm/netbsd-elf.h"
 	tmake_file="$tmake_file arm/t-netbsd"
 	# NetBSD/arm (non-eabi) is only old platforms
 	with_cpu=${with_cpu:-strongarm}
 	;;
 	esac
-	tm_file="${tm_file} arm/arm.h"
 	case ${target} in
 	arm*-*-netbsdelf-*eabihf*)
 	tm_defines="${tm_defines} TARGET_DEFAULT_FLOAT_ABI=ARM_FLOAT_ABI_HARD"
@@ -2536,11 +2534,10 @@ powerpc*-*-netbsd*)
 	case ${target} in
 	powerpc64*)
 		tm_file="rs6000/biarch64.h ${tm_file}"
-		tm_file="${tm_file} rs6000/sysv4.h rs6000/default64.h rs6000/netbsd64.h"
+		tm_file="${tm_file} rs6000/default64.h rs6000/netbsd64.h"
 		tmake_file="${tmake_file} rs6000/t-netbsd64"
 		;;
 	*)
-		tm_file="${tm_file} rs6000/sysv4.h rs6000/netbsd.h"
 		tmake_file="${tmake_file} rs6000/t-netbsd"
 		;;
 	esac



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-10-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Oct  2 05:58:03 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.gcc

Log Message:
avoid multiple tm_file headers being listed and breaking builds.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/external/gpl3/gcc/dist/gcc/config.gcc

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



CVS commit: src/external/gpl3/gcc/dist/gcc/common/config/or1k

2019-10-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Oct  2 02:59:46 UTC 2019

Removed Files:
src/external/gpl3/gcc/dist/gcc/common/config/or1k: or1k-common.c

Log Message:
remove obsolete gcc 4.9 or1k code.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 \
src/external/gpl3/gcc/dist/gcc/common/config/or1k/or1k-common.c

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config/or1k

2019-10-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Oct  2 02:50:38 UTC 2019

Removed Files:
src/external/gpl3/gcc/dist/gcc/config/or1k: constraints.md elf.h
linux-elf.h linux-gas.h netbsd.h or1k-modes.def or1k-opts.h
or1k-protos.h or1k.c or1k.h or1k.md or1k.opt predicates.md t-linux
t-or1k t-or1knd

Log Message:
retire or1k gcc 4.9 code.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 \
src/external/gpl3/gcc/dist/gcc/config/or1k/constraints.md \
src/external/gpl3/gcc/dist/gcc/config/or1k/elf.h \
src/external/gpl3/gcc/dist/gcc/config/or1k/linux-elf.h \
src/external/gpl3/gcc/dist/gcc/config/or1k/linux-gas.h \
src/external/gpl3/gcc/dist/gcc/config/or1k/or1k-modes.def \
src/external/gpl3/gcc/dist/gcc/config/or1k/or1k-opts.h \
src/external/gpl3/gcc/dist/gcc/config/or1k/or1k-protos.h \
src/external/gpl3/gcc/dist/gcc/config/or1k/or1k.h \
src/external/gpl3/gcc/dist/gcc/config/or1k/or1k.md \
src/external/gpl3/gcc/dist/gcc/config/or1k/or1k.opt \
src/external/gpl3/gcc/dist/gcc/config/or1k/predicates.md \
src/external/gpl3/gcc/dist/gcc/config/or1k/t-linux \
src/external/gpl3/gcc/dist/gcc/config/or1k/t-or1k \
src/external/gpl3/gcc/dist/gcc/config/or1k/t-or1knd
cvs rdiff -u -r1.3 -r0 src/external/gpl3/gcc/dist/gcc/config/or1k/netbsd.h
cvs rdiff -u -r1.2 -r0 src/external/gpl3/gcc/dist/gcc/config/or1k/or1k.c

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config/or1k

2019-10-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Oct  2 02:50:38 UTC 2019

Removed Files:
src/external/gpl3/gcc/dist/gcc/config/or1k: constraints.md elf.h
linux-elf.h linux-gas.h netbsd.h or1k-modes.def or1k-opts.h
or1k-protos.h or1k.c or1k.h or1k.md or1k.opt predicates.md t-linux
t-or1k t-or1knd

Log Message:
retire or1k gcc 4.9 code.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 \
src/external/gpl3/gcc/dist/gcc/config/or1k/constraints.md \
src/external/gpl3/gcc/dist/gcc/config/or1k/elf.h \
src/external/gpl3/gcc/dist/gcc/config/or1k/linux-elf.h \
src/external/gpl3/gcc/dist/gcc/config/or1k/linux-gas.h \
src/external/gpl3/gcc/dist/gcc/config/or1k/or1k-modes.def \
src/external/gpl3/gcc/dist/gcc/config/or1k/or1k-opts.h \
src/external/gpl3/gcc/dist/gcc/config/or1k/or1k-protos.h \
src/external/gpl3/gcc/dist/gcc/config/or1k/or1k.h \
src/external/gpl3/gcc/dist/gcc/config/or1k/or1k.md \
src/external/gpl3/gcc/dist/gcc/config/or1k/or1k.opt \
src/external/gpl3/gcc/dist/gcc/config/or1k/predicates.md \
src/external/gpl3/gcc/dist/gcc/config/or1k/t-linux \
src/external/gpl3/gcc/dist/gcc/config/or1k/t-or1k \
src/external/gpl3/gcc/dist/gcc/config/or1k/t-or1knd
cvs rdiff -u -r1.3 -r0 src/external/gpl3/gcc/dist/gcc/config/or1k/netbsd.h
cvs rdiff -u -r1.2 -r0 src/external/gpl3/gcc/dist/gcc/config/or1k/or1k.c

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config

2019-10-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Oct  1 22:44:18 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/powerpcspe: powerpcspe.c
src/external/gpl3/gcc/dist/gcc/config/rs6000: rs6000.c

Log Message:
merge GCC 8.3.

XXX: our change for e500 has moved into 'powerpcspe' port, which has
XXX: been marked deprecated in GCC 8.  this may affect what ppc ports
XXX: can update to GCC 8 easily, and we may need to add support for
XXX: 'powerpcspe' while we can.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gcc/dist/gcc/config/powerpcspe/powerpcspe.c
cvs rdiff -u -r1.20 -r1.21 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c

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



CVS commit: src/external/gpl3/gcc/dist/gcc/doc

2019-10-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Oct  1 22:42:00 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/doc: cpp.1 cpp.info cppinternals.info
g++.1 gcc.1 gcc.info gccinstall.info gccint.info gcov-tool.1 gcov.1

Log Message:
regen for GCC 8.3 and our changes.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc/dist/gcc/doc/cpp.1 \
src/external/gpl3/gcc/dist/gcc/doc/cpp.info \
src/external/gpl3/gcc/dist/gcc/doc/g++.1 \
src/external/gpl3/gcc/dist/gcc/doc/gcc.1 \
src/external/gpl3/gcc/dist/gcc/doc/gcc.info \
src/external/gpl3/gcc/dist/gcc/doc/gcov.1
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gcc/dist/gcc/doc/cppinternals.info \
src/external/gpl3/gcc/dist/gcc/doc/gccinstall.info \
src/external/gpl3/gcc/dist/gcc/doc/gccint.info
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gcc/dist/gcc/doc/gcov-tool.1

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

diffs are larger than 1MB and have been omitted


CVS commit: src/external/gpl3/gcc/dist/gcc/doc

2019-10-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Oct  1 22:42:00 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/doc: cpp.1 cpp.info cppinternals.info
g++.1 gcc.1 gcc.info gccinstall.info gccint.info gcov-tool.1 gcov.1

Log Message:
regen for GCC 8.3 and our changes.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc/dist/gcc/doc/cpp.1 \
src/external/gpl3/gcc/dist/gcc/doc/cpp.info \
src/external/gpl3/gcc/dist/gcc/doc/g++.1 \
src/external/gpl3/gcc/dist/gcc/doc/gcc.1 \
src/external/gpl3/gcc/dist/gcc/doc/gcc.info \
src/external/gpl3/gcc/dist/gcc/doc/gcov.1
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gcc/dist/gcc/doc/cppinternals.info \
src/external/gpl3/gcc/dist/gcc/doc/gccinstall.info \
src/external/gpl3/gcc/dist/gcc/doc/gccint.info
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gcc/dist/gcc/doc/gcov-tool.1

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



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-10-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Oct  1 21:17:28 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: Makefile.in file-prefix-map.c final.c
src/external/gpl3/gcc/dist/gcc/c-family: c-opts.c

Log Message:
merge debug/file prefix/merge stuff with upstream, which has gained
a lot of the same features.  builds, but may not actually run right.
adjust for add_path()'s SYSTEM -> INC_SYSTEM.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/external/gpl3/gcc/dist/gcc/Makefile.in
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/gcc/file-prefix-map.c
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gcc/dist/gcc/final.c
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gcc/dist/gcc/c-family/c-opts.c

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



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-10-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Oct  1 21:17:28 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: Makefile.in file-prefix-map.c final.c
src/external/gpl3/gcc/dist/gcc/c-family: c-opts.c

Log Message:
merge debug/file prefix/merge stuff with upstream, which has gained
a lot of the same features.  builds, but may not actually run right.
adjust for add_path()'s SYSTEM -> INC_SYSTEM.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/external/gpl3/gcc/dist/gcc/Makefile.in
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/gcc/file-prefix-map.c
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gcc/dist/gcc/final.c
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gcc/dist/gcc/c-family/c-opts.c

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/gcc/dist/gcc/Makefile.in
diff -u src/external/gpl3/gcc/dist/gcc/Makefile.in:1.18 src/external/gpl3/gcc/dist/gcc/Makefile.in:1.19
--- src/external/gpl3/gcc/dist/gcc/Makefile.in:1.18	Tue Oct  1 10:38:16 2019
+++ src/external/gpl3/gcc/dist/gcc/Makefile.in	Tue Oct  1 21:17:27 2019
@@ -1955,6 +1955,7 @@ CPP_SELFTEST_DEPS = cc1plus$(exeext) $(S
 selftest: s-selftest-c
 
 # C selftests
+C_SELFTEST_DEPS = 
 s-selftest-c: $(C_SELFTEST_DEPS)
 	@echo "NOT REBUILDING $@"
 NetBSD_DISABLED_s-selftest:

Index: src/external/gpl3/gcc/dist/gcc/file-prefix-map.c
diff -u src/external/gpl3/gcc/dist/gcc/file-prefix-map.c:1.1.1.1 src/external/gpl3/gcc/dist/gcc/file-prefix-map.c:1.2
--- src/external/gpl3/gcc/dist/gcc/file-prefix-map.c:1.1.1.1	Tue Oct  1 09:36:24 2019
+++ src/external/gpl3/gcc/dist/gcc/file-prefix-map.c	Tue Oct  1 21:17:28 2019
@@ -123,6 +123,7 @@ remap_macro_filename (const char *filena
   return remap_filename (macro_prefix_maps, filename);
 }
 
+#ifndef __NetBSD__
 /* Remap using -fdebug-prefix-map.  Return the GC-allocated new name
corresponding to FILENAME or FILENAME if no remapping was performed.  */
 const char *
@@ -130,3 +131,111 @@ remap_debug_filename (const char *filena
 {
   return remap_filename (debug_prefix_maps, filename);
 }
+#else
+
+/* Perform user-specified mapping of debug filename prefixes.  Return
+   the new name corresponding to FILENAME.  */
+
+static const char *
+remap_debug_prefix_filename (const char *filename)
+{
+  file_prefix_map *map;
+  char *s;
+  const char *name;
+  size_t name_len;
+
+  for (map = debug_prefix_maps; map; map = map->next)
+if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
+  break;
+  if (!map)
+return filename;
+  name = filename + map->old_len;
+  name_len = strlen (name) + 1;
+  s = (char *) alloca (name_len + map->new_len);
+  memcpy (s, map->new_prefix, map->new_len);
+  memcpy (s + map->new_len, name, name_len);
+  return ggc_strdup (s);
+}
+
+#include 
+
+typedef struct debug_regex_map
+{
+  regex_t re;
+  const char *sub;
+  struct debug_regex_map *next;
+} debug_regex_map;
+
+/* Linked list of such structures.  */
+debug_regex_map *debug_regex_maps;
+
+
+/* Record a debug file regex mapping.  ARG is the argument to
+   -fdebug-regex-map and must be of the form OLD=NEW.  */
+
+void
+add_debug_regex_map (const char *arg)
+{
+  debug_regex_map *map;
+  const char *p;
+  char *old;
+  char buf[1024];
+  regex_t re;
+  int e;
+
+  p = strchr (arg, '=');
+  if (!p)
+{
+  error ("invalid argument %qs to -fdebug-regex-map", arg);
+  return;
+}
+  
+  old = xstrndup (arg, p - arg);
+  if ((e = regcomp(, old, REG_EXTENDED)) != 0)
+{
+  regerror(e, , buf, sizeof(buf));
+  warning (0, "regular expression compilation for %qs in argument to "
+	   "-fdebug-regex-map failed: %qs", old, buf);
+  free(old);
+  return;
+}
+  free(old);
+
+  map = XNEW (debug_regex_map);
+  map->re = re;
+  p++;
+  map->sub = xstrdup (p);
+  map->next = debug_regex_maps;
+  debug_regex_maps = map;
+}
+
+extern "C" ssize_t regasub(char **, const char *,
+  const regmatch_t *rm, const char *);
+
+/* Perform user-specified mapping of debug filename regular expressions.  Return
+   the new name corresponding to FILENAME.  */
+
+static const char *
+remap_debug_regex_filename (const char *filename)
+{
+  debug_regex_map *map;
+  char *s;
+  regmatch_t rm[10];
+
+  for (map = debug_regex_maps; map; map = map->next)
+if (regexec (>re, filename, 10, rm, 0) == 0
+   && regasub (, map->sub, rm, filename) >= 0)
+  {
+	 const char *name = ggc_strdup(s);
+	 free(s);
+	 return name;
+  }
+  return filename;
+}
+
+const char *
+remap_debug_filename (const char *filename)
+{
+   return remap_debug_regex_filename (remap_debug_prefix_filename (filename));
+}
+#endif

Index: src/external/gpl3/gcc/dist/gcc/final.c
diff -u src/external/gpl3/gcc/dist/gcc/final.c:1.10 src/external/gpl3/gcc/dist/gcc/final.c:1.11
--- src/external/gpl3/gcc/dist/gcc/final.c:1.10	Tue Oct  1 10:38:16 2019
+++ 

CVS commit: src/external/gpl3/gcc/dist/gcc

2019-09-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Sep 22 23:34:13 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: cppbuiltin.c

Log Message:
Add LSan and UBSan specific preprocessor macros

__SANITIZE_LEAK__ patch:
https://gcc.gnu.org/ml/gcc-patches/2019-09/msg01270.html

__SANITIZE_UNDEFINED__
https://gcc.gnu.org/ml/gcc-patches/2019-09/msg01286.html

GCC upstream does not see value in feature parity with LLVM sanitizers.
For the time being this will be a NetBSD specific extension.

__SANITIZE_LEAK__ is needed for __NO_LEAKS in 
__SANITIZE_UNDEFINED__ is planned to be reused in the kernel headers.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/gpl3/gcc/dist/gcc/cppbuiltin.c

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



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-09-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Sep 22 23:34:13 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: cppbuiltin.c

Log Message:
Add LSan and UBSan specific preprocessor macros

__SANITIZE_LEAK__ patch:
https://gcc.gnu.org/ml/gcc-patches/2019-09/msg01270.html

__SANITIZE_UNDEFINED__
https://gcc.gnu.org/ml/gcc-patches/2019-09/msg01286.html

GCC upstream does not see value in feature parity with LLVM sanitizers.
For the time being this will be a NetBSD specific extension.

__SANITIZE_LEAK__ is needed for __NO_LEAKS in 
__SANITIZE_UNDEFINED__ is planned to be reused in the kernel headers.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/gpl3/gcc/dist/gcc/cppbuiltin.c

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/gcc/dist/gcc/cppbuiltin.c
diff -u src/external/gpl3/gcc/dist/gcc/cppbuiltin.c:1.1.1.4 src/external/gpl3/gcc/dist/gcc/cppbuiltin.c:1.2
--- src/external/gpl3/gcc/dist/gcc/cppbuiltin.c:1.1.1.4	Sat Jan 19 10:14:18 2019
+++ src/external/gpl3/gcc/dist/gcc/cppbuiltin.c	Sun Sep 22 23:34:13 2019
@@ -93,6 +93,12 @@ define_builtin_macros_for_compilation_fl
   if (flag_sanitize & SANITIZE_ADDRESS)
 cpp_define (pfile, "__SANITIZE_ADDRESS__");
 
+  if (flag_sanitize & SANITIZE_UNDEFINED)
+cpp_define (pfile, "__SANITIZE_UNDEFINED__");
+
+  if (flag_sanitize & SANITIZE_LEAK)
+cpp_define (pfile, "__SANITIZE_LEAK__");
+
   if (flag_sanitize & SANITIZE_THREAD)
 cpp_define (pfile, "__SANITIZE_THREAD__");
 



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-09-14 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Sep 14 15:02:47 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: ira-color.c

Log Message:
Initialize the mode before accessing the move costs.
This matches the code of the rest of the file, and might be acceptable
by upstream.

PR toolchain/53176.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gcc/dist/gcc/ira-color.c

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



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-09-14 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Sep 14 15:02:47 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: ira-color.c

Log Message:
Initialize the mode before accessing the move costs.
This matches the code of the rest of the file, and might be acceptable
by upstream.

PR toolchain/53176.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gcc/dist/gcc/ira-color.c

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/gcc/dist/gcc/ira-color.c
diff -u src/external/gpl3/gcc/dist/gcc/ira-color.c:1.4 src/external/gpl3/gcc/dist/gcc/ira-color.c:1.5
--- src/external/gpl3/gcc/dist/gcc/ira-color.c:1.4	Sat Sep 14 15:00:04 2019
+++ src/external/gpl3/gcc/dist/gcc/ira-color.c	Sat Sep 14 15:02:47 2019
@@ -2771,6 +2771,7 @@ allocno_copy_cost_saving (ira_allocno_t 
 	}
   else
 	gcc_unreachable ();
+  ira_init_register_move_cost_if_necessary(allocno_mode);
   cost += cp->freq * ira_register_move_cost[allocno_mode][rclass][rclass];
 }
   return cost;



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-09-14 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Sep 14 15:00:05 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: ira-color.c

Log Message:
Revert ira-color.c r1.2.

"VAX does not fully populate the register move costs table, so do not
access it w/o checks.
Hack to work around PR toolchain/53176."

Will commit a more upstream-friendly variant shortly.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gcc/dist/gcc/ira-color.c

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



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-09-14 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Sep 14 15:00:05 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: ira-color.c

Log Message:
Revert ira-color.c r1.2.

"VAX does not fully populate the register move costs table, so do not
access it w/o checks.
Hack to work around PR toolchain/53176."

Will commit a more upstream-friendly variant shortly.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gcc/dist/gcc/ira-color.c

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/gcc/dist/gcc/ira-color.c
diff -u src/external/gpl3/gcc/dist/gcc/ira-color.c:1.3 src/external/gpl3/gcc/dist/gcc/ira-color.c:1.4
--- src/external/gpl3/gcc/dist/gcc/ira-color.c:1.3	Sat Jan 19 12:10:04 2019
+++ src/external/gpl3/gcc/dist/gcc/ira-color.c	Sat Sep 14 15:00:04 2019
@@ -2771,13 +2771,7 @@ allocno_copy_cost_saving (ira_allocno_t 
 	}
   else
 	gcc_unreachable ();
-  cost += cp->freq *
-(   ira_register_move_cost
- && ira_register_move_cost[allocno_mode]
-	 && ira_register_move_cost[allocno_mode][rclass]
-	)
-	   ? ira_register_move_cost[allocno_mode][rclass][rclass] 
-	   : 0;
+  cost += cp->freq * ira_register_move_cost[allocno_mode][rclass][rclass];
 }
   return cost;
 }



Re: CVS commit: src/external/gpl3/gcc/dist/gcc, vax crashes

2019-08-29 Thread maya
For future reference, proably by me:

Reproducer for the crash without the local diff:

#!/bin/sh

cat << EOF > oacc.i
int a, b;
int e() {
  short *c = 0;
  char d = c[a + 1];
  b = d;
  a += 2;
}
EOF
vax--netbsdelf-gcc -O2 -c oacc.i


This hits an assertion:
emit-rtl.c:2310 gcc_assert (memory_address_addr_space_p (mode, addr, as));
This points to vax code, vax_legitimate_address_p.
This function might not handle some addressing modes, possibly one of
these two:
   c:   b0 40 9f 02 movw *0x2[r0],r1
   c:   98 40 a0 02 cvtbl 0x2(r0)[r0],15 


CVS commit: src/external/gpl3/gcc/dist/gcc

2019-08-29 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Aug 29 11:45:29 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: dse.c reload.c

Log Message:
Don't keep our local modifications as ifdef __NetBSD__.
When we build netbsd on another OS, we produce a cross compiler without
these definitions.

Fixes some compiler crashes when building netbsd/vax on linux.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gcc/dist/gcc/dse.c
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gcc/dist/gcc/reload.c

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/gcc/dist/gcc/dse.c
diff -u src/external/gpl3/gcc/dist/gcc/dse.c:1.9 src/external/gpl3/gcc/dist/gcc/dse.c:1.10
--- src/external/gpl3/gcc/dist/gcc/dse.c:1.9	Sat Jan 19 12:10:04 2019
+++ src/external/gpl3/gcc/dist/gcc/dse.c	Thu Aug 29 11:45:29 2019
@@ -290,7 +290,7 @@ static unsigned HOST_WIDE_INT
 lowpart_bitmask (int n)
 {
   unsigned HOST_WIDE_INT mask = HOST_WIDE_INT_M1U;
-#ifdef __NetBSD__ // XXXMRG
+#if 1 // XXXMRG
   gcc_assert(n >= 0 && n <= HOST_BITS_PER_WIDE_INT);
   if (n == 0)
 return 0;

Index: src/external/gpl3/gcc/dist/gcc/reload.c
diff -u src/external/gpl3/gcc/dist/gcc/reload.c:1.7 src/external/gpl3/gcc/dist/gcc/reload.c:1.8
--- src/external/gpl3/gcc/dist/gcc/reload.c:1.7	Sat Jan 19 12:10:04 2019
+++ src/external/gpl3/gcc/dist/gcc/reload.c	Thu Aug 29 11:45:29 2019
@@ -1148,7 +1148,7 @@ push_reload (rtx in, rtx out, rtx *inloc
 		   SUBREG_BYTE (in),
 		   GET_MODE (in)),
 			  REGNO (SUBREG_REG (in)));
-#ifdef __NetBSD__ // XXXMRG
+#if 1 // XXXMRG
   else if (REG_P (SUBREG_REG (in))
|| GET_CODE (SUBREG_REG (in)) == SYMBOL_REF)
 #else



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-08-29 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Aug 29 11:45:29 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: dse.c reload.c

Log Message:
Don't keep our local modifications as ifdef __NetBSD__.
When we build netbsd on another OS, we produce a cross compiler without
these definitions.

Fixes some compiler crashes when building netbsd/vax on linux.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gcc/dist/gcc/dse.c
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gcc/dist/gcc/reload.c

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config/arm

2019-06-12 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Jun 12 17:04:35 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/arm: netbsd-elf.h

Log Message:
Remove unused macro


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-elf.h

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config/arm

2019-06-12 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Jun 12 17:04:35 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/arm: netbsd-elf.h

Log Message:
Remove unused macro


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-elf.h

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/gcc/dist/gcc/config/arm/netbsd-elf.h
diff -u src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-elf.h:1.13 src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-elf.h:1.14
--- src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-elf.h:1.13	Sat Jan 19 12:10:05 2019
+++ src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-elf.h	Wed Jun 12 17:04:35 2019
@@ -170,9 +170,3 @@ while (0)
 
 #undef FPUTYPE_DEFAULT
 #define FPUTYPE_DEFAULT "vfp"
-
-/* Ensure that libgcc does not attempt to define __[CD]TOR_LIST__[] for APCS,
-   which belongs in crtbegin on NetBSD.  */
-#ifndef __ARM_EABI__
-#define CTOR_LISTS_DEFINED_EXTERNALLY
-#endif



CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2019-05-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat May 11 02:37:58 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: netbsd64.h

Log Message:
Switch PPC64 long double to 64 bits until the compiler is fixed.
XXX: This changes the ABI of the libraries.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h

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



re: CVS commit: src/external/gpl3/gcc/dist/gcc/config

2019-04-10 Thread matthew green
"Maya Rashish" writes:
> Module Name:  src
> Committed By: maya
> Date: Wed Apr 10 16:11:06 UTC 2019
> 
> Modified Files:
>   src/external/gpl3/gcc/dist/gcc/config: netbsd.h
> 
> Log Message:
> remove bogus specs redefinition.
> fixes the use of -march=native

please revert this.

the right fix is to fix the x86 specific code which i have
a change in testing for.


.mrg.


Re: CVS commit: src/external/gpl3/gcc/dist/gcc

2016-03-23 Thread Joerg Sonnenberger
On Wed, Mar 23, 2016 at 08:52:43AM -0400, Christos Zoulas wrote:
> 3) Removed definitions of EH_RETURN_STACKADJ_RTX and STARTING_FRAME_OFFSET
> from gcc/config/vax/elf.h. It's not necessary to remember the stack
> adjustment or to waste four bytes on every stack frame for a value
> that's not needed. Also remove the suspicious changes in
> gcc/config/vax/vax.md to the definitions of call_pop and call_value
> regarding DW_CFA_GNU_args_size and EH unwinding. I reverted to the
> previous versions from an older version of GCC, adding a few useful
> comments that had been removed.

The latter part seems quite wrong as the VAX calling convention
generally requires reading the argument size from the stack...

Joerg


Re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/i386

2013-01-03 Thread Joerg Sonnenberger
On Mon, Dec 31, 2012 at 10:08:18AM +, David Laight wrote:
 On Mon, Dec 31, 2012 at 03:00:42AM +0100, Joerg Sonnenberger wrote:
  On Sun, Dec 30, 2012 at 08:16:59PM +, David Laight wrote:
   Module Name:  src
   Committed By: dsl
   Date: Sun Dec 30 20:16:59 UTC 2012
   
   Modified Files:
 src/external/gpl3/gcc/dist/gcc/config/i386: i386.c
   
   Log Message:
   No need to check both TARGET_64BIT and ix86_preferred_stack_boundary = 
   64,
   if the former is true the latter is also true.
  
  At least in terms of documentation, this is a regression. TARGET_64BIT
  implies the presence of SSE support and that's somewhat independent of
  the separate preferred stack boundary
 
 Eh? TARGET_64BIT forces ix86_preferred_stack_boundary = 64.
 The fact that it also implies SSE support is relevant.

Only as default value, not if explicitly overriden?

Joerg


Re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/i386

2013-01-03 Thread David Laight
On Thu, Jan 03, 2013 at 03:46:08PM +0100, Joerg Sonnenberger wrote:
   
   At least in terms of documentation, this is a regression. TARGET_64BIT
   implies the presence of SSE support and that's somewhat independent of
   the separate preferred stack boundary
  
  Eh? TARGET_64BIT forces ix86_preferred_stack_boundary = 64.
  The fact that it also implies SSE support is relevant.
 
 Only as default value, not if explicitly overriden?

It won't let you override to a lower value.

David

-- 
David Laight: da...@l8s.co.uk


Re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/i386

2012-12-31 Thread David Laight
On Mon, Dec 31, 2012 at 03:00:42AM +0100, Joerg Sonnenberger wrote:
 On Sun, Dec 30, 2012 at 08:16:59PM +, David Laight wrote:
  Module Name:src
  Committed By:   dsl
  Date:   Sun Dec 30 20:16:59 UTC 2012
  
  Modified Files:
  src/external/gpl3/gcc/dist/gcc/config/i386: i386.c
  
  Log Message:
  No need to check both TARGET_64BIT and ix86_preferred_stack_boundary = 64,
  if the former is true the latter is also true.
 
 At least in terms of documentation, this is a regression. TARGET_64BIT
 implies the presence of SSE support and that's somewhat independent of
 the separate preferred stack boundary

Eh? TARGET_64BIT forces ix86_preferred_stack_boundary = 64.
The fact that it also implies SSE support is relevant.

David

-- 
David Laight: da...@l8s.co.uk


re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/i386

2012-12-31 Thread matthew green

 Module Name:  src
 Committed By: dsl
 Date: Sun Dec 30 20:16:59 UTC 2012
 
 Modified Files:
   src/external/gpl3/gcc/dist/gcc/config/i386: i386.c
 
 Log Message:
 No need to check both TARGET_64BIT and ix86_preferred_stack_boundary = 64,
 if the former is true the latter is also true.

can this not be overriden with cli options?  the old
test seems safer.


Re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/i386

2012-12-31 Thread David Laight
On Tue, Jan 01, 2013 at 02:06:31AM +1100, matthew green wrote:
 
  Module Name:src
  Committed By:   dsl
  Date:   Sun Dec 30 20:16:59 UTC 2012
  
  Modified Files:
  src/external/gpl3/gcc/dist/gcc/config/i386: i386.c
  
  Log Message:
  No need to check both TARGET_64BIT and ix86_preferred_stack_boundary = 64,
  if the former is true the latter is also true.
 
 can this not be overriden with cli options?  the old
 test seems safer.

No - for amd64 the ix86_preferred_stack_boundary is always = 64.

David

-- 
David Laight: da...@l8s.co.uk


Re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/i386

2012-12-30 Thread Joerg Sonnenberger
On Sun, Dec 30, 2012 at 08:16:59PM +, David Laight wrote:
 Module Name:  src
 Committed By: dsl
 Date: Sun Dec 30 20:16:59 UTC 2012
 
 Modified Files:
   src/external/gpl3/gcc/dist/gcc/config/i386: i386.c
 
 Log Message:
 No need to check both TARGET_64BIT and ix86_preferred_stack_boundary = 64,
 if the former is true the latter is also true.

At least in terms of documentation, this is a regression. TARGET_64BIT
implies the presence of SSE support and that's somewhat independent of
the separate preferred stack boundary

Joerg


Re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/i386

2012-10-08 Thread David Laight
On Sat, Oct 06, 2012 at 02:10:46PM +, Joerg Sonnenberger wrote:
 Module Name:  src
 Committed By: joerg
 Date: Sat Oct  6 14:10:46 UTC 2012
 
 Modified Files:
   src/external/gpl3/gcc/dist/gcc/config/i386: i386.h
 
 Log Message:
 PR 46978: ICE on spilling MMX registers
 
 GCC/i386 has code to lower the required alignment for long long to 32bit
 as the CPU doesn't need more. It is also using the same mode for setting
 up the MMX registers and in turn, the stack slots reserved for spilling
 require 32bit alignment. The actual vector types used keep the original
 64bit alignment, so when the compiler wants to spill a MMX register, it
 hits an assertion. Fix this by using the vector type as raw type for MMX
 registers.

Doesn't that enforce a 64bit alignment when it isn't needed?
Or have I misread the commit message?
Misaligned transfers for stack slots for MMX are actually fine.

Only the 128bit (and larger) accesses have to be aligned.

The performance penalty of misaligned 64bit transfers really is best
avoided by maintaining the stack alignment - and assuming it won't
get misaligned.

I suspect that the 'sub %sp,n' use to allocate a stack frame has
hardware optimisations that are absent from the 'and %sp,~7' needed
to realign it.

David

-- 
David Laight: da...@l8s.co.uk


Re: CVS commit: src/external/gpl3/gcc/dist/gcc

2012-09-16 Thread SAITOH Masanobu
(2012/09/16 16:26), SAITOH Masanobu wrote:
 Module Name:  src
 Committed By: msaitoh
 Date: Sun Sep 16 07:26:31 UTC 2012
 
 Modified Files:
   src/external/gpl3/gcc/dist/gcc: ChangeLog
   src/external/gpl3/gcc/dist/gcc/config/arm: arm.md
 
 Log Message:
 Fix gcc bugid 51408 for arm.
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gcc/dist/gcc/ChangeLog
 cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/gcc/config/arm/arm.md
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

Sorry, this change fixes PR#46972.


-- 
---
SAITOH Masanobu (msai...@execsw.org
 msai...@netbsd.org)


Re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/i386

2012-09-14 Thread David Laight
On Fri, Sep 14, 2012 at 01:00:01PM +, Joerg Sonnenberger wrote:
 Module Name:  src
 Committed By: joerg
 Date: Fri Sep 14 13:00:01 UTC 2012
 
 Modified Files:
   src/external/gpl3/gcc/dist/gcc/config/i386: i386.c netbsd-elf.h
   netbsd64.h
 
 Log Message:
 Fix GCC to correctly implement the i386 psABI on NetBSD.
 This consists of two parts:
 - for NetBSD/i386 and NetBSD/AMD64 with -m32, use a default stack
   alignment of 23bit as specified by the ABI
 - ensure that double and long long variables on the stack are by default
   only aligned to 32bit, if there is nothing else in the function
   needing a larger stack alignment
 
 The combination ensures that SSE variables on the stack trigger the
 realignment logic, but just using double or long long doesn't.
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.1.1.1 -r1.2 \
 src/external/gpl3/gcc/dist/gcc/config/i386/i386.c \
 src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h
 cvs rdiff -u -r1.2 -r1.3 \
 src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

I'm still to be convinced that the patches are correct.

David

-- 
David Laight: da...@l8s.co.uk