CVS commit: src/external/gpl3/gcc.old/dist/libstdc++-v3/config/io

2024-05-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon May 20 19:36:30 UTC 2024

Modified Files:
src/external/gpl3/gcc.old/dist/libstdc++-v3/config/io:
basic_file_stdio.cc

Log Message:
libstdc++: Don't try to fflush stdin in gcc.old libstdc++ either.

PR lib/58206
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114879


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/external/gpl3/gcc.old/dist/libstdc++-v3/config/io/basic_file_stdio.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.old/dist/libstdc++-v3/config/io/basic_file_stdio.cc
diff -u src/external/gpl3/gcc.old/dist/libstdc++-v3/config/io/basic_file_stdio.cc:1.13 src/external/gpl3/gcc.old/dist/libstdc++-v3/config/io/basic_file_stdio.cc:1.14
--- src/external/gpl3/gcc.old/dist/libstdc++-v3/config/io/basic_file_stdio.cc:1.13	Mon Feb 20 02:11:45 2023
+++ src/external/gpl3/gcc.old/dist/libstdc++-v3/config/io/basic_file_stdio.cc	Mon May 20 19:36:30 2024
@@ -190,7 +190,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   { this->close(); }
 
   __basic_file*
-  __basic_file::sys_open(__c_file* __file, ios_base::openmode)
+  __basic_file::sys_open(__c_file* __file, ios_base::openmode __mode)
   {
 __basic_file* __ret = NULL;
 if (!this->is_open() && __file)
@@ -199,7 +199,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	// POSIX guarantees that fflush sets errno on error, but C doesn't.
 	errno = 0;
 	do
-	  __err = fflush(__file);
+	  __err = (__mode == std::ios_base::in ? 0 : fflush(__file));
 	while (__err && errno == EINTR);
 	errno = __save_errno;
 	if (!__err)



CVS commit: src/external/gpl3/gcc.old/dist/libstdc++-v3/config/io

2024-05-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon May 20 19:36:30 UTC 2024

Modified Files:
src/external/gpl3/gcc.old/dist/libstdc++-v3/config/io:
basic_file_stdio.cc

Log Message:
libstdc++: Don't try to fflush stdin in gcc.old libstdc++ either.

PR lib/58206
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114879


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/external/gpl3/gcc.old/dist/libstdc++-v3/config/io/basic_file_stdio.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.old/dist/gcc/cp

2024-04-24 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Wed Apr 24 16:48:30 UTC 2024

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/cp: cfns.h

Log Message:
Fix gcc build on FreeBSD 14 (and possibly other systems using clang >= 16).

Pointed out by Eirik Øverby.

OK mrg@


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc.old/dist/gcc/cp/cfns.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.old/dist/gcc/cp/cfns.h
diff -u src/external/gpl3/gcc.old/dist/gcc/cp/cfns.h:1.11 src/external/gpl3/gcc.old/dist/gcc/cp/cfns.h:1.12
--- src/external/gpl3/gcc.old/dist/gcc/cp/cfns.h:1.11	Mon Feb 20 02:11:23 2023
+++ src/external/gpl3/gcc.old/dist/gcc/cp/cfns.h	Wed Apr 24 16:48:29 2024
@@ -60,7 +60,7 @@ public:
 };
 
 inline unsigned int
-libc_name::hash (register const char *str, register unsigned int len)
+libc_name::hash (const char *str, unsigned int len)
 {
   static const unsigned short asso_values[] =
 {
@@ -91,7 +91,7 @@ libc_name::hash (register const char *st
   1488, 1488, 1488, 1488, 1488, 1488, 1488, 1488, 1488, 1488,
   1488, 1488, 1488, 1488, 1488, 1488, 1488
 };
-  register int hval = len;
+  int hval = len;
 
   switch (hval)
 {
@@ -118,7 +118,7 @@ libc_name::hash (register const char *st
 }
 
 const struct libc_name_struct *
-libc_name::libc_name_p (register const char *str, register unsigned int len)
+libc_name::libc_name_p (const char *str, unsigned int len)
 {
   enum
 {
@@ -1116,15 +1116,15 @@ libc_name::libc_name_p (register const c
 
   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
 {
-  register int key = hash (str, len);
+  int key = hash (str, len);
 
   if (key <= MAX_HASH_VALUE && key >= 0)
 {
-  register int index = lookup[key];
+  int index = lookup[key];
 
   if (index >= 0)
 {
-  register const char *s = wordlist[index].name;
+  const char *s = wordlist[index].name;
 
   if (*str == *s && !strcmp (str + 1, s + 1))
 return [index];



CVS commit: src/external/gpl3/gcc.old/dist/gcc/cp

2024-04-24 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Wed Apr 24 16:48:30 UTC 2024

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/cp: cfns.h

Log Message:
Fix gcc build on FreeBSD 14 (and possibly other systems using clang >= 16).

Pointed out by Eirik Øverby.

OK mrg@


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc.old/dist/gcc/cp/cfns.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.old/dist/gcc

2023-12-18 Thread Kalvis Duckmanton
Module Name:src
Committed By:   kalvisd
Date:   Mon Dec 18 21:11:43 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/gcc: reload1.c

Log Message:
gcc.old: vax: gcc/reload1.c: PR port-vax/57646

Where an output register might be reloaded, and it is a memory
reference, and the address is auto-incremented, any previously
reloaded copy of the address must be invalidated.

XXXKD: Hidden within ``#ifdef NB_FIX_VAX_BACKEND'' and enabled
only for vax at the moment.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc.old/dist/gcc/reload1.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.old/dist/gcc

2023-12-18 Thread Kalvis Duckmanton
Module Name:src
Committed By:   kalvisd
Date:   Mon Dec 18 21:11:43 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/gcc: reload1.c

Log Message:
gcc.old: vax: gcc/reload1.c: PR port-vax/57646

Where an output register might be reloaded, and it is a memory
reference, and the address is auto-incremented, any previously
reloaded copy of the address must be invalidated.

XXXKD: Hidden within ``#ifdef NB_FIX_VAX_BACKEND'' and enabled
only for vax at the moment.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc.old/dist/gcc/reload1.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.old/dist/gcc/reload1.c
diff -u src/external/gpl3/gcc.old/dist/gcc/reload1.c:1.11 src/external/gpl3/gcc.old/dist/gcc/reload1.c:1.12
--- src/external/gpl3/gcc.old/dist/gcc/reload1.c:1.11	Mon Feb 20 02:11:07 2023
+++ src/external/gpl3/gcc.old/dist/gcc/reload1.c	Mon Dec 18 21:11:42 2023
@@ -8377,6 +8377,44 @@ emit_reload_insns (class insn_chain *cha
 		reg_last_reload_reg[out_regno + k] = 0;
 	}
 	}
+
+#ifdef NB_FIX_VAX_BACKEND
+#if AUTO_INC_DEC
+  /* Where an output register might be reloaded, and it is a
+	 memory reference, and the address is auto-incremented, any
+	 previously reloaded copy of the address must be
+	 invalidated. */
+  if (i < 0
+	  && rld[r].out != 0
+	  && MEM_P (rld[r].out))
+	{
+	  rtx out = XEXP (rld[r].out, 0); /* address expression */
+	  enum rtx_code code = GET_CODE (out);
+
+	  if (code != POST_INC && code != POST_DEC
+	  && code != PRE_INC && code != PRE_DEC)
+	{
+	  /* do nothing */
+	}
+	  else
+	{
+	  int out_regno = REGNO (XEXP (out, 0));
+	  machine_mode mode = GET_MODE (XEXP (out, 0));
+
+	  /* for the moment, handle only the case where out_regno
+		 is a hardware register */
+
+	  if (HARD_REGISTER_NUM_P (out_regno))
+		{
+		  int k, out_nregs = hard_regno_nregs (out_regno, mode);
+
+		  for (k = 0; k < out_nregs; k++)
+		reg_last_reload_reg[out_regno + k] = 0;
+		}
+	}
+	}
+#endif /* AUTO_INC_DEC */
+#endif
 }
   reg_reloaded_dead |= reg_reloaded_died;
 }



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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Oct  8 05:03:12 UTC 2023

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

Log Message:
gcc.old: Clarify PR port-vax/57646 patch [5/21]. NFC

Restore ``else'' in the original patch. NFC but better to fit into
upstream code here.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/gcc.old/dist/gcc/dse.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.old/dist/gcc

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Oct  8 05:03:12 UTC 2023

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

Log Message:
gcc.old: Clarify PR port-vax/57646 patch [5/21]. NFC

Restore ``else'' in the original patch. NFC but better to fit into
upstream code here.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/gcc.old/dist/gcc/dse.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.old/dist/gcc/dse.c
diff -u src/external/gpl3/gcc.old/dist/gcc/dse.c:1.15 src/external/gpl3/gcc.old/dist/gcc/dse.c:1.16
--- src/external/gpl3/gcc.old/dist/gcc/dse.c:1.15	Sun Oct  8 04:59:33 2023
+++ src/external/gpl3/gcc.old/dist/gcc/dse.c	Sun Oct  8 05:03:12 2023
@@ -1350,7 +1350,7 @@ all_positions_needed_p (store_info *s_in
   return true;
 }
 #ifdef NB_FIX_VAX_BACKEND
-  if (const_start >= HOST_BITS_PER_WIDE_INT || const_start < 0)
+  else if (const_start >= HOST_BITS_PER_WIDE_INT || const_start < 0)
 return true;
 #endif
   else



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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Oct  8 04:59:33 UTC 2023

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

Log Message:
gcc.old: Fix my regression for PR port-vax/57646 patch [5/21]

Add a part of the original diff provided by Kalvis Duckmanton,
which I carelessly dropped during NB_FIX_VAX_BACKEND addition.

Fix ICE in DSE phase for native GCC. Now, pkgsrc/lang/perl5
successfully builds again.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/gpl3/gcc.old/dist/gcc/dse.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.old/dist/gcc/dse.c
diff -u src/external/gpl3/gcc.old/dist/gcc/dse.c:1.14 src/external/gpl3/gcc.old/dist/gcc/dse.c:1.15
--- src/external/gpl3/gcc.old/dist/gcc/dse.c:1.14	Sat Oct  7 11:58:54 2023
+++ src/external/gpl3/gcc.old/dist/gcc/dse.c	Sun Oct  8 04:59:33 2023
@@ -298,7 +298,11 @@ public:
 /* Return a bitmask with the first N low bits set.  */
 
 static unsigned HOST_WIDE_INT
+#ifdef NB_FIX_VAX_BACKEND
+lowpart_bitmask (unsigned int n)
+#else
 lowpart_bitmask (int n)
+#endif
 {
   unsigned HOST_WIDE_INT mask = HOST_WIDE_INT_M1U;
 #ifdef NB_FIX_VAX_BACKEND



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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Oct  8 04:59:33 UTC 2023

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

Log Message:
gcc.old: Fix my regression for PR port-vax/57646 patch [5/21]

Add a part of the original diff provided by Kalvis Duckmanton,
which I carelessly dropped during NB_FIX_VAX_BACKEND addition.

Fix ICE in DSE phase for native GCC. Now, pkgsrc/lang/perl5
successfully builds again.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/gpl3/gcc.old/dist/gcc/dse.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.old/dist/gcc/config/vax

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:10:59 UTC 2023

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

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [21/21]

Define separate instruction patterns for extzv for the cases where the fiel
d width and offset happen to be a multiple of a byte or word.

If in PIC mode, and the source operand to extzv is a memory
reference, and the address of the memory location is an external
symbol, load the address into a temporary register before expanding
the instruction.

Adjust the constraints to the zero_extract instruction pattern to
disallow indexed source operands, as the VAX extzv instruction
computes offsets based on the size of a byte (not a word or a
longword)


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax/vax.md
diff -u src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.17 src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.18
--- src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.17	Sat Oct  7 12:10:38 2023
+++ src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md	Sat Oct  7 12:10:59 2023
@@ -827,32 +827,87 @@
   return \"movw %3,%0\";
 }")
 
-(define_insn ""
-  [(set (match_operand:SI 0 "nonimmediate_operand" "=")
-	(zero_extract:SI (match_operand:SI 1 "register_operand" "ro")
+;;
+;; Register source, field width is either 8 or 16, field start
+;; is zero - simple, this is a mov[bl].
+;;
+(define_insn "*extzvQISI"
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
+	(zero_extract:SI (match_operand:SI 1 "register_operand" "r")
 			 (match_operand:QI 2 "const_int_operand" "n")
 			 (match_operand:SI 3 "const_int_operand" "n")))]
-  "(INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16)
+  "INTVAL (operands[3]) == 0
+&& INTVAL (operands[2]) == GET_MODE_BITSIZE ( QImode )"
+  "movzbl %1, %0"
+)
+
+(define_insn "*extzvHISI"
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
+	(zero_extract:SI (match_operand:SI 1 "register_operand" "r")
+			 (match_operand:QI 2 "const_int_operand" "n")
+			 (match_operand:SI 3 "const_int_operand" "n")))]
+  "INTVAL (operands[3]) == 0
+&& INTVAL (operands[2]) == GET_MODE_BITSIZE ( HImode )"
+  "movzwl %1, %0"
+)
+
+;;
+;; Register source, field width is the entire register
+;;
+(define_insn "*extzvSISI"
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
+	(zero_extract:SI (match_operand:SI 1 "register_operand" "r")
+			 (match_operand:QI 2 "const_int_operand" "n")
+			 (match_operand:SI 3 "const_int_operand" "n")
+
+			 ))]
+  "INTVAL (operands[3]) == 0
+   && INTVAL (operands[2]) == GET_MODE_BITSIZE ( SImode )"
+  "*
+{
+  if (rtx_equal_p (operands[0], operands[1]))
+return \"\";  /* no-op */
+  return \"movl %1,%0\";
+}")
+
+;; Register source, non-zero field start is handled elsewhere
+
+;; Offsettable memory, field width 8 or 16, field start on
+;; boundary matching the field width.
+
+(define_insn "*extzvQISI2"
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
+	(zero_extract:SI (match_operand:SI 1 "memory_operand" "o")
+			 (match_operand:QI 2 "const_int_operand" "n")
+			 (match_operand:SI 3 "const_int_operand" "n")))]
+  "INTVAL (operands[2]) == 8
&& INTVAL (operands[3]) % INTVAL (operands[2]) == 0
-   && (REG_P (operands[1])
-   || (MEM_P (operands[1])
-  && ! mode_dependent_address_p (XEXP (operands[1], 0),
-  MEM_ADDR_SPACE (operands[1]"
+   && ! mode_dependent_address_p (XEXP (operands[1], 0),
+  MEM_ADDR_SPACE (operands[1]))"
   "*
 {
-  if (REG_P (operands[1]))
-{
-  if (INTVAL (operands[3]) != 0)
-	return \"extzv %3,%2,%1,%0\";
-}
-  else
-operands[1]
-  = adjust_address (operands[1],
-			INTVAL (operands[2]) == 8 ? QImode : HImode,
-			INTVAL (operands[3]) / 8);
+  operands[1]
+= adjust_address (operands[1],
+		  QImode,
+		  INTVAL (operands[3]) / 8);
+  return \"movzbl %1,%0\";
+}")
 
-  if (INTVAL (operands[2]) == 8)
-return \"movzbl %1,%0\";
+(define_insn "*extzvHISI2"
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
+	(zero_extract:SI (match_operand:SI 1 "memory_operand" "o")
+			 (match_operand:QI 2 "const_int_operand" "n")
+			 (match_operand:SI 3 "const_int_operand" "n")))]
+  "INTVAL (operands[2]) == 16
+   && INTVAL (operands[3]) % INTVAL (operands[2]) == 0
+   && ! mode_dependent_address_p (XEXP (operands[1], 0),
+  MEM_ADDR_SPACE (operands[1]))"
+  "*
+{
+  operands[1]
+= adjust_address (operands[1],
+  HImode,
+  INTVAL (operands[3]) / 8);
   return \"movzwl %1,%0\";
 }")
 
@@ -929,17 +984,26 @@
   return \"rotl %R3,%1,%0\;cvtwl %0,%0\";
 }")
 
+;; When the field position and size 

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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:10:59 UTC 2023

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

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [21/21]

Define separate instruction patterns for extzv for the cases where the fiel
d width and offset happen to be a multiple of a byte or word.

If in PIC mode, and the source operand to extzv is a memory
reference, and the address of the memory location is an external
symbol, load the address into a temporary register before expanding
the instruction.

Adjust the constraints to the zero_extract instruction pattern to
disallow indexed source operands, as the VAX extzv instruction
computes offsets based on the size of a byte (not a word or a
longword)


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:10:38 UTC 2023

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

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [20/21]

If in PIC mode, and the source operand to extv is a memory reference, and th
e address of the memory location is an external symbol, load the address into a
temporary register before expanding the instruction.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax/vax.md
diff -u src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.16 src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.17
--- src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.16	Sat Oct  7 12:10:18 2023
+++ src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md	Sat Oct  7 12:10:38 2023
@@ -982,7 +982,40 @@
   ""
   "cmpzv %2,%1,%0,%3")
 
-(define_insn "extv"
+(define_expand "extv"
+  [(set (match_operand:SI 0 "general_operand" "")
+	(sign_extract:SI (match_dup 4)
+			 (match_operand:QI 2 "general_operand" "")
+			 (match_operand:SI 3 "general_operand" ""))
+   )]
+  ""
+  "{
+  /*
+   * If the source operand is a memory reference, and the address
+   * is a symbol, and we're in PIC mode, load the address into a
+   * register.  Don't evaluate the field start or width at this time.
+   */
+  operands[4] = operands[1];
+  if (flag_pic
+   /* && !reload_completed */
+	  && MEM_P (operands[1])
+	  && !mode_dependent_address_p (XEXP (operands[1], 0),
+	MEM_ADDR_SPACE (operands[1]))
+  && SYMBOL_REF_P (XEXP (operands[1], 0))
+	  && !SYMBOL_REF_LOCAL_P (XEXP (operands[1], 0))
+	 )
+	{
+	  rtx address = XEXP (operands[1], 0);
+	  rtx temp = gen_reg_rtx (Pmode);
+	  emit_move_insn (temp, address);
+	  /* copy the original memory reference, replacing the address */
+	  operands[4] = change_address (operands[1], VOIDmode, temp);
+	  set_mem_align (operands[4], MEM_ALIGN (operands[1]));
+	}
+  }"
+)
+
+(define_insn ""
   [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
 	(sign_extract:SI (match_operand:QI 1 "memory_operand" "m")
 			 (match_operand:QI 2 "general_operand" "g")



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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:10:38 UTC 2023

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

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [20/21]

If in PIC mode, and the source operand to extv is a memory reference, and th
e address of the memory location is an external symbol, load the address into a
temporary register before expanding the instruction.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:10:18 UTC 2023

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

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [19/21]

If in PIC mode, and the source operand to insv is a memory reference,
and the address of the memory location is an external symbol, load the
address into a temporary register before expanding the instruction.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:10:18 UTC 2023

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

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [19/21]

If in PIC mode, and the source operand to insv is a memory reference,
and the address of the memory location is an external symbol, load the
address into a temporary register before expanding the instruction.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax/vax.md
diff -u src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.15 src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.16
--- src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.15	Sat Oct  7 12:10:02 2023
+++ src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md	Sat Oct  7 12:10:18 2023
@@ -1058,12 +1058,36 @@
 }")
 
 (define_expand "insv"
-  [(set (zero_extract:SI (match_operand:SI 0 "general_operand" "")
+  [(set (zero_extract:SI (match_dup 4)
 			 (match_operand:QI 1 "general_operand" "")
 			 (match_operand:SI 2 "general_operand" ""))
 	(match_operand:SI 3 "general_operand" ""))]
   ""
-  "")
+  "{
+/*
+ * If the destination operand is a memory reference, and the address
+ * is a symbol, and we're in PIC mode, load the address into a
+ * register.  Don't evaluate the field start or width at this time.
+ */
+operands[4] = operands[0];
+if (flag_pic
+ /*	&& !reload_completed */
+	&& MEM_P (operands[0])
+	&& !mode_dependent_address_p (XEXP (operands[0], 0),
+   MEM_ADDR_SPACE (operands[0]))
+	&& SYMBOL_REF_P (XEXP (operands[0], 0))
+	&& !SYMBOL_REF_LOCAL_P (XEXP (operands[0], 0))
+   )
+  {
+	rtx address = XEXP (operands[0], 0);
+	rtx temp = gen_reg_rtx (Pmode);
+	emit_move_insn (temp, address);
+	/* copy the original memory reference, replacing the address */
+	operands[4] = change_address (operands[0], VOIDmode, temp);
+	set_mem_align (operands[4], MEM_ALIGN (operands[0]));
+  }
+
+  }")
 
 (define_insn ""
   [(set (zero_extract:SI (match_operand:QI 0 "memory_operand" "+g")



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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:10:02 UTC 2023

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

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [18/21]

use the extzv instruction pattern for logical shifts right


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax/vax.md
diff -u src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.14 src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.15
--- src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.14	Sat Oct  7 12:01:43 2023
+++ src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md	Sat Oct  7 12:10:02 2023
@@ -733,7 +733,7 @@
 	(minus:QI (const_int 32)
 		  (match_dup 4)))
(set (match_operand:SI 0 "nonimmediate_operand" "=g")
-	(zero_extract:SI (match_operand:SI 1 "register_operand" "r")
+	(zero_extract:SI (match_operand:SI 1 "general_operand" "g")
 			 (match_dup 3)
 			 (match_operand:SI 2 "register_operand" "g")))]
   ""
@@ -741,6 +741,10 @@
 {
   operands[3] = gen_reg_rtx (QImode);
   operands[4] = gen_lowpart (QImode, operands[2]);
+  operands[4] = gen_rtx_MINUS (QImode, GEN_INT (32), operands[4]);
+  emit_move_insn (operands[3], operands[4]);
+  emit_insn (gen_extzv (operands[0], operands[1], operands[3], operands[2]));
+  DONE;
 }")
 
 ;; Rotate right on the VAX works by negating the shift count.



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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:10:02 UTC 2023

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

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [18/21]

use the extzv instruction pattern for logical shifts right


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:09:28 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/config/vax: builtins.md

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [17/20]

Fix the __sync_lock_test_and_set() builtin


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/builtins.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.old/dist/gcc/config/vax/builtins.md
diff -u src/external/gpl3/gcc.old/dist/gcc/config/vax/builtins.md:1.12 src/external/gpl3/gcc.old/dist/gcc/config/vax/builtins.md:1.13
--- src/external/gpl3/gcc.old/dist/gcc/config/vax/builtins.md:1.12	Sat Oct  7 12:09:06 2023
+++ src/external/gpl3/gcc.old/dist/gcc/config/vax/builtins.md	Sat Oct  7 12:09:28 2023
@@ -82,7 +82,7 @@
 
   label = gen_label_rtx ();
   emit_move_insn (operands[0], const1_rtx);
-  emit_jump_insn (gen_jbbssi (operands[1], const0_rtx, label, operands[1]));
+  emit_jump_insn (gen_jbbssi (operands[1], const0_rtx, label));
   emit_move_insn (operands[0], const0_rtx);
   emit_label (label);
   DONE;
@@ -92,13 +92,13 @@
   [(parallel
 [(set (pc)
 	  (if_then_else
-	(ne (zero_extract:SI (match_operand:QI 0 "volatile_mem_operand" "g")
+	(ne (zero_extract:SI (match_operand:QI 0 "volatile_mem_operand" "+g")
  (const_int 1)
  (match_operand:SI 1 "general_operand" "nrm"))
 		(const_int 0))
 	(label_ref (match_operand 2 "" ""))
 	(pc)))
- (set (zero_extract:SI (match_operand:QI 3 "volatile_mem_operand" "+0")
+ (set (zero_extract:SI (match_dup 0)
 			   (const_int 1)
 			   (match_dup 1))
 	  (const_int 1))])]
@@ -109,13 +109,13 @@
   [(parallel
 [(set (pc)
 	  (if_then_else
-	(ne (zero_extract:SI (match_operand:HI 0 "volatile_mem_operand" "Q")
+	(ne (zero_extract:SI (match_operand:HI 0 "volatile_mem_operand" "+Q")
  (const_int 1)
  (match_operand:SI 1 "general_operand" "nrm"))
 		(const_int 0))
 	(label_ref (match_operand 2 "" ""))
 	(pc)))
- (set (zero_extract:SI (match_operand:HI 3 "volatile_mem_operand" "+0")
+ (set (zero_extract:SI (match_dup 0)
 			   (const_int 1)
 			   (match_dup 1))
 	  (const_int 1))])]
@@ -126,13 +126,13 @@
   [(parallel
 [(set (pc)
 	  (if_then_else
-	(ne (zero_extract:SI (match_operand:SI 0 "volatile_mem_operand" "Q")
+	(ne (zero_extract:SI (match_operand:SI 0 "volatile_mem_operand" "+Q")
  (const_int 1)
  (match_operand:SI 1 "general_operand" "nrm"))
 		(const_int 0))
 	(label_ref (match_operand 2 "" ""))
 	(pc)))
- (set (zero_extract:SI (match_operand:SI 3 "volatile_mem_operand" "+0")
+ (set (zero_extract:SI (match_dup 0)
 			   (const_int 1)
 			   (match_dup 1))
 	  (const_int 1))])]



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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:09:28 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/config/vax: builtins.md

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [17/20]

Fix the __sync_lock_test_and_set() builtin


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/builtins.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.old/dist/gcc/config/vax

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:09:06 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/config/vax: builtins.md

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [16/21]

PR port-vax/50384: NetBSD/vax 7.0 gcc-4.8.4 gets ICE by SIGILL

Fix for https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=50384
as encountered in gcc 7 in NetBSD 7.

VAX's FFS instruction as used in GCC's count_zero and ffssi2 instructions
uses the Z flag to indicate whether a set bit was found or not; GCC expects
the Z flag to consistently indicate whether the result is zero.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/builtins.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.old/dist/gcc/config/vax

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:09:06 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/config/vax: builtins.md

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [16/21]

PR port-vax/50384: NetBSD/vax 7.0 gcc-4.8.4 gets ICE by SIGILL

Fix for https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=50384
as encountered in gcc 7 in NetBSD 7.

VAX's FFS instruction as used in GCC's count_zero and ffssi2 instructions
uses the Z flag to indicate whether a set bit was found or not; GCC expects
the Z flag to consistently indicate whether the result is zero.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/builtins.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.old/dist/gcc/config/vax/builtins.md
diff -u src/external/gpl3/gcc.old/dist/gcc/config/vax/builtins.md:1.11 src/external/gpl3/gcc.old/dist/gcc/config/vax/builtins.md:1.12
--- src/external/gpl3/gcc.old/dist/gcc/config/vax/builtins.md:1.11	Mon Feb 20 02:11:22 2023
+++ src/external/gpl3/gcc.old/dist/gcc/config/vax/builtins.md	Sat Oct  7 12:09:06 2023
@@ -32,12 +32,15 @@
 
 (define_expand "ffssi2"
   [(set (match_operand:SI 0 "nonimmediate_operand" "")
-	(ffs:SI (match_operand:SI 1 "general_operand" "")))]
+	(ffs:SI (match_operand:SI 1 "general_operand" "")))
+   (set (cc0)
+	 (compare (match_dup 0) (const_int 0)))
+	 ]
   ""
   "
 {
   rtx label = gen_label_rtx ();
-  emit_insn (gen_ctzsi2 (operands[0], operands[1]));
+  emit_insn (gen_count_zero (operands[0], operands[1]));
   emit_jump_insn (gen_condjump (gen_rtx_NE(VOIDmode, cc0_rtx, const0_rtx), label));
   emit_move_insn (operands[0], constm1_rtx);
   emit_label (label);
@@ -48,7 +51,19 @@
 (define_insn "ctzsi2"
   [(set (match_operand:SI 0 "nonimmediate_operand" "=rQ")
 	(ctz:SI (match_operand:SI 1 "general_operand" "nrQT")))
-   (set (cc0) (match_dup 0))]
+(set (cc0)
+	 (compare (match_dup 0) (const_int 0)))
+   ]
+  ""
+  "ffs $0,$32,%1,%0\;tstl %0")
+
+(define_insn "count_zero"
+  [ (set (match_operand:SI 0 "nonimmediate_operand" "")
+ (ctz:SI (match_operand:SI 1 "general_operand" "")))
+(set (cc0)
+	 (compare (match_dup 0)
+		  (const_int 33)))
+  ]
   ""
   "ffs $0,$32,%1,%0")
 



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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:07:59 UTC 2023

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

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [15/21]

enable use of gas(1) directives to generate the CFI table.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax/vax.c
diff -u src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.18 src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.19
--- src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.18	Sat Oct  7 12:07:37 2023
+++ src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c	Sat Oct  7 12:07:59 2023
@@ -155,8 +155,6 @@ vax_option_override (void)
   if (TARGET_G_FLOAT)
 REAL_MODE_FORMAT (DFmode) = _g_format;
 
-  flag_dwarf2_cfi_asm = 0;
-
 #ifdef SUBTARGET_OVERRIDE_OPTIONS
   SUBTARGET_OVERRIDE_OPTIONS;
 #endif



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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:07:59 UTC 2023

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

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [15/21]

enable use of gas(1) directives to generate the CFI table.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:07:37 UTC 2023

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

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [14/21]

Add a TARGET_INIT_BUILTINS hook (required to be able to compile gfortran)


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax/vax.c
diff -u src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.17 src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.18
--- src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.17	Sat Oct  7 12:05:35 2023
+++ src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c	Sat Oct  7 12:07:37 2023
@@ -46,6 +46,7 @@ along with GCC; see the file COPYING3.  
 #include "target-def.h"
 
 static void vax_option_override (void);
+static void vax_init_builtins (void);
 static bool vax_legitimate_address_p (machine_mode, rtx, bool);
 static void vax_file_start (void);
 static void vax_init_libfuncs (void);
@@ -77,6 +78,9 @@ static int vax_bitfield_may_trap_p (cons
 #undef TARGET_INIT_LIBFUNCS
 #define TARGET_INIT_LIBFUNCS vax_init_libfuncs
 
+#undef TARGET_INIT_BUILTINS
+#define TARGET_INIT_BUILTINS vax_init_builtins
+
 #undef TARGET_ASM_OUTPUT_MI_THUNK
 #define TARGET_ASM_OUTPUT_MI_THUNK vax_output_mi_thunk
 #undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
@@ -157,6 +161,15 @@ vax_option_override (void)
   SUBTARGET_OVERRIDE_OPTIONS;
 #endif
 }
+/* Implement the TARGET_INIT_BUILTINS target hook.  */
+
+static void
+vax_init_builtins (void)
+{
+#ifdef SUBTARGET_INIT_BUILTINS
+  SUBTARGET_INIT_BUILTINS;
+#endif
+}
 
 static void
 vax_add_reg_cfa_offset (rtx insn, int offset, rtx src)



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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:07:37 UTC 2023

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

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [14/21]

Add a TARGET_INIT_BUILTINS hook (required to be able to compile gfortran)


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:05:36 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/gcc: rtlanal.c target.def targhooks.c
targhooks.h
src/external/gpl3/gcc.old/dist/gcc/config/vax: vax.c
src/external/gpl3/gcc.old/dist/gcc/doc: tm.texi tm.texi.in

Log Message:
gcc.old: PR port-vax/57646 patch provided by Kalvis Duckmanton [13/21]

Bitfield instructions will generate a reserved operand fault if the
operands are not reasonable (size > 32, position > 31 and size not
zero and field in a register). GCC generates code to test for these
conditions but in certain circumstances, the optimiser may decide
that a bitfield extraction instruction is invariant and move it
ahead of the instructions testing its arguments.

Introduce a new target hook to indicate to GCC that a bitfield
instruction may trap and update may_trap_p_1()

XXXRO: Although this patch includes diffs outside gcc/config/vax,
NFC for !TARGET_BITFIELD_MAY_TRAP_P, i.e., other than vax.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gcc.old/dist/gcc/rtlanal.c
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gcc.old/dist/gcc/target.def
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc.old/dist/gcc/targhooks.c \
src/external/gpl3/gcc.old/dist/gcc/targhooks.h
cvs rdiff -u -r1.16 -r1.17 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc.old/dist/gcc/doc/tm.texi
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gcc.old/dist/gcc/doc/tm.texi.in

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.old/dist/gcc

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:05:36 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/gcc: rtlanal.c target.def targhooks.c
targhooks.h
src/external/gpl3/gcc.old/dist/gcc/config/vax: vax.c
src/external/gpl3/gcc.old/dist/gcc/doc: tm.texi tm.texi.in

Log Message:
gcc.old: PR port-vax/57646 patch provided by Kalvis Duckmanton [13/21]

Bitfield instructions will generate a reserved operand fault if the
operands are not reasonable (size > 32, position > 31 and size not
zero and field in a register). GCC generates code to test for these
conditions but in certain circumstances, the optimiser may decide
that a bitfield extraction instruction is invariant and move it
ahead of the instructions testing its arguments.

Introduce a new target hook to indicate to GCC that a bitfield
instruction may trap and update may_trap_p_1()

XXXRO: Although this patch includes diffs outside gcc/config/vax,
NFC for !TARGET_BITFIELD_MAY_TRAP_P, i.e., other than vax.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gcc.old/dist/gcc/rtlanal.c
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gcc.old/dist/gcc/target.def
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc.old/dist/gcc/targhooks.c \
src/external/gpl3/gcc.old/dist/gcc/targhooks.h
cvs rdiff -u -r1.16 -r1.17 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc.old/dist/gcc/doc/tm.texi
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gcc.old/dist/gcc/doc/tm.texi.in

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.old/dist/gcc/rtlanal.c
diff -u src/external/gpl3/gcc.old/dist/gcc/rtlanal.c:1.13 src/external/gpl3/gcc.old/dist/gcc/rtlanal.c:1.14
--- src/external/gpl3/gcc.old/dist/gcc/rtlanal.c:1.13	Mon Feb 20 02:11:07 2023
+++ src/external/gpl3/gcc.old/dist/gcc/rtlanal.c	Sat Oct  7 12:05:35 2023
@@ -2953,6 +2953,15 @@ may_trap_p_1 (const_rtx x, unsigned flag
   /* These operations don't trap even with floating point.  */
   break;
 
+case SIGN_EXTRACT:
+  if (targetm.have_extv ())
+	return targetm.bitfield_may_trap_p (x, flags);
+  break;
+case ZERO_EXTRACT:
+  if (targetm.have_extzv ())
+	return targetm.bitfield_may_trap_p (x, flags);
+  break;
+
 default:
   /* Any floating arithmetic may trap.  */
   if (FLOAT_MODE_P (GET_MODE (x)) && flag_trapping_math)

Index: src/external/gpl3/gcc.old/dist/gcc/target.def
diff -u src/external/gpl3/gcc.old/dist/gcc/target.def:1.9 src/external/gpl3/gcc.old/dist/gcc/target.def:1.10
--- src/external/gpl3/gcc.old/dist/gcc/target.def:1.9	Mon Feb 20 02:11:07 2023
+++ src/external/gpl3/gcc.old/dist/gcc/target.def	Sat Oct  7 12:05:35 2023
@@ -3919,6 +3919,20 @@ passed along.",
  int, (const_rtx x, unsigned flags),
  default_unspec_may_trap_p)
 
+/* Return nonzero if evaluating SIGN_EXTRACT X or ZERO_EXTRACT X might
+   cause a trap.  FLAGS has the same meaning as in rtlanal.c:
+   may_trap_p_1. */
+DEFHOOK
+(bitfield_may_trap_p,
+ "This target hook returns nonzero if @var{x}, an @code{sign_extract} or\n\
+@code{zero_extract} operation, might cause a trap.  Targets can use\n\
+this hook to enhance precision of analysis for @code{sign_extract} and\n\
+@code{zero_extract} operations.  You may call @code{may_trap_p_1}\n\
+to analyze inner elements of @var{x} in which case @var{flags} should be\n\
+passed along.",
+ int, (const_rtx x, unsigned flags),
+ default_bitfield_may_trap_p)
+
 /* Given a register, this hook should return a parallel of registers
to represent where to find the register pieces.  Define this hook
if the register and its mode are represented in Dwarf in

Index: src/external/gpl3/gcc.old/dist/gcc/targhooks.c
diff -u src/external/gpl3/gcc.old/dist/gcc/targhooks.c:1.11 src/external/gpl3/gcc.old/dist/gcc/targhooks.c:1.12
--- src/external/gpl3/gcc.old/dist/gcc/targhooks.c:1.11	Mon Feb 20 02:11:07 2023
+++ src/external/gpl3/gcc.old/dist/gcc/targhooks.c	Sat Oct  7 12:05:35 2023
@@ -126,6 +126,12 @@ default_unspec_may_trap_p (const_rtx x, 
   return 0;
 }
 
+int
+default_bitfield_may_trap_p (const_rtx x, unsigned flags)
+{
+  return 0;
+}
+
 machine_mode
 default_promote_function_mode (const_tree type ATTRIBUTE_UNUSED,
 			   machine_mode mode,
Index: src/external/gpl3/gcc.old/dist/gcc/targhooks.h
diff -u src/external/gpl3/gcc.old/dist/gcc/targhooks.h:1.11 src/external/gpl3/gcc.old/dist/gcc/targhooks.h:1.12
--- src/external/gpl3/gcc.old/dist/gcc/targhooks.h:1.11	Mon Feb 20 02:11:07 2023
+++ src/external/gpl3/gcc.old/dist/gcc/targhooks.h	Sat Oct  7 12:05:35 2023
@@ -29,6 +29,7 @@ extern bool default_legitimize_address_d
 extern bool default_const_not_ok_for_debug_p (rtx);
 
 extern int default_unspec_may_trap_p (const_rtx, unsigned);
+extern int default_bitfield_may_trap_p (const_rtx, unsigned);
 extern machine_mode 

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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:04:50 UTC 2023

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

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [12/21]

PR toolchain/43314: pc relative relocations are "off by 1*size" on vax

Address http://gnats.netbsd.org/43314


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/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.old/dist/gcc/config/vax

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:04:50 UTC 2023

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

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [12/21]

PR toolchain/43314: pc relative relocations are "off by 1*size" on vax

Address http://gnats.netbsd.org/43314


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/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.old/dist/gcc/config/vax/elf.h
diff -u src/external/gpl3/gcc.old/dist/gcc/config/vax/elf.h:1.12 src/external/gpl3/gcc.old/dist/gcc/config/vax/elf.h:1.13
--- src/external/gpl3/gcc.old/dist/gcc/config/vax/elf.h:1.12	Sat Oct  7 11:57:01 2023
+++ src/external/gpl3/gcc.old/dist/gcc/config/vax/elf.h	Sat Oct  7 12:04:50 2023
@@ -106,5 +106,5 @@ along with GCC; see the file COPYING3.  
 fputs (integer_asm_op (SIZE, FALSE), FILE);		\
 fprintf (FILE, "%%pcrel%d(", SIZE * 8);		\
 assemble_name (FILE, LABEL);			\
-fprintf (FILE, "%+d)", SIZE);			\
+fputc (')', FILE);	\
   } while (0)



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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:02:23 UTC 2023

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

Log Message:
gcc.old: PR port-vax/57646 patch provided by Kalvis Duckmanton [9/21]

A reload for the address of an operand's address should not use the same
register as a reload of an operand's address if the two reloads are for
different operands

XXXRO: Hidden within ``#ifdef NB_FIX_VAX_BACKEND'' and enabled only for
vax at the moment.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc.old/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.old/dist/gcc/reload.c
diff -u src/external/gpl3/gcc.old/dist/gcc/reload.c:1.11 src/external/gpl3/gcc.old/dist/gcc/reload.c:1.12
--- src/external/gpl3/gcc.old/dist/gcc/reload.c:1.11	Mon Feb 20 02:11:07 2023
+++ src/external/gpl3/gcc.old/dist/gcc/reload.c	Sat Oct  7 12:02:23 2023
@@ -4529,6 +4529,50 @@ find_reloads (rtx_insn *insn, int replac
   }
   }
 
+#if NB_FIX_VAX_BACKEND
+  /*
+   * Scan the reloads again looking for a case where there is
+   * precisely one RELOAD_FOR_OPERAND_ADDRESS reload and one
+   * RELOAD_FOR_OPADDR_ADDR reload BUT they are for different
+   * operands.  choose_reload_regs assumes that the
+   * RELOAD_FOR_OPADDR_ADDR and RELOAD_FOR_OPERAND_ADDRESS reloads are
+   * a pair operating on the same operand and will choose the same
+   * register for both, which is not what is wanted.
+   */
+  {
+int n_operand_address_reloads = 0,
+	n_opaddr_addr_reloads = 0;
+int reloadnum_for_operand_address_reload = -1,
+	reloadnum_for_opaddr_addr_reload = -1;
+
+for (i = 0; i < n_reloads; i++)
+  {
+	switch (rld[i].when_needed)
+	  {
+	  case RELOAD_FOR_OPADDR_ADDR:
+	n_opaddr_addr_reloads++;
+	reloadnum_for_opaddr_addr_reload = i;
+	break;
+	  case RELOAD_FOR_OPERAND_ADDRESS:
+	n_operand_address_reloads++;
+	reloadnum_for_operand_address_reload = i;
+	break;
+	  default:
+	break;
+	  }
+  }
+
+if (n_operand_address_reloads == 1
+	&& n_opaddr_addr_reloads == 1
+	&& rld[reloadnum_for_opaddr_addr_reload].opnum
+	   != rld[reloadnum_for_operand_address_reload].opnum)
+  {
+	rld[reloadnum_for_opaddr_addr_reload].when_needed
+	= RELOAD_FOR_OPERAND_ADDRESS;
+  }
+  }
+#endif
+
   /* See if we have any reloads that are now allowed to be merged
  because we've changed when the reload is needed to
  RELOAD_FOR_OPERAND_ADDRESS or RELOAD_FOR_OTHER_ADDRESS.  Only



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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:02:23 UTC 2023

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

Log Message:
gcc.old: PR port-vax/57646 patch provided by Kalvis Duckmanton [9/21]

A reload for the address of an operand's address should not use the same
register as a reload of an operand's address if the two reloads are for
different operands

XXXRO: Hidden within ``#ifdef NB_FIX_VAX_BACKEND'' and enabled only for
vax at the moment.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc.old/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.old/dist/gcc/config/vax

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:02:03 UTC 2023

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

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [8/21]

Allow 64 bit operands addressed using post-increment addressing to be negated


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:02:03 UTC 2023

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

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [8/21]

Allow 64 bit operands addressed using post-increment addressing to be negated


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax/vax.c
diff -u src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.15 src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.16
--- src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.15	Sat Oct  7 11:57:56 2023
+++ src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c	Sat Oct  7 12:02:03 2023
@@ -1643,13 +1643,67 @@ vax_output_int_subtract (rtx_insn *insn,
 	  {
 		/* Negation is tricky.  It's basically complement and increment.
 		   Negate hi, then lo, and subtract the carry back.  */
-		if ((MEM_P (low[0]) && GET_CODE (XEXP (low[0], 0)) == POST_INC)
-		|| (MEM_P (operands[0])
-			&& GET_CODE (XEXP (operands[0], 0)) == POST_INC))
-		  fatal_insn ("illegal operand detected", insn);
-		output_asm_insn ("mnegl %2,%0", operands);
+
+		/*
+		 * If the source *or* the destination operands are
+		 * indirect memory references with post-increment
+		 * addressing, an memory reference using the base
+		 * register plus an offset must be constructed to
+		 * address the high word of the source or result.
+		 *
+		 * pre-decrement memory references are rejected by the
+		 * illegal_addsub_di_memory_operand predicate
+		 */
+
+		rtx earlyhiw[3];
+
+		/* high word - destination */
+		if (MEM_P (operands[0])
+		&& GET_CODE (XEXP (operands[0], 0)) == POST_INC)
+		  {
+		const enum machine_mode mode = GET_MODE (operands[0]);
+		rtx x = XEXP (XEXP (operands[0], 0), 0);
+		x = plus_constant (Pmode, x, GET_MODE_SIZE (mode));
+		x = gen_rtx_MEM (mode, x);
+		earlyhiw[0] = x;
+		  }
+		else
+		  earlyhiw[0] = operands[0];
+
+		earlyhiw[1] = operands[1]; /* easy, this is const0_rtx */
+
+		/* high word - source */
+		if (MEM_P (operands[2])
+		&& GET_CODE (XEXP (operands[2], 0)) == POST_INC)
+		  {
+		const enum machine_mode mode = GET_MODE (operands[2]);
+		rtx x = XEXP (XEXP (operands[2], 0), 0);
+		x = plus_constant (Pmode, x, GET_MODE_SIZE (mode));
+		x = gen_rtx_MEM (mode, x);
+		earlyhiw[2] = x;
+		  }
+		else
+		  earlyhiw[2] = operands[2];
+
+		output_asm_insn ("mnegl %2,%0", earlyhiw);
 		output_asm_insn ("mnegl %2,%0", low);
-		return "sbwc $0,%0";
+
+		if (earlyhiw[2] != operands[2])
+		  {
+		rtx ops[3];
+		const enum machine_mode mode = GET_MODE (operands[2]);
+
+		output_asm_insn ("sbwc $0,%0", operands);
+		/* update the source operand's base register to
+		   point to the following word */
+		ops[0] = XEXP (XEXP (operands[2], 0), 0);
+		ops[1] = const0_rtx;
+		ops[2] = gen_int_mode (GET_MODE_SIZE (mode), SImode);
+		output_asm_insn ("addl2 %2,%0", ops);
+		return "";
+		  }
+		else
+		  return "sbwc $0,%0";
 	  }
 	gcc_assert (rtx_equal_p (operands[0], operands[1]));
 	gcc_assert (rtx_equal_p (low[0], low[1]));



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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:01:43 UTC 2023

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

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [7/21]

Mark the output operands of the 'sbcdi3' instruction pattern as being
written before the instruction has finished using the input operands.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax/vax.md
diff -u src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.13 src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.14
--- src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.13	Sat Oct  7 11:57:27 2023
+++ src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md	Sat Oct  7 12:01:43 2023
@@ -440,7 +440,7 @@
   "vax_expand_addsub_di_operands (operands, MINUS); DONE;")
 
 (define_insn "sbcdi3"
-  [(set (match_operand:DI 0 "nonimmediate_addsub_di_operand" "=Rr,Rr")
+  [(set (match_operand:DI 0 "nonimmediate_addsub_di_operand" "=,")
 	(minus:DI (match_operand:DI 1 "general_addsub_di_operand" "0,I")
 		  (match_operand:DI 2 "general_addsub_di_operand" "nRr,Rr")))]
   "TARGET_QMATH"



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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:01:43 UTC 2023

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

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [7/21]

Mark the output operands of the 'sbcdi3' instruction pattern as being
written before the instruction has finished using the input operands.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:00:36 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/gcc: function.c

Log Message:
gcc.old: PR port-vax/57646 patch provided by Kalvis Duckmanton [6/21]

load the address operand of a SUBREG into a register to allow virtual
registers to be instantiated

XXXRO: Hidden within ``#ifdef NB_FIX_VAX_BACKEND'' and enabled only for
vax at the moment.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/gcc.old/dist/gcc/function.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.old/dist/gcc/function.c
diff -u src/external/gpl3/gcc.old/dist/gcc/function.c:1.15 src/external/gpl3/gcc.old/dist/gcc/function.c:1.16
--- src/external/gpl3/gcc.old/dist/gcc/function.c:1.15	Fri Jul 14 19:46:26 2023
+++ src/external/gpl3/gcc.old/dist/gcc/function.c	Sat Oct  7 12:00:35 2023
@@ -1720,6 +1720,27 @@ instantiate_virtual_regs_in_insn (rtx_in
 	  break;
 
 	case SUBREG:
+#ifdef NB_FIX_VAX_BACKEND
+	  if (MEM_P (XEXP (x, 0)))
+	{
+	  /* convert a subreg of a MEMORY operand into a
+		 register operand */
+	  rtx mx = XEXP (x, 0); /* memory operand */
+	  rtx addr = XEXP (mx, 0);
+	  instantiate_virtual_regs_in_rtx ();
+	  start_sequence ();
+	  mx = replace_equiv_address (mx, addr, true);
+	  addr = force_reg (GET_MODE (addr), addr);
+	  mx = replace_equiv_address (mx, addr, true);
+	  seq = get_insns ();
+	  end_sequence ();
+	  if (seq)
+		emit_insn_before (seq, insn);
+
+	  /* generate a new subreg expression */
+	  x = gen_rtx_SUBREG (GET_MODE (x), mx, SUBREG_BYTE (x));
+	}
+#endif
 	  new_rtx = instantiate_new_reg (SUBREG_REG (x), );
 	  if (new_rtx == NULL)
 	continue;
@@ -1822,6 +1843,15 @@ instantiate_decl_rtl (rtx x)
   return;
 }
 
+#ifdef NB_FIX_VAX_BACKEND
+  /* If this is a SUBREG, recurse for the pieces */
+  if (GET_CODE (x) == SUBREG)
+{
+  instantiate_decl_rtl (XEXP (x, 0));
+  return;
+}
+#endif
+
   /* If this is not a MEM, no need to do anything.  Similarly if the
  address is a constant or a register that is not a virtual register.  */
   if (!MEM_P (x))



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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 12:00:36 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/gcc: function.c

Log Message:
gcc.old: PR port-vax/57646 patch provided by Kalvis Duckmanton [6/21]

load the address operand of a SUBREG into a register to allow virtual
registers to be instantiated

XXXRO: Hidden within ``#ifdef NB_FIX_VAX_BACKEND'' and enabled only for
vax at the moment.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/gcc.old/dist/gcc/function.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.old/dist/gcc

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 11:58:54 UTC 2023

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

Log Message:
gcc.old: PR port-vax/57646 patch provided by Kalvis Duckmanton [5/21]

Shift right by positive values that are less than HOST_BITS_PER_WIDE_INT
to avoid illegal instruction exceptions on VAX.

XXXRO: Hidden within ``#ifdef NB_FIX_VAX_BACKEND'' and enabled only for
vax at the moment.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gcc.old/dist/gcc/dse.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.old/dist/gcc

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 11:58:54 UTC 2023

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

Log Message:
gcc.old: PR port-vax/57646 patch provided by Kalvis Duckmanton [5/21]

Shift right by positive values that are less than HOST_BITS_PER_WIDE_INT
to avoid illegal instruction exceptions on VAX.

XXXRO: Hidden within ``#ifdef NB_FIX_VAX_BACKEND'' and enabled only for
vax at the moment.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gcc.old/dist/gcc/dse.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.old/dist/gcc/dse.c
diff -u src/external/gpl3/gcc.old/dist/gcc/dse.c:1.13 src/external/gpl3/gcc.old/dist/gcc/dse.c:1.14
--- src/external/gpl3/gcc.old/dist/gcc/dse.c:1.13	Mon Feb 20 02:11:05 2023
+++ src/external/gpl3/gcc.old/dist/gcc/dse.c	Sat Oct  7 11:58:54 2023
@@ -301,7 +301,12 @@ static unsigned HOST_WIDE_INT
 lowpart_bitmask (int n)
 {
   unsigned HOST_WIDE_INT mask = HOST_WIDE_INT_M1U;
-#if 1 // XXXMRG
+#ifdef NB_FIX_VAX_BACKEND
+  if (n < 1)
+return 0;
+  if (n >= HOST_BITS_PER_WIDE_INT)
+return mask;
+#else // XXXMRG
   gcc_assert(n >= 0 && n <= HOST_BITS_PER_WIDE_INT);
   if (n == 0)
 return 0;
@@ -1340,6 +1345,10 @@ all_positions_needed_p (store_info *s_in
 	  return false;
   return true;
 }
+#ifdef NB_FIX_VAX_BACKEND
+  if (const_start >= HOST_BITS_PER_WIDE_INT || const_start < 0)
+return true;
+#endif
   else
 {
   unsigned HOST_WIDE_INT mask



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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 11:58:31 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/gcc: recog.c

Log Message:
gcc.old: PR port-vax/57646 patch provided by Kalvis Duckmanton [4/21]

Constrain offsets within subregister expressions to be a multiple of
the size of the data type requested. That is, offsets for a word sized
(2 byte) subregister may only be multiples of 2.

XXXRO: Hidden within ``#ifdef NB_FIX_VAX_BACKEND'' and enabled only for
vax at the moment.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc.old/dist/gcc/recog.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.old/dist/gcc/recog.c
diff -u src/external/gpl3/gcc.old/dist/gcc/recog.c:1.11 src/external/gpl3/gcc.old/dist/gcc/recog.c:1.12
--- src/external/gpl3/gcc.old/dist/gcc/recog.c:1.11	Mon Feb 20 02:11:07 2023
+++ src/external/gpl3/gcc.old/dist/gcc/recog.c	Sat Oct  7 11:58:31 2023
@@ -992,7 +992,12 @@ general_operand (rtx op, machine_mode mo
 	 ??? This is a kludge.  */
   if (!reload_completed
 	  && maybe_ne (SUBREG_BYTE (op), 0)
-	  && MEM_P (sub))
+	  && MEM_P (sub)
+#ifdef NB_FIX_VAX_BACKEND
+	  && (maybe_gt (SUBREG_BYTE (op), GET_MODE_SIZE (GET_MODE (sub)))
+	  || !multiple_p (SUBREG_BYTE (op), GET_MODE_SIZE (mode)))
+#endif
+	 )
 	return 0;
 
   if (REG_P (sub)



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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 11:58:31 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/gcc: recog.c

Log Message:
gcc.old: PR port-vax/57646 patch provided by Kalvis Duckmanton [4/21]

Constrain offsets within subregister expressions to be a multiple of
the size of the data type requested. That is, offsets for a word sized
(2 byte) subregister may only be multiples of 2.

XXXRO: Hidden within ``#ifdef NB_FIX_VAX_BACKEND'' and enabled only for
vax at the moment.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc.old/dist/gcc/recog.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.old/dist/gcc/config/vax

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 11:57:56 UTC 2023

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

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [3/21]

Reduce expressions specifying an address of a 64 bit quantity to
a sequence of assignments to temporary variables; this allows virtual
registers to be inst antiated properly.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax/vax.c
diff -u src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.14 src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.15
--- src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.14	Sat Oct  7 11:57:27 2023
+++ src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c	Sat Oct  7 11:57:56 2023
@@ -2050,6 +2050,46 @@ vax_mode_dependent_address_p (const_rtx 
 }
 
 static rtx
+decompose_address_operand(rtx addr)
+{
+  enum rtx_code code = GET_CODE (addr);
+
+  switch (code)
+{
+case CONST:
+  return decompose_address_operand (XEXP (addr, 0));
+case PLUS:
+case MULT:
+  {
+	rtx op0, op1;
+	rtx temp;
+	/*
+	 * Generate a temporary register, assign the result of
+	 * decomposing op0 to it, then generate an op code opping (PLUS
+	 * or MULT) the result of decomposing op1 to it.
+	 * Return the temporary register.
+	 */
+	temp = gen_reg_rtx (Pmode);
+	op0 = decompose_address_operand (XEXP (addr, 0));
+	op1 = decompose_address_operand (XEXP (addr, 1));
+
+	emit_move_insn (temp, op0);
+
+	if (code == PLUS)
+	  temp = gen_rtx_PLUS (Pmode, temp, op1);
+	else if (code == MULT)
+	  temp = gen_rtx_MULT (Pmode, temp, op1);
+
+	return temp;
+  }
+  break;
+default:
+  break;
+}
+  return addr;
+}
+
+static rtx
 fixup_mathdi_operand (rtx x, machine_mode mode)
 {
   if (illegal_addsub_di_memory_operand (x, mode))
@@ -2064,7 +2104,7 @@ fixup_mathdi_operand (rtx x, machine_mod
 	  addr = XEXP (XEXP (addr, 0), 0);
 	}
 #endif
-  emit_move_insn (temp, addr);
+  emit_move_insn (temp, decompose_address_operand (addr));
   if (offset)
 	temp = gen_rtx_PLUS (Pmode, temp, offset);
   x = gen_rtx_MEM (DImode, temp);



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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 11:57:56 UTC 2023

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

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [3/21]

Reduce expressions specifying an address of a 64 bit quantity to
a sequence of assignments to temporary variables; this allows virtual
registers to be inst antiated properly.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 11:57:27 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/config/vax: vax.c vax.md

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [2/21]

Add a special case to the zero_extract instruction to handle the case
where 32 bits are requested (i.e. the entire word). When printing a mask
operand, avoid generating values that might overflow a 32 bit word.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax/vax.c
diff -u src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.13 src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.14
--- src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.13	Sat Oct  7 11:57:01 2023
+++ src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c	Sat Oct  7 11:57:27 2023
@@ -587,7 +587,7 @@ print_operand (FILE *file, rtx x, int co
   else if (code == 'b' && CONST_INT_P (x))
 fprintf (file, "$%d", (int) (0xff & - INTVAL (x)));
   else if (code == 'M' && CONST_INT_P (x))
-fprintf (file, "$%d", ~((1 << INTVAL (x)) - 1));
+fprintf (file, "$%d", ((~0) << (INTVAL (x;
   else if (code == 'x' && CONST_INT_P (x))
 fprintf (file, HOST_WIDE_INT_PRINT_HEX, INTVAL (x));
   else if (REG_P (x))

Index: src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md
diff -u src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.12 src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.13
--- src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.12	Sat Oct  7 11:57:01 2023
+++ src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md	Sat Oct  7 11:57:27 2023
@@ -943,7 +943,14 @@
   if (INTVAL (operands[3]) & 31)
 return \"rotl %R3,%1,%0\;bicl2 %M2,%0\";
   if (rtx_equal_p (operands[0], operands[1]))
-return \"bicl2 %M2,%0\";
+{
+  if (INTVAL (operands[2]) == 32)
+	return \"\";  /* no-op */
+  else
+	return \"bicl2 %M2,%0\";
+}
+  if (INTVAL (operands[2]) == 32)
+return \"movl %1,%0\";
   return \"bicl3 %M2,%1,%0\";
 }")
 



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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 11:57:27 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/config/vax: vax.c vax.md

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [2/21]

Add a special case to the zero_extract instruction to handle the case
where 32 bits are requested (i.e. the entire word). When printing a mask
operand, avoid generating values that might overflow a 32 bit word.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 11:57:01 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/config/vax: elf.h vax.c vax.md

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [1/21]

Save %r2..%r5 in the prologue of functions which call __builtin_eh_return().
Implement the eh_return() instruction. Ensure that the CFA is correct


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/elf.h \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax/elf.h
diff -u src/external/gpl3/gcc.old/dist/gcc/config/vax/elf.h:1.11 src/external/gpl3/gcc.old/dist/gcc/config/vax/elf.h:1.12
--- src/external/gpl3/gcc.old/dist/gcc/config/vax/elf.h:1.11	Mon Feb 20 02:11:22 2023
+++ src/external/gpl3/gcc.old/dist/gcc/config/vax/elf.h	Sat Oct  7 11:57:01 2023
@@ -45,7 +45,9 @@ along with GCC; see the file COPYING3.  
count pushed by the CALLS and before the start of the saved registers.  */
 #define INCOMING_FRAME_SP_OFFSET 0
 
-/* Offset from the frame pointer register value to the top of the stack.  */
+/* Offset from the frame pointer register value to the DWARF Canonical Frame
+   Address. */
+#undef FRAME_POINTER_CFA_OFFSET
 #define FRAME_POINTER_CFA_OFFSET(FNDECL) 0
 
 /* We use R2-R5 (call-clobbered) registers for exceptions.  */
@@ -56,14 +58,14 @@ along with GCC; see the file COPYING3.  
   gen_rtx_MEM (SImode,			\
 	   plus_constant (Pmode,	\
 			  gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM),\
-			  -4))
+			  -1 * UNITS_PER_WORD))
 
 /* Simple store the return handler into the call frame.  */
 #define EH_RETURN_HANDLER_RTX		\
   gen_rtx_MEM (Pmode,			\
 	   plus_constant (Pmode,	\
 			  gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM),\
-			  16))
+			  RETURN_ADDRESS_OFFSET))
 
 
 /* The VAX wants no space between the case instruction and the jump table.  */
Index: src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md
diff -u src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.11 src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.12
--- src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md:1.11	Mon Feb 20 02:11:22 2023
+++ src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md	Sat Oct  7 11:57:01 2023
@@ -33,6 +33,8 @@
 			; insn in the code.
   VUNSPEC_SYNC_ISTREAM  ; sequence of insns to sync the I-stream
   VUNSPEC_PEM		; 'procedure_entry_mask' insn.
+
+  VUNSPEC_EH_RETURN
 ])
 
 (define_constants
@@ -1470,6 +1472,36 @@
   DONE;
 }")
 
+;; Exception handling
+;; This is used when compiling the stack unwinding routines.
+(define_expand "eh_return"
+  [(use (match_operand 0 "general_operand"))]
+  ""
+{
+  if (GET_MODE (operands[0]) != word_mode)
+operands[0] = convert_to_mode (word_mode, operands[0], 0);
+  emit_insn (gen_eh_set_retaddr (operands[0]));
+  DONE;
+})
+
+(define_insn_and_split "eh_set_retaddr"
+  [(unspec [(match_operand:SI 0 "general_operand")] VUNSPEC_EH_RETURN)
+   (clobber (match_scratch:SI 1 "="))
+   ]
+  ""
+  "#"
+  "reload_completed"
+  [(const_int 0)]
+{
+  /* the return address for the current frame is always at 0x10(%fp) */
+  rtx tmp = plus_constant(Pmode, frame_pointer_rtx, 4 * UNITS_PER_WORD);
+  tmp = gen_rtx_MEM (word_mode, tmp);
+  MEM_VOLATILE_P(tmp) = 1;
+  tmp = gen_rtx_SET(tmp, operands[0]);
+  emit_insn(tmp);
+  DONE;
+})
+
 (define_insn "nop"
   [(const_int 0)]
   ""

Index: src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c
diff -u src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.12 src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.13
--- src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.12	Mon Feb 20 02:11:22 2023
+++ src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c	Sat Oct  7 11:57:01 2023
@@ -182,20 +182,28 @@ vax_expand_prologue (void)
   HOST_WIDE_INT size;
   rtx insn;
 
-  offset = 20;
   for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
 if (df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
   {
 mask |= 1 << regno;
-offset += 4;
   }
 
+  if (crtl->calls_eh_return)
+{
+  mask |= 0
+	| ( 1 << EH_RETURN_DATA_REGNO(0) )
+	| ( 1 << EH_RETURN_DATA_REGNO(1) )
+	| ( 1 << EH_RETURN_DATA_REGNO(2) )
+	| ( 1 << EH_RETURN_DATA_REGNO(3) )
+	;
+}
+
   insn = emit_insn (gen_procedure_entry_mask (GEN_INT (mask)));
   RTX_FRAME_RELATED_P (insn) = 1;
 
   /* The layout of the CALLG/S stack frame is follows:
 
-		<- CFA, AP
+		<- AP
 	r11
 	r10
 	...	Registers saved as specified by MASK
@@ -205,16 +213,11 @@ vax_expand_prologue (void)
 	old fp
 	old ap
 	old psw
-	zero
-		<- FP, SP
+	condition handler	<- CFA, FP, SP
+	  (initially zero)
 
   

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

2023-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct  7 11:57:01 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/config/vax: elf.h vax.c vax.md

Log Message:
gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [1/21]

Save %r2..%r5 in the prologue of functions which call __builtin_eh_return().
Implement the eh_return() instruction. Ensure that the CFA is correct


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/elf.h \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.md
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/libstdc++-v3/config/locale/dragonfly

2023-09-13 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Sep 14 03:52:24 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/libstdc++-v3/config/locale/dragonfly:
c_locale.h

Log Message:
gcc.old: c++locale.h: Drop unnecessary  include

This has no longer been required since rev 1.6 (of gcc one):

http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/gcc/dist/libstdc++-v3/config/locale/dragonfly/c_locale.h#rev1.6

where __convert_from_v() migrated to .cc file, and direct call for
vsnprintf_l(3) from this header file was removed.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \

src/external/gpl3/gcc.old/dist/libstdc++-v3/config/locale/dragonfly/c_locale.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.old/dist/libstdc++-v3/config/locale/dragonfly/c_locale.h
diff -u src/external/gpl3/gcc.old/dist/libstdc++-v3/config/locale/dragonfly/c_locale.h:1.6 src/external/gpl3/gcc.old/dist/libstdc++-v3/config/locale/dragonfly/c_locale.h:1.7
--- src/external/gpl3/gcc.old/dist/libstdc++-v3/config/locale/dragonfly/c_locale.h:1.6	Mon Feb 20 02:11:45 2023
+++ src/external/gpl3/gcc.old/dist/libstdc++-v3/config/locale/dragonfly/c_locale.h	Thu Sep 14 03:52:24 2023
@@ -44,8 +44,6 @@
 #include 
 #ifndef __NetBSD__
 #include 
-#else
-#include 
 #endif
 
 #define _GLIBCXX_NUM_CATEGORIES 0



CVS commit: src/external/gpl3/gcc.old/dist/libstdc++-v3/config/locale/dragonfly

2023-09-13 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Sep 14 03:52:24 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/libstdc++-v3/config/locale/dragonfly:
c_locale.h

Log Message:
gcc.old: c++locale.h: Drop unnecessary  include

This has no longer been required since rev 1.6 (of gcc one):

http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/gcc/dist/libstdc++-v3/config/locale/dragonfly/c_locale.h#rev1.6

where __convert_from_v() migrated to .cc file, and direct call for
vsnprintf_l(3) from this header file was removed.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \

src/external/gpl3/gcc.old/dist/libstdc++-v3/config/locale/dragonfly/c_locale.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.old/dist/gcc

2023-09-03 Thread matthew green
"Christos Zoulas" writes:
> Module Name:  src
> Committed By: christos
> Date: Sun Sep  3 18:45:26 UTC 2023
>
> Modified Files:
>   src/external/gpl3/gcc.old/dist/gcc: ubsan.c
>
> Log Message:
> remap generated ubsan filename string labels. fixes reproducible builds.
> reported by wiz@

thanks.  surprised it was needed for .old, but not surprised
the for GCC 12 -- that one had sanitizers replaced and i did
not attempt to merge, but re-ported.

it was pretty crazy -- our GCC 10 has a much nicer libsanitizer
than GCC 10 upstream, but GCC 12 has upgraded to an even newer
version that included many, but not all, of the netbsd fixes,
and finding all the fixes from the prior is difficult, as there
was no real "base version" to compare against parts of both GCC
and llvm upstreams were that base..

anyway, i say this because there's always a chance of something
else having been missed in the re-port.

thanks again!


.mrg.


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

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

Modified Files:
src/external/gpl3/gcc.old/dist/gcc: ubsan.c

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.6 -r1.7 src/external/gpl3/gcc.old/dist/gcc/ubsan.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.old/dist/gcc/ubsan.c
diff -u src/external/gpl3/gcc.old/dist/gcc/ubsan.c:1.6 src/external/gpl3/gcc.old/dist/gcc/ubsan.c:1.7
--- src/external/gpl3/gcc.old/dist/gcc/ubsan.c:1.6	Sun Feb 19 21:11:07 2023
+++ src/external/gpl3/gcc.old/dist/gcc/ubsan.c	Sun Sep  3 14:45:26 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.old/dist/gcc

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

Modified Files:
src/external/gpl3/gcc.old/dist/gcc: ubsan.c

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.6 -r1.7 src/external/gpl3/gcc.old/dist/gcc/ubsan.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.old/dist/libsanitizer/sanitizer_common

2023-08-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug  2 10:30:34 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common:
sanitizer_platform_limits_netbsd.h

Log Message:
Forgot to commit the rest of the renames.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \

src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_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.old/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h
diff -u src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h:1.3 src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h:1.4
--- src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h:1.3	Sun Feb 19 21:11:40 2023
+++ src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h	Wed Aug  2 06:30:34 2023
@@ -579,7 +579,7 @@ extern unsigned struct_blue_interface_sz
 extern unsigned struct_blue_stats_sz;
 extern unsigned struct_bpf_dltlist_sz;
 extern unsigned struct_bpf_program_sz;
-extern unsigned struct_bpf_stat_old_sz;
+extern unsigned struct_bpf_stat30_sz;
 extern unsigned struct_bpf_stat_sz;
 extern unsigned struct_bpf_version_sz;
 extern unsigned struct_btreq_sz;
@@ -883,7 +883,7 @@ extern unsigned struct_spi_ioctl_transfe
 extern unsigned struct_autofs_daemon_request_sz;
 extern unsigned struct_autofs_daemon_done_sz;
 extern unsigned struct_sctp_connectx_addrs_sz;
-extern unsigned struct_usb_device_info_old_sz;
+extern unsigned struct_usb_device_info30_sz;
 extern unsigned struct_usb_device_info_sz;
 extern unsigned struct_usb_device_stats_sz;
 extern unsigned struct_usb_endpoint_desc_sz;
@@ -1434,7 +1434,7 @@ extern unsigned IOCTL_USB_REQUEST;
 extern unsigned IOCTL_USB_SETDEBUG;
 extern unsigned IOCTL_USB_DISCOVER;
 extern unsigned IOCTL_USB_DEVICEINFO;
-extern unsigned IOCTL_USB_DEVICEINFO_OLD;
+extern unsigned IOCTL_USB_DEVICEINFO_30;
 extern unsigned IOCTL_USB_DEVICESTATS;
 extern unsigned IOCTL_USB_GET_REPORT_DESC;
 extern unsigned IOCTL_USB_SET_IMMED;
@@ -1454,7 +1454,7 @@ extern unsigned IOCTL_USB_GET_FULL_DESC;
 extern unsigned IOCTL_USB_GET_STRING_DESC;
 extern unsigned IOCTL_USB_DO_REQUEST;
 extern unsigned IOCTL_USB_GET_DEVICEINFO;
-extern unsigned IOCTL_USB_GET_DEVICEINFO_OLD;
+extern unsigned IOCTL_USB_GET_DEVICEINFO_30;
 extern unsigned IOCTL_USB_SET_SHORT_XFER;
 extern unsigned IOCTL_USB_SET_TIMEOUT;
 extern unsigned IOCTL_USB_SET_BULK_RA;
@@ -1637,7 +1637,7 @@ extern unsigned IOCTL_BIOCGDLT;
 extern unsigned IOCTL_BIOCGETIF;
 extern unsigned IOCTL_BIOCSETIF;
 extern unsigned IOCTL_BIOCGSTATS;
-extern unsigned IOCTL_BIOCGSTATSOLD;
+extern unsigned IOCTL_BIOCGSTATS_30;
 extern unsigned IOCTL_BIOCIMMEDIATE;
 extern unsigned IOCTL_BIOCVERSION;
 extern unsigned IOCTL_BIOCSTCPF;



CVS commit: src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common

2023-08-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug  2 10:30:34 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common:
sanitizer_platform_limits_netbsd.h

Log Message:
Forgot to commit the rest of the renames.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \

src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_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.old/dist/gcc/config/sh

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

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

Log Message:
Sync with external/gpl3/gcc:
https://mail-index.netbsd.org/source-changes/2023/07/18/msg146078.html

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.12 -r1.13 src/external/gpl3/gcc.old/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.old/dist/gcc/config/sh/sh.md
diff -u src/external/gpl3/gcc.old/dist/gcc/config/sh/sh.md:1.12 src/external/gpl3/gcc.old/dist/gcc/config/sh/sh.md:1.13
--- src/external/gpl3/gcc.old/dist/gcc/config/sh/sh.md:1.12	Mon Feb 20 02:11:21 2023
+++ src/external/gpl3/gcc.old/dist/gcc/config/sh/sh.md	Tue Jul 18 02:58:38 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.old/dist/gcc/config/sh

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

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

Log Message:
Sync with external/gpl3/gcc:
https://mail-index.netbsd.org/source-changes/2023/07/18/msg146078.html

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.12 -r1.13 src/external/gpl3/gcc.old/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.old/dist/libsanitizer/sanitizer_common

2023-04-05 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Apr  5 07:41:38 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common:
sanitizer_mutex.h

Log Message:
Fix StaticSpinMutex::CheckLocked() on sparc32.

The lock gets set with atomic_exchange() -> __sync_lock_test_and_set()
which sets the value to 255 instead of 1.  Check for a taken lock
with "!= 0" instead of "== 1".  This should work on all architectures.

Ok: Matthew Green


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \

src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_mutex.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.old/dist/libsanitizer/sanitizer_common

2023-04-05 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Apr  5 07:41:38 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common:
sanitizer_mutex.h

Log Message:
Fix StaticSpinMutex::CheckLocked() on sparc32.

The lock gets set with atomic_exchange() -> __sync_lock_test_and_set()
which sets the value to 255 instead of 1.  Check for a taken lock
with "!= 0" instead of "== 1".  This should work on all architectures.

Ok: Matthew Green


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \

src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_mutex.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.old/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h
diff -u src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h:1.8 src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h:1.9
--- src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h:1.8	Fri Apr  9 23:14:55 2021
+++ src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h	Wed Apr  5 07:41:38 2023
@@ -39,7 +39,7 @@ class StaticSpinMutex {
   }
 
   void CheckLocked() {
-CHECK_EQ(atomic_load(_, memory_order_relaxed), 1);
+CHECK_NE(atomic_load(_, memory_order_relaxed), 0);
   }
 
  private:



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

2021-06-29 Thread Chris Pinnock
Module Name:src
Committed By:   cjep
Date:   Tue Jun 29 08:51:04 UTC 2021

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

Log Message:
PR toolchain/56180. Additional to yesterday's commit in gcc, also needed in
gcc.old. Add configuration so that gcc can find the LTO plugin when
cross-building NetBSD from OpenBSD hosts.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gcc.old/dist/gcc/config.host

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.old/dist/gcc

2021-06-29 Thread Chris Pinnock
Module Name:src
Committed By:   cjep
Date:   Tue Jun 29 08:51:04 UTC 2021

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

Log Message:
PR toolchain/56180. Additional to yesterday's commit in gcc, also needed in
gcc.old. Add configuration so that gcc can find the LTO plugin when
cross-building NetBSD from OpenBSD hosts.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gcc.old/dist/gcc/config.host

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.old/dist/gcc/config.host
diff -u src/external/gpl3/gcc.old/dist/gcc/config.host:1.10 src/external/gpl3/gcc.old/dist/gcc/config.host:1.11
--- src/external/gpl3/gcc.old/dist/gcc/config.host:1.10	Fri Apr  9 23:14:17 2021
+++ src/external/gpl3/gcc.old/dist/gcc/config.host	Tue Jun 29 08:51:03 2021
@@ -277,6 +277,7 @@ case ${host} in
   *-*-openbsd*)
 out_host_hook_obj=host-openbsd.o
 host_xmake_file="${host_xmake_file} x-openbsd"
+host_lto_plugin_soname=liblto_plugin.so.0.0
 ;;
   *-*-netbsd*)
 out_host_hook_obj=host-netbsd.o



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

2021-04-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Apr  9 23:16:56 UTC 2021

Added Files:
src/external/gpl3/gcc.old/dist/gcc/config/pa: t-pa
src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common:
sanitizer_netbsd.cc

Log Message:
merge GCC 9.3 into gcc.old.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.3 src/external/gpl3/gcc.old/dist/gcc/config/pa/t-pa
cvs rdiff -u -r0 -r1.3 \

src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.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.old/dist/gcc/config/pa/t-pa
diff -u /dev/null src/external/gpl3/gcc.old/dist/gcc/config/pa/t-pa:1.3
--- /dev/null	Fri Apr  9 23:16:56 2021
+++ src/external/gpl3/gcc.old/dist/gcc/config/pa/t-pa	Fri Apr  9 23:16:56 2021
@@ -0,0 +1,4 @@
+pa-d.o: $(srcdir)/config/pa/pa-d.c
+	$(COMPILE) $<
+	$(POSTCOMPILE)
+

Index: src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.cc
diff -u /dev/null src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.cc:1.3
--- /dev/null	Fri Apr  9 23:16:56 2021
+++ src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.cc	Fri Apr  9 23:16:56 2021
@@ -0,0 +1,337 @@
+//===-- sanitizer_netbsd.cc ---===//
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+//
+// This file is shared between Sanitizer run-time libraries and implements
+// NetBSD-specific functions from sanitizer_libc.h.
+//===--===//
+
+#include "sanitizer_platform.h"
+
+#if SANITIZER_NETBSD
+
+#include "sanitizer_common.h"
+#include "sanitizer_flags.h"
+#include "sanitizer_getauxval.h"
+#include "sanitizer_internal_defs.h"
+#include "sanitizer_libc.h"
+#include "sanitizer_linux.h"
+#include "sanitizer_mutex.h"
+#include "sanitizer_placement_new.h"
+#include "sanitizer_procmaps.h"
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+extern "C" void *__mmap(void *, size_t, int, int, int, int,
+off_t) SANITIZER_WEAK_ATTRIBUTE;
+extern "C" int __sysctl(const int *, unsigned int, void *, size_t *,
+const void *, size_t) SANITIZER_WEAK_ATTRIBUTE;
+extern "C" int _sys_close(int) SANITIZER_WEAK_ATTRIBUTE;
+extern "C" int _sys_open(const char *, int, ...) SANITIZER_WEAK_ATTRIBUTE;
+extern "C" ssize_t _sys_read(int, void *, size_t) SANITIZER_WEAK_ATTRIBUTE;
+extern "C" ssize_t _sys_write(int, const void *,
+  size_t) SANITIZER_WEAK_ATTRIBUTE;
+extern "C" int __ftruncate(int, int, off_t) SANITIZER_WEAK_ATTRIBUTE;
+extern "C" ssize_t _sys_readlink(const char *, char *,
+ size_t) SANITIZER_WEAK_ATTRIBUTE;
+extern "C" int _sys_sched_yield() SANITIZER_WEAK_ATTRIBUTE;
+extern "C" int _sys___nanosleep50(const void *,
+  void *) SANITIZER_WEAK_ATTRIBUTE;
+extern "C" int _sys_execve(const char *, char *const[],
+   char *const[]) SANITIZER_WEAK_ATTRIBUTE;
+extern "C" off_t __lseek(int, int, off_t, int) SANITIZER_WEAK_ATTRIBUTE;
+extern "C" int __fork() SANITIZER_WEAK_ATTRIBUTE;
+extern "C" int _sys___sigprocmask14(int, const void *,
+void *) SANITIZER_WEAK_ATTRIBUTE;
+extern "C" int _sys___wait450(int wpid, int *, int,
+  void *) SANITIZER_WEAK_ATTRIBUTE;
+
+namespace __sanitizer {
+
+static void *GetRealLibcAddress(const char *symbol) {
+  void *real = dlsym(RTLD_NEXT, symbol);
+  if (!real)
+real = dlsym(RTLD_DEFAULT, symbol);
+  if (!real) {
+Printf("GetRealLibcAddress failed for symbol=%s", symbol);
+Die();
+  }
+  return real;
+}
+
+#define _REAL(func, ...) real##_##func(__VA_ARGS__)
+#define DEFINE__REAL(ret_type, func, ...)  \
+  static ret_type (*real_##func)(__VA_ARGS__) = NULL;  \
+  if (!real_##func) {  \
+real_##func = (ret_type(*)(__VA_ARGS__))GetRealLibcAddress(#func); \
+  }\
+  CHECK(real_##func);
+
+// --- sanitizer_libc.h
+uptr internal_mmap(void *addr, uptr length, int prot, int flags, int fd,
+   OFF_T offset) {
+  CHECK(&__mmap);
+  return (uptr)__mmap(addr, length, prot, flags, fd, 0, offset);
+}
+
+uptr internal_munmap(void *addr, uptr length) {
+  DEFINE__REAL(int, munmap, void *a, uptr b);
+  return 

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

2021-04-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Apr  9 23:16:56 UTC 2021

Added Files:
src/external/gpl3/gcc.old/dist/gcc/config/pa: t-pa
src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common:
sanitizer_netbsd.cc

Log Message:
merge GCC 9.3 into gcc.old.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.3 src/external/gpl3/gcc.old/dist/gcc/config/pa/t-pa
cvs rdiff -u -r0 -r1.3 \

src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.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.old/dist/gcc/config/arm

2020-11-30 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Dec  1 02:39:48 UTC 2020

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

Log Message:
gcc.old: Switch earmv6{,hf}eb to BE8, ported from gcc.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/gcc.old/dist/gcc/config/arm/netbsd-eabi.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.old/dist/gcc/config/arm/netbsd-eabi.h
diff -u src/external/gpl3/gcc.old/dist/gcc/config/arm/netbsd-eabi.h:1.7 src/external/gpl3/gcc.old/dist/gcc/config/arm/netbsd-eabi.h:1.8
--- src/external/gpl3/gcc.old/dist/gcc/config/arm/netbsd-eabi.h:1.7	Thu Sep 26 05:55:42 2019
+++ src/external/gpl3/gcc.old/dist/gcc/config/arm/netbsd-eabi.h	Tue Dec  1 02:39:48 2020
@@ -34,8 +34,6 @@
 #undef  TARGET_LINKER_EMULATION
 #if TARGET_BIG_ENDIAN_DEFAULT
 #define TARGET_LINKER_EMULATION TARGET_LINKER_BIG_EMULATION
-#undef BE8_LINK_SPEC
-#define BE8_LINK_SPEC " %{!mlittle-endian:%{march=armv7-a|mcpu=cortex-a5|mcpu=cortex-a8|mcpu=cortex-a9:%{!r:--be8}}}" 
 #else
 #define TARGET_LINKER_EMULATION TARGET_LINKER_LITTLE_EMULATION
 #endif



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

2020-11-30 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Dec  1 02:39:48 UTC 2020

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

Log Message:
gcc.old: Switch earmv6{,hf}eb to BE8, ported from gcc.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/gcc.old/dist/gcc/config/arm/netbsd-eabi.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.old/dist

2020-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 11 08:45:56 UTC 2020

Modified Files:
src/external/gpl3/gcc.old/dist: LAST_UPDATED MD5SUMS NEWS
src/external/gpl3/gcc.old/dist/contrib: test_summary
src/external/gpl3/gcc.old/dist/fixincludes: fixincl.x inclhack.def
src/external/gpl3/gcc.old/dist/fixincludes/tests/base/architecture/ppc:
math.h
src/external/gpl3/gcc.old/dist/gcc: BASE-VER DATESTAMP builtins.c
calls.c cfgcleanup.c cfghooks.c cfghooks.h cfgloop.h cfgloopmanip.c
cfgrtl.c combine.c config.gcc convert.c dce.c df-core.c dse.c
dwarf2out.c except.c explow.c expmed.c expr.c final.c fold-const.c
function.c gcse.c gengtype-lex.c ggc-page.c gimple-fold.c
gimple-pretty-print.c gimple-ssa-sprintf.c
gimple-ssa-strength-reduction.c gimple.c gimple.h gimplify.c
graphite-scop-detection.c input.c internal-fn.c internal-fn.h
ipa-cp.c ipa-icf-gimple.c ipa-inline.c ipa-prop.c ipa-pure-const.c
ipa-reference.c ipa-utils.c ipa-utils.h ira.c loop-unroll.c
lra-constraints.c lra.c lto-streamer-in.c lto-streamer-out.c
lto-streamer.h lto-wrapper.c match.pd omp-expand.c omp-low.c
omp-simd-clone.c optabs.c optc-save-gen.awk opth-gen.awk
opts-common.c opts-global.c opts.c resource.c rtl.h rtlanal.c
store-motion.c symtab.c toplev.c tree-cfg.c tree-complex.c
tree-core.h tree-data-ref.c tree-data-ref.h tree-inline.c
tree-inline.h tree-loop-distribution.c tree-outof-ssa.c
tree-scalar-evolution.c tree-sra.c tree-ssa-copy.c tree-ssa-dom.c
tree-ssa-forwprop.c tree-ssa-loop-ch.c tree-ssa-loop-ivcanon.c
tree-ssa-loop-ivopts.c tree-ssa-loop-split.c tree-ssa-math-opts.c
tree-ssa-phiopt.c tree-ssa-phiprop.c tree-ssa-pre.c
tree-ssa-reassoc.c tree-ssa-sccvn.c tree-ssa-sccvn.h
tree-ssa-sink.c tree-ssa-strlen.c tree-ssa-structalias.c
tree-ssanames.c tree-streamer-in.c tree-streamer-out.c
tree-vect-data-refs.c tree-vect-slp.c tree-vect-stmts.c tree-vrp.c
tree.c tree.h valtrack.c varasm.c xcoffout.c xcoffout.h
src/external/gpl3/gcc.old/dist/gcc/c: c-decl.c c-parser.c c-tree.h
c-typeck.c

Log Message:
merge GCC 7.5.0 into gcc.old.  .. just in time to be obsolete? :)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gcc.old/dist/LAST_UPDATED \
src/external/gpl3/gcc.old/dist/MD5SUMS \
src/external/gpl3/gcc.old/dist/NEWS
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gcc.old/dist/contrib/test_summary
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gcc.old/dist/fixincludes/fixincl.x
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gcc.old/dist/fixincludes/inclhack.def
cvs rdiff -u -r1.7 -r1.8 \

src/external/gpl3/gcc.old/dist/fixincludes/tests/base/architecture/ppc/math.h
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gcc.old/dist/gcc/BASE-VER \
src/external/gpl3/gcc.old/dist/gcc/DATESTAMP \
src/external/gpl3/gcc.old/dist/gcc/builtins.c \
src/external/gpl3/gcc.old/dist/gcc/calls.c \
src/external/gpl3/gcc.old/dist/gcc/combine.c \
src/external/gpl3/gcc.old/dist/gcc/dwarf2out.c \
src/external/gpl3/gcc.old/dist/gcc/expmed.c \
src/external/gpl3/gcc.old/dist/gcc/expr.c \
src/external/gpl3/gcc.old/dist/gcc/fold-const.c \
src/external/gpl3/gcc.old/dist/gcc/function.c \
src/external/gpl3/gcc.old/dist/gcc/gengtype-lex.c \
src/external/gpl3/gcc.old/dist/gcc/gimplify.c \
src/external/gpl3/gcc.old/dist/gcc/ipa-cp.c \
src/external/gpl3/gcc.old/dist/gcc/omp-low.c \
src/external/gpl3/gcc.old/dist/gcc/opts.c \
src/external/gpl3/gcc.old/dist/gcc/tree-cfg.c \
src/external/gpl3/gcc.old/dist/gcc/tree-inline.c \
src/external/gpl3/gcc.old/dist/gcc/tree-ssa-math-opts.c \
src/external/gpl3/gcc.old/dist/gcc/tree-ssa-reassoc.c \
src/external/gpl3/gcc.old/dist/gcc/tree-ssa-sccvn.c \
src/external/gpl3/gcc.old/dist/gcc/tree-ssa-structalias.c \
src/external/gpl3/gcc.old/dist/gcc/tree-vrp.c
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gcc.old/dist/gcc/cfgcleanup.c \
src/external/gpl3/gcc.old/dist/gcc/cfghooks.c \
src/external/gpl3/gcc.old/dist/gcc/cfghooks.h \
src/external/gpl3/gcc.old/dist/gcc/cfgloop.h \
src/external/gpl3/gcc.old/dist/gcc/cfgloopmanip.c \
src/external/gpl3/gcc.old/dist/gcc/df-core.c \
src/external/gpl3/gcc.old/dist/gcc/except.c \
src/external/gpl3/gcc.old/dist/gcc/gimple-pretty-print.c \
src/external/gpl3/gcc.old/dist/gcc/gimple-ssa-strength-reduction.c \
src/external/gpl3/gcc.old/dist/gcc/gimple.c \
src/external/gpl3/gcc.old/dist/gcc/gimple.h \
src/external/gpl3/gcc.old/dist/gcc/graphite-scop-detection.c \
src/external/gpl3/gcc.old/dist/gcc/internal-fn.c \
src/external/gpl3/gcc.old/dist/gcc/ipa-reference.c 

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

2019-09-25 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Sep 26 05:51:13 UTC 2019

Added Files:
src/external/gpl3/gcc.old/dist/gcc/config: t-netbsd
src/external/gpl3/gcc.old/dist/gcc/config/alpha: t-alpha
src/external/gpl3/gcc.old/dist/gcc/config/arc: t-arc

Log Message:
merge gcc 7.4 into gcc.old.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.3 src/external/gpl3/gcc.old/dist/gcc/config/t-netbsd
cvs rdiff -u -r0 -r1.3 \
src/external/gpl3/gcc.old/dist/gcc/config/alpha/t-alpha
cvs rdiff -u -r0 -r1.3 src/external/gpl3/gcc.old/dist/gcc/config/arc/t-arc

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.old/dist/gcc/config/t-netbsd
diff -u /dev/null src/external/gpl3/gcc.old/dist/gcc/config/t-netbsd:1.3
--- /dev/null	Thu Sep 26 05:51:13 2019
+++ src/external/gpl3/gcc.old/dist/gcc/config/t-netbsd	Thu Sep 26 05:51:13 2019
@@ -0,0 +1,21 @@
+# Copyright (C) 2017 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3.  If not see
+# .
+
+netbsd.o: $(srcdir)/config/netbsd.c
+	$(COMPILE) $<
+	$(POSTCOMPILE)

Index: src/external/gpl3/gcc.old/dist/gcc/config/alpha/t-alpha
diff -u /dev/null src/external/gpl3/gcc.old/dist/gcc/config/alpha/t-alpha:1.3
--- /dev/null	Thu Sep 26 05:51:13 2019
+++ src/external/gpl3/gcc.old/dist/gcc/config/alpha/t-alpha	Thu Sep 26 05:51:13 2019
@@ -0,0 +1,19 @@
+# Copyright (C) 2016-2017 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3.  If not see
+# .
+
+PASSES_EXTRA += $(srcdir)/config/alpha/alpha-passes.def

Index: src/external/gpl3/gcc.old/dist/gcc/config/arc/t-arc
diff -u /dev/null src/external/gpl3/gcc.old/dist/gcc/config/arc/t-arc:1.3
--- /dev/null	Thu Sep 26 05:51:13 2019
+++ src/external/gpl3/gcc.old/dist/gcc/config/arc/t-arc	Thu Sep 26 05:51:13 2019
@@ -0,0 +1,48 @@
+# GCC Makefile fragment for Synopsys DesignWare ARC.
+#
+# Copyright (C) 2016-2017 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3, or (at your option) any later version.
+#
+# GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with GCC; see the file COPYING3.  If not see
+# .
+
+TM_H += $(srcdir)/config/arc/arc-c.def
+
+driver-arc.o: $(srcdir)/config/arc/driver-arc.c \
+  $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
+	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+
+arc-c.o: $(srcdir)/config/arc/arc-c.c $(CONFIG_H) $(SYSTEM_H) \
+$(TREE_H) $(TM_H) $(TM_P_H) coretypes.h
+	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+		$(srcdir)/config/arc/arc-c.c
+
+#Run `arc-cpus` if you changed something in arc-cpus.def
+
+.PHONY: arc-cpus
+
+arc-cpus: $(srcdir)/config/arc/t-multilib \
+	$(srcdir)/config/arc/arc-tables.opt
+
+$(srcdir)/config/arc/t-multilib: $(srcdir)/config/arc/genmultilib.awk 	\
+ $(srcdir)/config/arc/arc-cpus.def
+	$(AWK) -f $< -v FORMAT=Makefile $< $(srcdir)/config/arc/arc-cpus.def > $@
+
+$(srcdir)/config/arc/arc-tables.opt: $(srcdir)/config/arc/genoptions.awk \
+ $(srcdir)/config/arc/arc-cpus.def
+	$(AWK) -f $< -v FORMAT=Makefile $< $(srcdir)/config/arc/arc-cpus.def > $@
+
+# Local Variables:
+# mode: Makefile
+# End:



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

2019-09-25 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Sep 26 05:51:13 UTC 2019

Added Files:
src/external/gpl3/gcc.old/dist/gcc/config: t-netbsd
src/external/gpl3/gcc.old/dist/gcc/config/alpha: t-alpha
src/external/gpl3/gcc.old/dist/gcc/config/arc: t-arc

Log Message:
merge gcc 7.4 into gcc.old.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.3 src/external/gpl3/gcc.old/dist/gcc/config/t-netbsd
cvs rdiff -u -r0 -r1.3 \
src/external/gpl3/gcc.old/dist/gcc/config/alpha/t-alpha
cvs rdiff -u -r0 -r1.3 src/external/gpl3/gcc.old/dist/gcc/config/arc/t-arc

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.old/dist/libsanitizer/sanitizer_common

2019-04-15 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Apr 16 01:44:07 UTC 2019

Modified Files:
src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Sync gcc.old GetPcSpBp() with GCC9 (and recent LLVM)

Unify all NetBSD ports in a single ifdef.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \

src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.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.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.7 src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.8
--- src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.7	Sun Nov 11 22:49:44 2018
+++ src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Tue Apr 16 01:44:07 2019
@@ -1157,51 +1157,39 @@ void internal_join_thread(void *th) {}
 #endif
 
 void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) {
-#if defined(__arm__)
-  ucontext_t *ucontext = (ucontext_t*)context;
-# if SANITIZER_NETBSD
+#if SANITIZER_NETBSD
+  // This covers all NetBSD architectures
+  ucontext_t *ucontext = (ucontext_t *)context;
   *pc = _UC_MACHINE_PC(ucontext);
+  *bp = _UC_MACHINE_FP(ucontext);
   *sp = _UC_MACHINE_SP(ucontext);
-  *bp = ucontext->uc_mcontext.__gregs[_REG_R11];
-# else
+#elif defined(__arm__)
+  ucontext_t *ucontext = (ucontext_t*)context;
   *pc = ucontext->uc_mcontext.arm_pc;
   *bp = ucontext->uc_mcontext.arm_fp;
   *sp = ucontext->uc_mcontext.arm_sp;
-# endif
 #elif defined(__aarch64__)
   ucontext_t *ucontext = (ucontext_t*)context;
-# if SANITIZER_NETBSD
-  *pc = _UC_MACHINE_PC(ucontext);
-  *sp = _UC_MACHINE_SP(ucontext);
-  *bp = ucontext->uc_mcontext.__gregs[29]; /* XXX */
-# else
   *pc = ucontext->uc_mcontext.pc;
   *bp = ucontext->uc_mcontext.regs[29];
   *sp = ucontext->uc_mcontext.sp;
-# endif
 #elif defined(__hppa__)
   ucontext_t *ucontext = (ucontext_t*)context;
-# if SANITIZER_NETBSD
-  *pc = _UC_MACHINE_PC(ucontext);
-  *sp = _UC_MACHINE_SP(ucontext);
-  *bp = ucontext->uc_mcontext.__gregs[3]; /* XXX */
-#else
   *pc = ucontext->uc_mcontext.sc_iaoq[0];
   /* GCC uses %r3 whenever a frame pointer is needed.  */
   *bp = ucontext->uc_mcontext.sc_gr[3];
   *sp = ucontext->uc_mcontext.sc_gr[30];
-# endif
 #elif defined(__x86_64__)
 # if SANITIZER_FREEBSD
   ucontext_t *ucontext = (ucontext_t*)context;
   *pc = ucontext->uc_mcontext.mc_rip;
   *bp = ucontext->uc_mcontext.mc_rbp;
   *sp = ucontext->uc_mcontext.mc_rsp;
-# elif SANITIZER_NETBSD
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.__gregs[_REG_RIP];
-  *bp = ucontext->uc_mcontext.__gregs[_REG_RBP];
-  *sp = ucontext->uc_mcontext.__gregs[_REG_RSP];
+#elif SANITIZER_OPENBSD
+  sigcontext *ucontext = (sigcontext *)context;
+  *pc = ucontext->sc_rip;
+  *bp = ucontext->sc_rbp;
+  *sp = ucontext->sc_rsp;
 # else
   ucontext_t *ucontext = (ucontext_t*)context;
   *pc = ucontext->uc_mcontext.gregs[REG_RIP];
@@ -1214,89 +1202,73 @@ void GetPcSpBp(void *context, uptr *pc, 
   *pc = ucontext->uc_mcontext.mc_eip;
   *bp = ucontext->uc_mcontext.mc_ebp;
   *sp = ucontext->uc_mcontext.mc_esp;
-# elif SANITIZER_NETBSD
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.__gregs[_REG_EIP];
-  *bp = ucontext->uc_mcontext.__gregs[_REG_EBP];
-  *sp = ucontext->uc_mcontext.__gregs[_REG_ESP];
-# else
-  ucontext_t *ucontext = (ucontext_t*)context;
+#elif SANITIZER_OPENBSD
+  sigcontext *ucontext = (sigcontext *)context;
+  *pc = ucontext->sc_eip;
+  *bp = ucontext->sc_ebp;
+  *sp = ucontext->sc_esp;
+# else
+  ucontext_t *ucontext = (ucontext_t*)context;
+# if SANITIZER_SOLARIS
+  /* Use the numeric values: the symbolic ones are undefined by llvm
+ include/llvm/Support/Solaris.h.  */
+# ifndef REG_EIP
+#  define REG_EIP 14 // REG_PC
+# endif
+# ifndef REG_EBP
+#  define REG_EBP  6 // REG_FP
+# endif
+# ifndef REG_ESP
+#  define REG_ESP 17 // REG_SP
+# endif
+# endif
   *pc = ucontext->uc_mcontext.gregs[REG_EIP];
   *bp = ucontext->uc_mcontext.gregs[REG_EBP];
   *sp = ucontext->uc_mcontext.gregs[REG_ESP];
 # endif
 #elif defined(__powerpc__) || defined(__powerpc64__)
   ucontext_t *ucontext = (ucontext_t*)context;
-# if SANITIZER_NETBSD
-  *pc = _UC_MACHINE_PC(ucontext);
-  *sp = _UC_MACHINE_SP(ucontext);
-  *bp = ucontext->uc_mcontext.__gregs[_REG_R31];
-#  else
   *pc = ucontext->uc_mcontext.regs->nip;
   *sp = ucontext->uc_mcontext.regs->gpr[PT_R1];
   // The powerpc{,64}-linux ABIs do not specify r31 as the frame
   // pointer, but GCC always uses r31 when we need a frame pointer.
   *bp = ucontext->uc_mcontext.regs->gpr[PT_R31];
-# endif
 #elif defined(__sparc__)
+# if defined(__arch64__) || 

CVS commit: src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common

2019-04-15 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Apr 16 01:44:07 UTC 2019

Modified Files:
src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Sync gcc.old GetPcSpBp() with GCC9 (and recent LLVM)

Unify all NetBSD ports in a single ifdef.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \

src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.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.old/dist/gcc/config/vax

2019-04-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  2 02:59:50 UTC 2019

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

Log Message:
Compiling some files with -fPIC and -O2 ends up having global
symbols classified as local in pic mode, and that ends up with PC32
relocations "movl *psp, %rx" (/bin/sh parse.c). Treat pic code as
shared libraries to avoid classifying common initialized symbols
as local. Thanks to thorpej@ for his help.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax

2019-04-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  2 02:59:50 UTC 2019

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

Log Message:
Compiling some files with -fPIC and -O2 ends up having global
symbols classified as local in pic mode, and that ends up with PC32
relocations "movl *psp, %rx" (/bin/sh parse.c). Treat pic code as
shared libraries to avoid classifying common initialized symbols
as local. Thanks to thorpej@ for his help.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.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.old/dist/gcc/config/vax/vax.c
diff -u src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.6 src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.7
--- src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c:1.6	Wed Aug  1 20:03:02 2018
+++ src/external/gpl3/gcc.old/dist/gcc/config/vax/vax.c	Mon Apr  1 22:59:50 2019
@@ -114,6 +114,18 @@ static bool vax_mode_dependent_address_p
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE vax_option_override
 
+#if TARGET_ELF
+#undef TARGET_BINDS_LOCAL_P
+#define TARGET_BINDS_LOCAL_P vax_elf_binds_local_p
+
+static bool
+vax_elf_binds_local_p (const_tree exp)
+{
+  return default_binds_local_p_3 (exp, (flag_shlib | flag_pic) != 0,
+  true, false, false);
+}
+#endif
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* Set global variables as needed for the options enabled.  */



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

2019-01-31 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Jan 31 20:44:46 UTC 2019

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/common/config/riscv: riscv-common.c
src/external/gpl3/gcc.old/dist/gcc/config/riscv: constraints.md elf.h
generic.md linux.h peephole.md predicates.md riscv-ftypes.def
riscv-modes.def riscv-protos.h riscv.c riscv.h riscv.md riscv.opt
sync.md
src/external/gpl3/gcc.old/dist/libgcc/config/riscv: t-elf
Removed Files:
src/external/gpl3/gcc.old/dist/gcc/config/riscv: default-32.h
linux-unwind.h linux64.h netbsd.h opcode-riscv.h

Log Message:
remove our riscv changes in gcc.old.  they were obsolete with GCC 5
update, let alone GCC 6.  new GCC 7 has native support again.

this is really about trying to avoid conflicts when we next have
gcc become gcc.old.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc.old/dist/gcc/common/config/riscv/riscv-common.c
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc.old/dist/gcc/config/riscv/constraints.md \
src/external/gpl3/gcc.old/dist/gcc/config/riscv/elf.h \
src/external/gpl3/gcc.old/dist/gcc/config/riscv/generic.md \
src/external/gpl3/gcc.old/dist/gcc/config/riscv/linux.h \
src/external/gpl3/gcc.old/dist/gcc/config/riscv/peephole.md \
src/external/gpl3/gcc.old/dist/gcc/config/riscv/predicates.md \
src/external/gpl3/gcc.old/dist/gcc/config/riscv/riscv-ftypes.def \
src/external/gpl3/gcc.old/dist/gcc/config/riscv/riscv-modes.def \
src/external/gpl3/gcc.old/dist/gcc/config/riscv/riscv-protos.h \
src/external/gpl3/gcc.old/dist/gcc/config/riscv/riscv.c \
src/external/gpl3/gcc.old/dist/gcc/config/riscv/riscv.h \
src/external/gpl3/gcc.old/dist/gcc/config/riscv/riscv.md \
src/external/gpl3/gcc.old/dist/gcc/config/riscv/riscv.opt \
src/external/gpl3/gcc.old/dist/gcc/config/riscv/sync.md
cvs rdiff -u -r1.3 -r0 \
src/external/gpl3/gcc.old/dist/gcc/config/riscv/default-32.h \
src/external/gpl3/gcc.old/dist/gcc/config/riscv/linux-unwind.h \
src/external/gpl3/gcc.old/dist/gcc/config/riscv/linux64.h \
src/external/gpl3/gcc.old/dist/gcc/config/riscv/netbsd.h \
src/external/gpl3/gcc.old/dist/gcc/config/riscv/opcode-riscv.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc.old/dist/libgcc/config/riscv/t-elf

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.old/dist/libsanitizer/asan

2019-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 17 20:36:51 UTC 2019

Modified Files:
src/external/gpl3/gcc.old/dist/libsanitizer/asan: asan_thread.cc

Log Message:
Use the proper stack aligment for the architecture. Fixes broken asan
tests on i386.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_thread.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.old/dist/libsanitizer/asan/asan_thread.cc
diff -u src/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_thread.cc:1.4 src/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_thread.cc:1.5
--- src/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_thread.cc:1.4	Wed Aug  1 20:03:18 2018
+++ src/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_thread.cc	Thu Jan 17 15:36:51 2019
@@ -9,6 +9,10 @@
 //
 // Thread-related code.
 //===--===//
+
+#define __EXPOSE_STACK
+#include 
+
 #include "asan_allocator.h"
 #include "asan_interceptors.h"
 #include "asan_poisoning.h"
@@ -221,7 +225,10 @@ bool AsanThread::GetStackFrameAccessByAd
 access->frame_descr = (const char *)((uptr*)bottom)[1];
 return true;
   }
-  uptr aligned_addr = addr & ~(SANITIZER_WORDSIZE/8 - 1);  // align addr.
+#ifndef STACK_ALIGNBYTES
+# define STACK_ALIGNBYTES (~(SANITIZER_WORDSIZE/8 - 1))
+#endif
+  uptr aligned_addr = addr & STACK_ALIGNBYTES; // align addr.
   u8 *shadow_ptr = (u8*)MemToShadow(aligned_addr);
   u8 *shadow_bottom = (u8*)MemToShadow(bottom);
 



CVS commit: src/external/gpl3/gcc.old/dist/libsanitizer/asan

2019-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 17 20:36:51 UTC 2019

Modified Files:
src/external/gpl3/gcc.old/dist/libsanitizer/asan: asan_thread.cc

Log Message:
Use the proper stack aligment for the architecture. Fixes broken asan
tests on i386.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_thread.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.old/dist/gcc/config

2019-01-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan  6 18:15:18 UTC 2019

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

Log Message:
now that our profiled c library is pic we can use it in shared objects


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gcc.old/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.old/dist/gcc/config/netbsd.h
diff -u src/external/gpl3/gcc.old/dist/gcc/config/netbsd.h:1.8 src/external/gpl3/gcc.old/dist/gcc/config/netbsd.h:1.9
--- src/external/gpl3/gcc.old/dist/gcc/config/netbsd.h:1.8	Fri Jan  4 13:35:45 2019
+++ src/external/gpl3/gcc.old/dist/gcc/config/netbsd.h	Sun Jan  6 13:15:18 2019
@@ -119,7 +119,11 @@ along with GCC; see the file COPYING3.  
%{!pg:-lposix}}		\
  %{p:-lposix_p}		\
  %{pg:-lposix_p}}		\
-   %{shared:-lc}		\
+   %{shared:			\
+ %{!p:			\
+   %{!pg:-lc}}		\
+ %{p:-lc_p}			\
+   %{pg:-lc_p}}		\
%{!shared:			\
  %{!symbolic:		\
%{!p:			\
@@ -133,7 +137,11 @@ along with GCC; see the file COPYING3.  
%{!pg:-lposix}}		\
  %{p:-lposix_p}		\
  %{pg:-lposix_p}}		\
-   %{shared:-lc}		\
+   %{shared:			\
+ %{!p:			\
+   %{!pg:-lc}}		\
+ %{p:-lc_p}			\
+   %{pg:-lc_p}}		\
%{!shared:			\
  %{!symbolic:		\
%{!p:			\



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

2019-01-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan  6 18:15:18 UTC 2019

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

Log Message:
now that our profiled c library is pic we can use it in shared objects


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gcc.old/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.old/dist/gcc/config

2019-01-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  4 18:35:46 UTC 2019

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

Log Message:
Specify that we need the profiled libraries when we are linking c++ with
profiling.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gcc.old/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.old/dist/gcc/config/netbsd.h
diff -u src/external/gpl3/gcc.old/dist/gcc/config/netbsd.h:1.7 src/external/gpl3/gcc.old/dist/gcc/config/netbsd.h:1.8
--- src/external/gpl3/gcc.old/dist/gcc/config/netbsd.h:1.7	Wed Aug  1 20:02:54 2018
+++ src/external/gpl3/gcc.old/dist/gcc/config/netbsd.h	Fri Jan  4 13:35:45 2019
@@ -145,6 +145,9 @@ along with GCC; see the file COPYING3.  
 #undef LIB_SPEC
 #define LIB_SPEC NETBSD_LIB_SPEC
 
+#define LIBSTDCXX_PROFILE "stdc++_p"
+#define MATH_LIBRARY_PROFILE "m_p"
+
 #if 0 // XXXMRG
 #undef STATIC_LIBASAN_LIBS
 #define STATIC_LIBASAN_LIBS "-lstdc++ -lpthread"



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

2019-01-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  4 18:35:46 UTC 2019

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

Log Message:
Specify that we need the profiled libraries when we are linking c++ with
profiling.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gcc.old/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.old/dist/gcc/doc

2018-11-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 11 23:14:17 UTC 2018

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/doc: cpp.info gcc.1 gcc.info

Log Message:
pull across from gcc/: regen after GCC 6.5.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gcc.old/dist/gcc/doc/cpp.info \
src/external/gpl3/gcc.old/dist/gcc/doc/gcc.1 \
src/external/gpl3/gcc.old/dist/gcc/doc/gcc.info

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.old/dist/gcc/doc

2018-11-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov 11 23:14:17 UTC 2018

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/doc: cpp.info gcc.1 gcc.info

Log Message:
pull across from gcc/: regen after GCC 6.5.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gcc.old/dist/gcc/doc/cpp.info \
src/external/gpl3/gcc.old/dist/gcc/doc/gcc.1 \
src/external/gpl3/gcc.old/dist/gcc/doc/gcc.info

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.old/dist/gcc/c-family

2018-09-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 14 20:46:46 UTC 2018

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/c-family: c-format.c c-format.h

Log Message:
The syslog format attribute is a superset of the printf format attribute
so allow functions marked with the printf format attribute to call syslog
without producing warnings with -Wmissing-format-attribute.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gcc.old/dist/gcc/c-family/c-format.c \
src/external/gpl3/gcc.old/dist/gcc/c-family/c-format.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.old/dist/gcc/c-family/c-format.c
diff -u src/external/gpl3/gcc.old/dist/gcc/c-family/c-format.c:1.5 src/external/gpl3/gcc.old/dist/gcc/c-family/c-format.c:1.6
--- src/external/gpl3/gcc.old/dist/gcc/c-family/c-format.c:1.5	Wed Aug  1 20:02:49 2018
+++ src/external/gpl3/gcc.old/dist/gcc/c-family/c-format.c	Fri Sep 14 16:46:46 2018
@@ -887,70 +887,70 @@ static const format_kind_info format_typ
 printf_flag_specs, printf_flag_pairs,
 FMT_FLAG_ARG_CONVERT|FMT_FLAG_DOLLAR_MULTIPLE|FMT_FLAG_USE_DOLLAR|FMT_FLAG_EMPTY_PREC_OK,
 'w', 0, 'p', 0, 'L', 0,
-_type_node, _type_node
+_type_node, _type_node, format_type_error
   },
   { "asm_fprintf",   asm_fprintf_length_specs,  asm_fprintf_char_table, " +#0-", NULL,
 asm_fprintf_flag_specs, asm_fprintf_flag_pairs,
 FMT_FLAG_ARG_CONVERT|FMT_FLAG_EMPTY_PREC_OK,
 'w', 0, 'p', 0, 'L', 0,
-NULL, NULL
+NULL, NULL, format_type_error
   },
   { "gcc_diag",   gcc_diag_length_specs,  gcc_diag_char_table, "q+#", NULL,
 gcc_diag_flag_specs, gcc_diag_flag_pairs,
 FMT_FLAG_ARG_CONVERT|FMT_FLAG_M_OK,
 0, 0, 'p', 0, 'L', 0,
-NULL, _type_node
+NULL, _type_node, format_type_error
   },
   { "gcc_tdiag",   gcc_tdiag_length_specs,  gcc_tdiag_char_table, "q+#", NULL,
 gcc_tdiag_flag_specs, gcc_tdiag_flag_pairs,
 FMT_FLAG_ARG_CONVERT|FMT_FLAG_M_OK,
 0, 0, 'p', 0, 'L', 0,
-NULL, _type_node
+NULL, _type_node, format_type_error
   },
   { "gcc_cdiag",   gcc_cdiag_length_specs,  gcc_cdiag_char_table, "q+#", NULL,
 gcc_cdiag_flag_specs, gcc_cdiag_flag_pairs,
 FMT_FLAG_ARG_CONVERT|FMT_FLAG_M_OK,
 0, 0, 'p', 0, 'L', 0,
-NULL, _type_node
+NULL, _type_node, format_type_error
   },
   { "gcc_cxxdiag",   gcc_cxxdiag_length_specs,  gcc_cxxdiag_char_table, "q+#", NULL,
 gcc_cxxdiag_flag_specs, gcc_cxxdiag_flag_pairs,
 FMT_FLAG_ARG_CONVERT|FMT_FLAG_M_OK,
 0, 0, 'p', 0, 'L', 0,
-NULL, _type_node
+NULL, _type_node, format_type_error
   },
   { "gcc_gfc", gcc_gfc_length_specs, gcc_gfc_char_table, "q+#", NULL,
 gcc_gfc_flag_specs, gcc_gfc_flag_pairs,
 FMT_FLAG_ARG_CONVERT|FMT_FLAG_M_OK,
 0, 0, 0, 0, 0, 0,
-NULL, NULL
+NULL, NULL, format_type_error
   },
   { "NSString",   NULL,  NULL, NULL, NULL,
 NULL, NULL,
 FMT_FLAG_ARG_CONVERT|FMT_FLAG_PARSE_ARG_CONVERT_EXTERNAL, 0, 0, 0, 0, 0, 0,
-NULL, NULL
+NULL, NULL, format_type_error
   },
   { "gnu_scanf",scanf_length_specs,   scan_char_table,  "*'I", NULL,
 scanf_flag_specs, scanf_flag_pairs,
 FMT_FLAG_ARG_CONVERT|FMT_FLAG_SCANF_A_KLUDGE|FMT_FLAG_USE_DOLLAR|FMT_FLAG_ZERO_WIDTH_BAD|FMT_FLAG_DOLLAR_GAP_POINTER_OK,
 'w', 0, 0, '*', 'L', 'm',
-NULL, NULL
+NULL, NULL, format_type_error
   },
   { "gnu_strftime", NULL, time_char_table,  "_-0^#", "EO",
 strftime_flag_specs, strftime_flag_pairs,
 FMT_FLAG_FANCY_PERCENT_OK|FMT_FLAG_M_OK, 'w', 0, 0, 0, 0, 0,
-NULL, NULL
+NULL, NULL, format_type_error
   },
   { "gnu_strfmon",  strfmon_length_specs, monetary_char_table, "=^+(!-", NULL,
 strfmon_flag_specs, strfmon_flag_pairs,
 FMT_FLAG_ARG_CONVERT, 'w', '#', 'p', 0, 'L', 0,
-NULL, NULL
+NULL, NULL, format_type_error
   },
   { "gnu_syslog",   printf_length_specs,  print_char_table, " +#0-'I", NULL,
 printf_flag_specs, printf_flag_pairs,
 FMT_FLAG_ARG_CONVERT|FMT_FLAG_DOLLAR_MULTIPLE|FMT_FLAG_USE_DOLLAR|FMT_FLAG_EMPTY_PREC_OK|FMT_FLAG_M_OK,
 'w', 0, 'p', 0, 'L', 0,
-_type_node, _type_node
+_type_node, _type_node, printf_format_type
   },
 };
 
@@ -1098,19 +1098,25 @@ check_function_format (tree attrs, int n
 		params = tree_cons (NULL_TREE, argarray[i], params);
 	  check_format_info (, params);
 	}
+	  const format_kind_info *fi = _types[info.format_type];
 	  if (warn_suggest_attribute_format && info.first_arg_num == 0
-	  && (format_types[info.format_type].flags
-		  & (int) FMT_FLAG_ARG_CONVERT))
+	  && (fi->flags & (int) FMT_FLAG_ARG_CONVERT))
 	{
 	  tree c;
 	  for (c = TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl));
 		   c;
 		   c = TREE_CHAIN (c))
-		if (is_attribute_p ("format", TREE_PURPOSE (c))
-		&& (decode_format_type (IDENTIFIER_POINTER
-	

CVS commit: src/external/gpl3/gcc.old/dist/gcc/c-family

2018-09-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 14 20:46:46 UTC 2018

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/c-family: c-format.c c-format.h

Log Message:
The syslog format attribute is a superset of the printf format attribute
so allow functions marked with the printf format attribute to call syslog
without producing warnings with -Wmissing-format-attribute.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gcc.old/dist/gcc/c-family/c-format.c \
src/external/gpl3/gcc.old/dist/gcc/c-family/c-format.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.old/dist

2018-09-03 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Sep  3 22:52:00 UTC 2018

Modified Files:
src/external/gpl3/gcc.old/dist/config: tls.m4
src/external/gpl3/gcc.old/dist/libgcc: configure

Log Message:
Correct missing paren and regen for gcc.old, too.

Now HAVE_CC_TLS will be defined in confdefs.h.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gcc.old/dist/config/tls.m4
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gcc.old/dist/libgcc/configure

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.old/dist/config/tls.m4
diff -u src/external/gpl3/gcc.old/dist/config/tls.m4:1.5 src/external/gpl3/gcc.old/dist/config/tls.m4:1.6
--- src/external/gpl3/gcc.old/dist/config/tls.m4:1.5	Sun Jul 23 01:10:52 2017
+++ src/external/gpl3/gcc.old/dist/config/tls.m4	Mon Sep  3 22:52:00 2018
@@ -104,7 +104,7 @@ AC_DEFUN([GCC_CHECK_CC_TLS], [
 		 gcc_cv_have_cc_tls, [
 AC_COMPILE_IFELSE([__thread int a; int b; int main() { return a = b; }],
   [gcc_cv_have_cc_tls=yes], [gcc_cv_have_cc_tls=no])]
-)])
+)
   if test "$enable_tls $gcc_cv_have_cc_tls" = "yes yes"; then
 AC_DEFINE(HAVE_CC_TLS, 1,
 	  [Define to 1 if the target assembler supports thread-local storage.])

Index: src/external/gpl3/gcc.old/dist/libgcc/configure
diff -u src/external/gpl3/gcc.old/dist/libgcc/configure:1.7 src/external/gpl3/gcc.old/dist/libgcc/configure:1.8
--- src/external/gpl3/gcc.old/dist/libgcc/configure:1.7	Thu Aug  2 00:03:08 2018
+++ src/external/gpl3/gcc.old/dist/libgcc/configure	Mon Sep  3 22:52:00 2018
@@ -4957,6 +4957,11 @@ rm -f core conftest.err conftest.$ac_obj
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_have_cc_tls" >&5
 $as_echo "$gcc_cv_have_cc_tls" >&6; }
+  if test "$enable_tls $gcc_cv_have_cc_tls" = "yes yes"; then
+
+$as_echo "#define HAVE_CC_TLS 1" >>confdefs.h
+
+  fi
 set_have_cc_tls=
 if test "$enable_tls $gcc_cv_have_cc_tls" = "yes yes"; then
   set_have_cc_tls="-DHAVE_CC_TLS"



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

2018-09-03 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Sep  3 22:52:00 UTC 2018

Modified Files:
src/external/gpl3/gcc.old/dist/config: tls.m4
src/external/gpl3/gcc.old/dist/libgcc: configure

Log Message:
Correct missing paren and regen for gcc.old, too.

Now HAVE_CC_TLS will be defined in confdefs.h.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gcc.old/dist/config/tls.m4
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gcc.old/dist/libgcc/configure

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.old/dist/libsanitizer/sanitizer_common

2018-05-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed May 23 11:16:13 UTC 2018

Modified Files:
src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Cherry-pick upstream patch for internal_mmap() in GCC(.old) sanitizers

Fix internal_mmap() on 32-bit NetBSD platforms

There is need to use internal_syscall64() instead of internal_syscall_ptr().
The offset argument of type off_t is always 64-bit.

http://llvm.org/viewvc/llvm-project?view=revision=333075

PR kern/53261 by Martin Husemann


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \

src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.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.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.4 src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.5
--- src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.4	Mon Nov 13 08:05:22 2017
+++ src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Wed May 23 11:16:13 2018
@@ -103,7 +103,7 @@ namespace __sanitizer {
 uptr internal_mmap(void *addr, uptr length, int prot, int flags,
 int fd, u64 offset) {
 #if SANITIZER_NETBSD
-  return internal_syscall_ptr(SYSCALL(mmap), addr, length, prot, flags, fd,
+  return internal_syscall64(SYSCALL(mmap), addr, length, prot, flags, fd,
 			  (long)0, offset);
 #elif SANITIZER_FREEBSD || SANITIZER_LINUX_USES_64BIT_SYSCALLS
   return internal_syscall(SYSCALL(mmap), (uptr)addr, length, prot, flags, fd,



CVS commit: src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common

2018-05-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed May 23 11:16:13 UTC 2018

Modified Files:
src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Cherry-pick upstream patch for internal_mmap() in GCC(.old) sanitizers

Fix internal_mmap() on 32-bit NetBSD platforms

There is need to use internal_syscall64() instead of internal_syscall_ptr().
The offset argument of type off_t is always 64-bit.

http://llvm.org/viewvc/llvm-project?view=revision=333075

PR kern/53261 by Martin Husemann


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \

src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.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.old/dist/gcc

2018-03-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Mar 28 19:24:52 UTC 2018

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/config/i386: constraints.md
i386-opts.h i386-protos.h i386.c i386.h i386.md i386.opt
predicates.md
src/external/gpl3/gcc.old/dist/gcc/doc: extend.texi invoke.texi

Log Message:
add the spectre mitigation options for x86:

  -mindirect-branch=
  -mfunction-return=
  -mindirect-branch-register

the values for 'choice' are "keep" (default, existing behaviour),
"thunk", "thunk-inline", and "thunk-extern".

as taken from the Ubuntu port of these changes in their
ubuntu:gcc-5_5.5.0-8ubuntu1.diff.  i've also included the doc
updates that are missing from ubuntu from gcc itself.

i've tested both i386 and amd64 fairly heavily with these options
enabled in both kernels and userland, atf runs and hundreds of
package builds.

XXX: pullup-8 to gcc/ not gcc.old/


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/constraints.md \
src/external/gpl3/gcc.old/dist/gcc/config/i386/i386-protos.h \
src/external/gpl3/gcc.old/dist/gcc/config/i386/predicates.md
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/i386-opts.h
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.c
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.h \
src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.md \
src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.opt
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc.old/dist/gcc/doc/extend.texi \
src/external/gpl3/gcc.old/dist/gcc/doc/invoke.texi

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.old/dist/gcc/config/i386/constraints.md
diff -u src/external/gpl3/gcc.old/dist/gcc/config/i386/constraints.md:1.5 src/external/gpl3/gcc.old/dist/gcc/config/i386/constraints.md:1.6
--- src/external/gpl3/gcc.old/dist/gcc/config/i386/constraints.md:1.5	Sun Jul 23 01:11:06 2017
+++ src/external/gpl3/gcc.old/dist/gcc/config/i386/constraints.md	Wed Mar 28 19:24:52 2018
@@ -157,12 +157,14 @@
 
 (define_constraint "Bs"
   "@internal Sibcall memory operand."
-  (and (not (match_test "TARGET_X32"))
+  (and (not (match_test "ix86_indirect_branch_register"))
+   (not (match_test "TARGET_X32"))
(match_operand 0 "sibcall_memory_operand")))
 
 (define_constraint "Bw"
   "@internal Call memory operand."
-  (and (not (match_test "TARGET_X32"))
+  (and (not (match_test "ix86_indirect_branch_register"))
+   (not (match_test "TARGET_X32"))
(match_operand 0 "memory_operand")))
 
 (define_constraint "Bz"
Index: src/external/gpl3/gcc.old/dist/gcc/config/i386/i386-protos.h
diff -u src/external/gpl3/gcc.old/dist/gcc/config/i386/i386-protos.h:1.5 src/external/gpl3/gcc.old/dist/gcc/config/i386/i386-protos.h:1.6
--- src/external/gpl3/gcc.old/dist/gcc/config/i386/i386-protos.h:1.5	Sun Jul 23 01:11:06 2017
+++ src/external/gpl3/gcc.old/dist/gcc/config/i386/i386-protos.h	Wed Mar 28 19:24:52 2018
@@ -306,6 +306,8 @@ extern enum attr_cpu ix86_schedule;
 #endif
 
 extern const char * ix86_output_call_insn (rtx_insn *insn, rtx call_op);
+extern const char * ix86_output_indirect_jmp (rtx call_op, bool ret_p);
+extern const char * ix86_output_function_return (bool long_p);
 
 #ifdef RTX_CODE
 /* Target data for multipass lookahead scheduling.
Index: src/external/gpl3/gcc.old/dist/gcc/config/i386/predicates.md
diff -u src/external/gpl3/gcc.old/dist/gcc/config/i386/predicates.md:1.5 src/external/gpl3/gcc.old/dist/gcc/config/i386/predicates.md:1.6
--- src/external/gpl3/gcc.old/dist/gcc/config/i386/predicates.md:1.5	Sun Jul 23 01:11:06 2017
+++ src/external/gpl3/gcc.old/dist/gcc/config/i386/predicates.md	Wed Mar 28 19:24:52 2018
@@ -607,7 +607,8 @@
 ;; Test for a valid operand for indirect branch.
 (define_predicate "indirect_branch_operand"
   (ior (match_operand 0 "register_operand")
-   (and (not (match_test "TARGET_X32"))
+   (and (not (match_test "ix86_indirect_branch_register"))
+	(not (match_test "TARGET_X32"))
 	(match_operand 0 "memory_operand"
 
 ;; Test for a valid operand for a call instruction.
@@ -616,7 +617,8 @@
   (ior (match_test "constant_call_address_operand
 		 (op, mode == VOIDmode ? mode : Pmode)")
(match_operand 0 "call_register_no_elim_operand")
-   (and (not (match_test "TARGET_X32"))
+   (and (not (match_test "ix86_indirect_branch_register"))
+	(not (match_test "TARGET_X32"))
 	(match_operand 0 "memory_operand"
 
 ;; Similarly, but for tail calls, in which we cannot allow memory references.
@@ -624,7 +626,8 @@
   (ior (match_test "constant_call_address_operand
 		 (op, mode == VOIDmode ? mode : Pmode)")
(match_operand 0 "register_no_elim_operand")
-   (and (not (match_test "TARGET_X32"))
+ 

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

2018-03-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Mar 28 19:24:52 UTC 2018

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/config/i386: constraints.md
i386-opts.h i386-protos.h i386.c i386.h i386.md i386.opt
predicates.md
src/external/gpl3/gcc.old/dist/gcc/doc: extend.texi invoke.texi

Log Message:
add the spectre mitigation options for x86:

  -mindirect-branch=
  -mfunction-return=
  -mindirect-branch-register

the values for 'choice' are "keep" (default, existing behaviour),
"thunk", "thunk-inline", and "thunk-extern".

as taken from the Ubuntu port of these changes in their
ubuntu:gcc-5_5.5.0-8ubuntu1.diff.  i've also included the doc
updates that are missing from ubuntu from gcc itself.

i've tested both i386 and amd64 fairly heavily with these options
enabled in both kernels and userland, atf runs and hundreds of
package builds.

XXX: pullup-8 to gcc/ not gcc.old/


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/constraints.md \
src/external/gpl3/gcc.old/dist/gcc/config/i386/i386-protos.h \
src/external/gpl3/gcc.old/dist/gcc/config/i386/predicates.md
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/i386-opts.h
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.c
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.h \
src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.md \
src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.opt
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc.old/dist/gcc/doc/extend.texi \
src/external/gpl3/gcc.old/dist/gcc/doc/invoke.texi

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.old/dist/libsanitizer/asan

2018-02-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb 15 19:02:06 UTC 2018

Modified Files:
src/external/gpl3/gcc.old/dist/libsanitizer/asan: asan_linux.cc

Log Message:
we now has _UC_MACHINE_FP.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_linux.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.old/dist/libsanitizer/asan/asan_linux.cc
diff -u src/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_linux.cc:1.3 src/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_linux.cc:1.4
--- src/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_linux.cc:1.3	Sat Jul 22 21:11:29 2017
+++ src/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_linux.cc	Thu Feb 15 14:02:06 2018
@@ -162,40 +162,42 @@ void AsanCheckIncompatibleRT() {
 
 void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) {
 #ifdef __NetBSD__
-# define __UC_MACHINE_FP(ucontext, r) \
+# ifndef _UC_MACHINE_FP
+#  define __UC_MACHINE_FP(ucontext, r) \
 (ucontext)->uc_mcontext.__gregs[(r)]
 /*
  * Unfortunately we don't have a portable frame pointer (yet)
  */
-# if defined(__alpha__)
-#  define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_S6)
-# elif defined(__arm__)
-#  define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_FP)
-# elif defined(__x86_64__)
-#  define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_RBP)
-# elif defined(__i386__)
-#  define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_EBP)
-# elif defined(__m68k__)
-#  define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_A6)
-# elif defined(__mips__)
-#  define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_S8)
-# elif defined(__powerpc__) || defined(__powerpc64__)
-#  define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_R1)
-# elif defined(__riscv__)
-#  define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_S0)
-# elif defined(__sparc__)
-#  define _UC_MACHINE_FP(ucontext) sp[15]
-# elif defined(__sh3__)
-#  define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_R14)
-# elif defined(__vax__)
-#  define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_FP)
-# else
-#  define _UC_MACHINE_FP(ucontext) 0
-# endif
+#  if defined(__alpha__)
+#   define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_S6)
+#  elif defined(__arm__)
+#   define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_FP)
+#  elif defined(__x86_64__)
+#   define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_RBP)
+#  elif defined(__i386__)
+#   define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_EBP)
+#  elif defined(__m68k__)
+#   define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_A6)
+#  elif defined(__mips__)
+#   define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_S8)
+#  elif defined(__powerpc__) || defined(__powerpc64__)
+#   define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_R1)
+#  elif defined(__riscv__)
+#   define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_S0)
+#  elif defined(__sparc__)
+#   define _UC_MACHINE_FP(ucontext) sp[15]
+#  elif defined(__sh3__)
+#   define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_R14)
+#  elif defined(__vax__)
+#   define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_FP)
+#  else
+#   define _UC_MACHINE_FP(ucontext) 0
+#  endif
   ucontext_t *ucontext = (ucontext_t*)context;
   *pc = _UC_MACHINE_PC(ucontext);
   *sp = _UC_MACHINE_SP(ucontext);
   *bp = _UC_MACHINE_FP(ucontext);
+# endif
 #elif ASAN_ANDROID
   *pc = *sp = *bp = 0;
 #elif defined(__arm__)



CVS commit: src/external/gpl3/gcc.old/dist/libsanitizer/asan

2018-02-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb 15 19:02:06 UTC 2018

Modified Files:
src/external/gpl3/gcc.old/dist/libsanitizer/asan: asan_linux.cc

Log Message:
we now has _UC_MACHINE_FP.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_linux.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.old/dist/gcc

2017-11-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Nov 16 13:54:58 UTC 2017

Modified Files:
src/external/gpl3/gcc.old/dist/gcc: tree-ssa-ccp.c

Log Message:
Match hppa JEMALLOC_TINY_MIN_2POW


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc.old/dist/gcc/tree-ssa-ccp.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.old/dist/gcc

2017-11-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Nov 16 13:54:58 UTC 2017

Modified Files:
src/external/gpl3/gcc.old/dist/gcc: tree-ssa-ccp.c

Log Message:
Match hppa JEMALLOC_TINY_MIN_2POW


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc.old/dist/gcc/tree-ssa-ccp.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.old/dist/gcc/tree-ssa-ccp.c
diff -u src/external/gpl3/gcc.old/dist/gcc/tree-ssa-ccp.c:1.6 src/external/gpl3/gcc.old/dist/gcc/tree-ssa-ccp.c:1.7
--- src/external/gpl3/gcc.old/dist/gcc/tree-ssa-ccp.c:1.6	Sun Jul 23 01:10:58 2017
+++ src/external/gpl3/gcc.old/dist/gcc/tree-ssa-ccp.c	Thu Nov 16 13:54:58 2017
@@ -2850,7 +2850,9 @@ make_pass_fold_builtins (gcc::context *c
  * time assert that the value matches gcc's MALLOC_ABI_ALIGNMENT here.
  */
 
-#if defined(__alpha__) || defined(__amd64__) || defined(__sparc64__)	\
+#if defined(__hppa__)
+#define	JEMALLOC_TINY_MIN_2POW	4
+#elif defined(__alpha__) || defined(__amd64__) || defined(__sparc64__)	\
  ||	(defined(__arm__) && defined(__ARM_EABI__)) \
  || defined(__ia64__) || defined(__powerpc__) \
  || ((defined(__mips__) || defined(__riscv__)) && defined(_LP64))



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

2017-11-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 13 11:49:16 UTC 2017

Modified Files:
src/external/gpl3/gcc.old/dist/gcc: toplev.c

Log Message:
Fix what looks like a merge botch.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc.old/dist/gcc/toplev.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.old/dist/gcc/toplev.c
diff -u src/external/gpl3/gcc.old/dist/gcc/toplev.c:1.6 src/external/gpl3/gcc.old/dist/gcc/toplev.c:1.7
--- src/external/gpl3/gcc.old/dist/gcc/toplev.c:1.6	Mon Nov 13 08:05:17 2017
+++ src/external/gpl3/gcc.old/dist/gcc/toplev.c	Mon Nov 13 11:49:16 2017
@@ -1386,8 +1386,7 @@ process_options (void)
 
   if (flag_sanitize & SANITIZE_THREAD)
 	{
-	  error (UNKNOWN_LOCATION,
-		 "%<-fcheck-pointer-bounds%> is not supported with "
+	  error ("%<-fcheck-pointer-bounds%> is not supported with "
 		 "Thread Sanitizer");
 
 	  flag_check_pointer_bounds = 0;



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

2017-11-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 13 11:49:16 UTC 2017

Modified Files:
src/external/gpl3/gcc.old/dist/gcc: toplev.c

Log Message:
Fix what looks like a merge botch.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc.old/dist/gcc/toplev.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.old/dist/gcc/config/i386

2017-07-28 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Jul 28 22:24:27 UTC 2017

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

Log Message:
Apply upstream patch:
Incorrect codegen from rdseed intrinsic use (CVE-2017-11671)

We should not expand call arguments in between flags reg setting and
flags reg using instructions, as it may expand with flags reg
clobbering insn (ADD in this case).

Attached patch moves expansion out of the link. Also, change
zero-extension to non-flags reg clobbering sequence in case we perform
zero-extension with and.

2017-03-25  Uros Bizjak


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.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.old/dist/gcc/config/i386/i386.c
diff -u src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.c:1.6 src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.c:1.7
--- src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.c:1.6	Sun Jul 23 01:11:06 2017
+++ src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.c	Fri Jul 28 22:24:27 2017
@@ -39529,9 +39529,6 @@ ix86_expand_builtin (tree exp, rtx targe
   mode0 = DImode;
 
 rdrand_step:
-  op0 = gen_reg_rtx (mode0);
-  emit_insn (GEN_FCN (icode) (op0));
-
   arg0 = CALL_EXPR_ARG (exp, 0);
   op1 = expand_normal (arg0);
   if (!address_operand (op1, VOIDmode))
@@ -39539,6 +39536,10 @@ rdrand_step:
 	  op1 = convert_memory_address (Pmode, op1);
 	  op1 = copy_addr_to_reg (op1);
 	}
+
+  op0 = gen_reg_rtx (mode0);
+  emit_insn (GEN_FCN (icode) (op0));
+
   emit_move_insn (gen_rtx_MEM (mode0, op1), op0);
 
   op1 = gen_reg_rtx (SImode);
@@ -39547,8 +39548,20 @@ rdrand_step:
   /* Emit SImode conditional move.  */
   if (mode0 == HImode)
 	{
-	  op2 = gen_reg_rtx (SImode);
-	  emit_insn (gen_zero_extendhisi2 (op2, op0));
+	  if (TARGET_ZERO_EXTEND_WITH_AND
+	  && optimize_function_for_speed_p (cfun))
+	{
+	  op2 = force_reg (SImode, const0_rtx);
+
+	  emit_insn (gen_movstricthi
+			 (gen_lowpart (HImode, op2), op0));
+	}
+	  else
+	{
+	  op2 = gen_reg_rtx (SImode);
+
+	  emit_insn (gen_zero_extendhisi2 (op2, op0));
+	}
 	}
   else if (mode0 == SImode)
 	op2 = op0;
@@ -39580,9 +39593,6 @@ rdrand_step:
   mode0 = DImode;
 
 rdseed_step:
-  op0 = gen_reg_rtx (mode0);
-  emit_insn (GEN_FCN (icode) (op0));
-
   arg0 = CALL_EXPR_ARG (exp, 0);
   op1 = expand_normal (arg0);
   if (!address_operand (op1, VOIDmode))
@@ -39590,6 +39600,10 @@ rdseed_step:
 	  op1 = convert_memory_address (Pmode, op1);
 	  op1 = copy_addr_to_reg (op1);
 	}
+
+  op0 = gen_reg_rtx (mode0);
+  emit_insn (GEN_FCN (icode) (op0));
+
   emit_move_insn (gen_rtx_MEM (mode0, op1), op0);
 
   op2 = gen_reg_rtx (QImode);



CVS commit: src/external/gpl3/gcc.old/dist/gcc/config/i386

2017-07-28 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Jul 28 22:24:27 UTC 2017

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

Log Message:
Apply upstream patch:
Incorrect codegen from rdseed intrinsic use (CVE-2017-11671)

We should not expand call arguments in between flags reg setting and
flags reg using instructions, as it may expand with flags reg
clobbering insn (ADD in this case).

Attached patch moves expansion out of the link. Also, change
zero-extension to non-flags reg clobbering sequence in case we perform
zero-extension with and.

2017-03-25  Uros Bizjak


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.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.old/dist/libgcc/config/m68k

2016-04-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 22 18:05:52 UTC 2016

Modified Files:
src/external/gpl3/gcc.old/dist/libgcc/config/m68k: lb1sf68.S

Log Message:
Propagate PLT fix from our gcc-5.3 tree:

Some functions like __udivsi3 are used in other assembly files like __umodsi3.
Use PLT linkage to avoid text relocations.

XXX: pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gcc.old/dist/libgcc/config/m68k/lb1sf68.S

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.old/dist/libgcc/config/m68k/lb1sf68.S
diff -u src/external/gpl3/gcc.old/dist/libgcc/config/m68k/lb1sf68.S:1.1.1.1 src/external/gpl3/gcc.old/dist/libgcc/config/m68k/lb1sf68.S:1.2
--- src/external/gpl3/gcc.old/dist/libgcc/config/m68k/lb1sf68.S:1.1.1.1	Tue Sep 22 23:03:07 2015
+++ src/external/gpl3/gcc.old/dist/libgcc/config/m68k/lb1sf68.S	Fri Apr 22 14:05:52 2016
@@ -203,7 +203,7 @@ see the files COPYING3 and COPYING.RUNTI
 	lea	\addr-.-8,a0
 	jsr	pc@(a0)
 #else
-	jbsr	\addr
+	jbsr	\addr@PLTPC
 #endif
 	.endm
 
@@ -215,7 +215,7 @@ see the files COPYING3 and COPYING.RUNTI
 	lea	\addr-.-8,a0
 	jmp	pc@(a0)
 #else
-	bra	\addr
+	bra	\addr@PLTPC
 #endif
 	.endm
 



CVS commit: src/external/gpl3/gcc.old/dist/libgcc/config/m68k

2016-04-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 22 18:05:52 UTC 2016

Modified Files:
src/external/gpl3/gcc.old/dist/libgcc/config/m68k: lb1sf68.S

Log Message:
Propagate PLT fix from our gcc-5.3 tree:

Some functions like __udivsi3 are used in other assembly files like __umodsi3.
Use PLT linkage to avoid text relocations.

XXX: pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gcc.old/dist/libgcc/config/m68k/lb1sf68.S

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.old/dist/gcc

2016-04-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Apr 20 06:51:03 UTC 2016

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

Log Message:
Re-order includes so that ARM_TARGET2_DWARF_FORMAT takes effect

Fixes PR/51066: C++ text relocations


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

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



  1   2   >