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.



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/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/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/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/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/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/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/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/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/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.



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.

Modified files:

Index: src/external/gpl3/gcc.old/dist/gcc/config.gcc
diff -u src/external/gpl3/gcc.old/dist/gcc/config.gcc:1.4 src/external/gpl3/gcc.old/dist/gcc/config.gcc:1.5
--- src/external/gpl3/gcc.old/dist/gcc/config.gcc:1.4	Wed Sep 23 03:39:09 2015
+++ src/external/gpl3/gcc.old/dist/gcc/config.gcc	Wed Apr 20 06:51:03 2016
@@ -889,7 +889,7 @@ arm-wrs-vxworks)
 	;;
 arm*-*-netbsdelf*)
 	tmake_file="${tmake_file} arm/t-arm"
-	tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h arm/aout.h arm/arm.h"
+	tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h"
 	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
 	case ${target} in
 	arm*eb-*) tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" ;;
@@ -910,6 +910,7 @@ arm*-*-netbsdelf*)
 	tmake_file="$tmake_file arm/t-netbsd"
 	;;
 	esac
+	tm_file="${tm_file} arm/aout.h arm/arm.h"
 	case ${target} in
 	arm*-*-netbsdelf-*eabihf*)
 	tm_defines="${tm_defines} TARGET_DEFAULT_FLOAT_ABI=ARM_FLOAT_ABI_HARD"



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

2016-03-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 10 14:40:00 UTC 2016

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

Log Message:
sync with the code with have in the current copy of gcc.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gcc.old/dist/gcc/varasm.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/varasm.c
diff -u src/external/gpl3/gcc.old/dist/gcc/varasm.c:1.5 src/external/gpl3/gcc.old/dist/gcc/varasm.c:1.6
--- src/external/gpl3/gcc.old/dist/gcc/varasm.c:1.5	Wed Mar  9 22:50:47 2016
+++ src/external/gpl3/gcc.old/dist/gcc/varasm.c	Thu Mar 10 09:40:00 2016
@@ -6622,7 +6622,7 @@ resolution_local_p (enum ld_plugin_symbo
wrt cross-module name binding.  */
 static bool
 default_binds_local_p_3 (const_tree exp, bool shlib, bool weak_dominate,
-			 bool extern_protected_data)
+			 bool extern_protected_data, bool common_local_p)
 {
   /* A non-decl is an entry in the constant pool.  */
   if (!DECL_P (exp))
@@ -6647,7 +6647,15 @@ default_binds_local_p_3 (const_tree exp,
  because dynamic linking might overwrite symbols
  in shared libraries.  */
   bool resolved_locally = false;
-  bool defined_locally = !DECL_EXTERNAL (exp);
+
+  bool uninited_common = (DECL_COMMON (exp)
+			  && (DECL_INITIAL (exp) == NULL
+			  || (!in_lto_p
+  && DECL_INITIAL (exp) == error_mark_node)));
+
+  bool defined_locally = (!DECL_EXTERNAL (exp)
+			  && (!uninited_common || common_local_p));
+
   if (TREE_CODE (exp) == VAR_DECL && TREE_PUBLIC (exp)
   && (TREE_STATIC (exp) || DECL_EXTERNAL (exp)))
 {
@@ -6702,10 +6710,7 @@ default_binds_local_p_3 (const_tree exp,
 
   /* Uninitialized COMMON variable may be unified with symbols
  resolved from other modules.  */
-  if (DECL_COMMON (exp)
-  && !resolved_locally
-  && (DECL_INITIAL (exp) == NULL
-	  || (!in_lto_p && DECL_INITIAL (exp) == error_mark_node)))
+  if (uninited_common && !resolved_locally)
 return false;
 
   /* Otherwise we're left with initialized (or non-common) global data
@@ -6716,13 +6721,13 @@ default_binds_local_p_3 (const_tree exp,
 bool
 default_binds_local_p (const_tree exp)
 {
-  return default_binds_local_p_3 (exp, flag_shlib != 0, true, false);
+  return default_binds_local_p_3 (exp, flag_shlib != 0, true, false, false);
 }
 
 bool
 default_binds_local_p_1 (const_tree exp, int shlib)
 {
-  return default_binds_local_p_3 (exp, shlib != 0, false, false);
+  return default_binds_local_p_3 (exp, shlib != 0, false, false, false);
 }
 
 /* Similar to default_binds_local_p, but protected data may be
@@ -6730,7 +6735,7 @@ default_binds_local_p_1 (const_tree exp,
 bool
 default_binds_local_p_2 (const_tree exp)
 {
-  return default_binds_local_p_3 (exp, flag_shlib != 0, true, true);
+  return default_binds_local_p_3 (exp, flag_shlib != 0, true, true, !flag_pic);
 }
 
 /* Return true when references to DECL must bind to current definition in



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

2016-03-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 10 14:40:00 UTC 2016

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

Log Message:
sync with the code with have in the current copy of gcc.


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

2016-03-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 10 03:50:48 UTC 2016

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

Log Message:
Do the same song and dance for functions.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gcc.old/dist/gcc/varasm.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/varasm.c
diff -u src/external/gpl3/gcc.old/dist/gcc/varasm.c:1.4 src/external/gpl3/gcc.old/dist/gcc/varasm.c:1.5
--- src/external/gpl3/gcc.old/dist/gcc/varasm.c:1.4	Mon Mar  7 22:58:08 2016
+++ src/external/gpl3/gcc.old/dist/gcc/varasm.c	Wed Mar  9 22:50:47 2016
@@ -6659,6 +6659,17 @@ default_binds_local_p_3 (const_tree exp,
   else if (vnode && resolution_local_p (vnode->symbol.resolution))
 	resolved_locally = true;
 }
+  else if (TREE_CODE (exp) == FUNCTION_DECL && TREE_PUBLIC (exp))
+{
+  struct cgraph_node *cnode = cgraph_get_node (exp);
+  if (cnode && cnode->symbol.in_other_partition)
+	defined_locally = true;
+  if (cnode && resolution_to_local_definition_p (cnode->symbol.resolution))
+	defined_locally = resolved_locally = true;
+  else if (cnode && resolution_local_p (cnode->symbol.resolution))
+	resolved_locally = true;
+}
+
   if (defined_locally && weak_dominate && !shlib)
 resolved_locally = true;
 



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

2016-03-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 10 03:50:48 UTC 2016

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

Log Message:
Do the same song and dance for functions.


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

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

2016-03-09 Thread Christos Zoulas
On Mar 9, 11:13am, hann...@eis.cs.tu-bs.de ("J. Hannken-Illjes") wrote:
-- Subject: Re: CVS commit: src/external/gpl3/gcc.old/dist/gcc

| This change seems to break rump, number of failed tests on arch
| amd64 goes from 19 to 1342, same problem on i386.

Before I go chasing what is wrong here, I suggest that we wait for
gcc-5 (and debugging there), or undoing the patch. It is less work.

christos


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

2016-03-09 Thread J. Hannken-Illjes

> On 08 Mar 2016, at 04:58, Christos Zoulas  wrote:
> 
> Module Name:  src
> Committed By: christos
> Date: Tue Mar  8 03:58:08 UTC 2016
> 
> Modified Files:
>   src/external/gpl3/gcc.old/dist/gcc: output.h varasm.c
>   src/external/gpl3/gcc.old/dist/gcc/config/i386: i386.c
> 
> Log Message:
> Fix copy relocations against protected symbols from:
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gcc.old/dist/gcc/output.h \
>src/external/gpl3/gcc.old/dist/gcc/varasm.c
> cvs rdiff -u -r1.3 -r1.4 \
>src/external/gpl3/gcc.old/dist/gcc/config/i386/i386.c

This change seems to break rump, number of failed tests on arch
amd64 goes from 19 to 1342, same problem on i386.

--
J. Hannken-Illjes - hann...@eis.cs.tu-bs.de - TU Braunschweig (Germany)



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

2016-03-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar  8 03:58:08 UTC 2016

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

Log Message:
Fix copy relocations against protected symbols from:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gcc.old/dist/gcc/output.h \
src/external/gpl3/gcc.old/dist/gcc/varasm.c
cvs rdiff -u -r1.3 -r1.4 \
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/output.h
diff -u src/external/gpl3/gcc.old/dist/gcc/output.h:1.3 src/external/gpl3/gcc.old/dist/gcc/output.h:1.4
--- src/external/gpl3/gcc.old/dist/gcc/output.h:1.3	Tue Sep 22 23:39:11 2015
+++ src/external/gpl3/gcc.old/dist/gcc/output.h	Mon Mar  7 22:58:08 2016
@@ -583,6 +583,7 @@ extern void default_asm_output_anchor (r
 extern bool default_use_anchors_for_symbol_p (const_rtx);
 extern bool default_binds_local_p (const_tree);
 extern bool default_binds_local_p_1 (const_tree, int);
+extern bool default_binds_local_p_2 (const_tree);
 extern void default_globalize_label (FILE *, const char *);
 extern void default_globalize_decl_name (FILE *, tree);
 extern void default_emit_unwind_label (FILE *, tree, int, int);
Index: src/external/gpl3/gcc.old/dist/gcc/varasm.c
diff -u src/external/gpl3/gcc.old/dist/gcc/varasm.c:1.3 src/external/gpl3/gcc.old/dist/gcc/varasm.c:1.4
--- src/external/gpl3/gcc.old/dist/gcc/varasm.c:1.3	Tue Sep 22 23:39:12 2015
+++ src/external/gpl3/gcc.old/dist/gcc/varasm.c	Mon Mar  7 22:58:08 2016
@@ -6620,95 +6620,106 @@ resolution_local_p (enum ld_plugin_symbo
 
 /* Assume ELF-ish defaults, since that's pretty much the most liberal
wrt cross-module name binding.  */
-
-bool
-default_binds_local_p (const_tree exp)
+static bool
+default_binds_local_p_3 (const_tree exp, bool shlib, bool weak_dominate,
+			 bool extern_protected_data)
 {
-  return default_binds_local_p_1 (exp, flag_shlib);
-}
+  /* A non-decl is an entry in the constant pool.  */
+  if (!DECL_P (exp))
+return true;
 
-bool
-default_binds_local_p_1 (const_tree exp, int shlib)
-{
-  bool local_p;
-  bool resolved_locally = false;
-  bool resolved_to_local_def = false;
+  /* Weakrefs may not bind locally, even though the weakref itself is always
+ static and therefore local.  Similarly, the resolver for ifunc functions
+ might resolve to a non-local function.
+ FIXME: We can resolve the weakref case more curefuly by looking at the
+ weakref alias.  */
+  if (lookup_attribute ("weakref", DECL_ATTRIBUTES (exp))
+	   || (TREE_CODE (exp) == FUNCTION_DECL
+	   && lookup_attribute ("ifunc", DECL_ATTRIBUTES (exp
+return false;
+
+  /* Static variables are always local.  */
+  if (! TREE_PUBLIC (exp))
+return true;
 
-  /* With resolution file in hands, take look into resolutions.
+  /* With resolution file in hand, take look into resolutions.
  We can't just return true for resolved_locally symbols,
  because dynamic linking might overwrite symbols
  in shared libraries.  */
+  bool resolved_locally = false;
+  bool defined_locally = !DECL_EXTERNAL (exp);
   if (TREE_CODE (exp) == VAR_DECL && TREE_PUBLIC (exp)
   && (TREE_STATIC (exp) || DECL_EXTERNAL (exp)))
 {
   struct varpool_node *vnode = varpool_get_node (exp);
-  if (vnode && resolution_local_p (vnode->symbol.resolution))
+  if (vnode && vnode->symbol.in_other_partition)
+	defined_locally = true;
+  if (vnode && resolution_to_local_definition_p (vnode->symbol.resolution))
+	defined_locally = resolved_locally = true;
+  else if (vnode && resolution_local_p (vnode->symbol.resolution))
 	resolved_locally = true;
-  if (vnode
-	  && resolution_to_local_definition_p (vnode->symbol.resolution))
-	resolved_to_local_def = true;
-}
-  else if (TREE_CODE (exp) == FUNCTION_DECL && TREE_PUBLIC (exp))
-{
-  struct cgraph_node *node = cgraph_get_node (exp);
-  if (node
-	  && resolution_local_p (node->symbol.resolution))
-	resolved_locally = true;
-  if (node
-	  && resolution_to_local_definition_p (node->symbol.resolution))
-	resolved_to_local_def = true;
 }
+  if (defined_locally && weak_dominate && !shlib)
+resolved_locally = true;
+
+  /* Undefined weak symbols are never defined locally.  */
+  if (DECL_WEAK (exp) && !defined_locally)
+return false;
+
+  /* A symbol is local if the user has said explicitly that it will be,
+ or if we have a definition for the symbol.  We cannot infer visibility
+ for undefined symbols.  */
+  if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT
+  && (TREE_CODE (exp) == FUNCTION_DECL
+	  || !extern_protected_data
+	  || DECL_VISIBILITY (exp) != VISIBILITY_PROTECTED)
+  && 

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

2016-03-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar  8 03:58:08 UTC 2016

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

Log Message:
Fix copy relocations against protected symbols from:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248


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

2016-01-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 20 15:12:29 UTC 2016

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

Log Message:
remove __RCSID, sync with libc


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

2016-01-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 20 17:09:04 UTC 2016

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

Log Message:
make regasub a "C" decl.


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

2016-01-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 20 15:12:29 UTC 2016

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

Log Message:
remove __RCSID, sync with libc


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gcc.old/dist/gcc/final.c
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gcc.old/dist/gcc/regsub.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/final.c
diff -u src/external/gpl3/gcc.old/dist/gcc/final.c:1.5 src/external/gpl3/gcc.old/dist/gcc/final.c:1.6
--- src/external/gpl3/gcc.old/dist/gcc/final.c:1.5	Fri Jan  8 21:00:14 2016
+++ src/external/gpl3/gcc.old/dist/gcc/final.c	Wed Jan 20 10:12:29 2016
@@ -1608,7 +1608,7 @@ add_debug_regex_map (const char *arg)
   debug_regex_maps = map;
 }
 
-extern ssize_t aregsub(char **, const char *,
+extern ssize_t regasub(char **, const char *,
   const regmatch_t *rm, const char *);
 
 /* Perform user-specified mapping of debug filename regular expressions.  Return
@@ -1623,7 +1623,7 @@ remap_debug_regex_filename (const char *
 
   for (map = debug_regex_maps; map; map = map->next)
 if (regexec (>re, filename, 10, rm, 0) == 0
-   && aregsub (, map->sub, rm, filename) >= 0)
+   && regasub (, map->sub, rm, filename) >= 0)
   {
 	 const char *name = ggc_strdup(s);
 	 free(s);

Index: src/external/gpl3/gcc.old/dist/gcc/regsub.c
diff -u src/external/gpl3/gcc.old/dist/gcc/regsub.c:1.2 src/external/gpl3/gcc.old/dist/gcc/regsub.c:1.3
--- src/external/gpl3/gcc.old/dist/gcc/regsub.c:1.2	Sat Jan 16 14:29:22 2016
+++ src/external/gpl3/gcc.old/dist/gcc/regsub.c	Wed Jan 20 10:12:29 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: regsub.c,v 1.2 2016/01/16 19:29:22 christos Exp $	*/
+/*	$NetBSD: regsub.c,v 1.3 2016/01/20 15:12:29 christos Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -29,12 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-#ifdef __RCSID
-__RCSID("$NetBSD: regsub.c,v 1.2 2016/01/16 19:29:22 christos Exp $");
-#endif
-
 #include 
-
 #include 
 #include 
 #include 
@@ -47,6 +42,8 @@ struct str {
 	int s_fixed;
 };
 
+#define	REINCR	64
+
 static int
 addspace(struct str *s, size_t len)
 {
@@ -58,7 +55,7 @@ addspace(struct str *s, size_t len)
 	if (s->s_fixed)
 		return -1;
 
-	s->s_max += MAX(len, 64);
+	s->s_max += len + REINCR;
 
 	v = realloc(s->s_ptr, s->s_max);
 	if (v == NULL)
@@ -93,7 +90,7 @@ static int
 initstr(struct str *s, char *buf, size_t len)
 {
 	s->s_max = len;
-	s->s_ptr = buf == NULL ? (char *)malloc(len) : buf;
+	s->s_ptr = (char *)(buf == NULL ? malloc(len) : buf);
 	s->s_fixed = buf != NULL;
 	s->s_len = 0;
 	return s->s_ptr == NULL ? -1 : 0;
@@ -103,7 +100,7 @@ static ssize_t
 regsub1(char **buf, size_t len, const char *sub,
 const regmatch_t *rm, const char *str)
 {
-ssize_t i; 
+ssize_t i;
 char c; 
 	struct str s;
 
@@ -149,15 +146,15 @@ regsub1(char **buf, size_t len, const ch
 }
 
 ssize_t
-regsub(char *buf, size_t len, const char *sub, const regmatch_t *rm,
+regnsub(char *buf, size_t len, const char *sub, const regmatch_t *rm,
 const char *str)
 {
 	return regsub1(, len, sub, rm, str);
 }
 
 ssize_t
-aregsub(char **buf, const char *sub, const regmatch_t *rm, const char *str)
+regasub(char **buf, const char *sub, const regmatch_t *rm, const char *str)
 {
 	*buf = NULL;
-	return regsub1(buf, 64, sub, rm, str);
+	return regsub1(buf, REINCR, sub, rm, str);
 }



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

2016-01-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 20 17:09:04 UTC 2016

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

Log Message:
make regasub a "C" decl.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc.old/dist/gcc/final.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/final.c
diff -u src/external/gpl3/gcc.old/dist/gcc/final.c:1.6 src/external/gpl3/gcc.old/dist/gcc/final.c:1.7
--- src/external/gpl3/gcc.old/dist/gcc/final.c:1.6	Wed Jan 20 10:12:29 2016
+++ src/external/gpl3/gcc.old/dist/gcc/final.c	Wed Jan 20 12:09:04 2016
@@ -1608,7 +1608,7 @@ add_debug_regex_map (const char *arg)
   debug_regex_maps = map;
 }
 
-extern ssize_t regasub(char **, const char *,
+extern "C" ssize_t regasub(char **, const char *,
   const regmatch_t *rm, const char *);
 
 /* Perform user-specified mapping of debug filename regular expressions.  Return



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

2016-01-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 16 19:29:22 UTC 2016

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

Log Message:
ifdef __RCSID


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

2016-01-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 16 19:29:22 UTC 2016

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

Log Message:
ifdef __RCSID


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gcc.old/dist/gcc/regsub.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/regsub.c
diff -u src/external/gpl3/gcc.old/dist/gcc/regsub.c:1.1 src/external/gpl3/gcc.old/dist/gcc/regsub.c:1.2
--- src/external/gpl3/gcc.old/dist/gcc/regsub.c:1.1	Fri Jan  8 21:00:14 2016
+++ src/external/gpl3/gcc.old/dist/gcc/regsub.c	Sat Jan 16 14:29:22 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: regsub.c,v 1.1 2016/01/09 02:00:14 christos Exp $	*/
+/*	$NetBSD: regsub.c,v 1.2 2016/01/16 19:29:22 christos Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -29,7 +29,9 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: regsub.c,v 1.1 2016/01/09 02:00:14 christos Exp $");
+#ifdef __RCSID
+__RCSID("$NetBSD: regsub.c,v 1.2 2016/01/16 19:29:22 christos Exp $");
+#endif
 
 #include 
 



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

2015-12-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 22 16:48:44 UTC 2015

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

Log Message:
For reproducible builds, allow the source of the map to be set from the
environment, so that DW_at_producer is the same no matter what the actual
underlying source and destination directories are. See:
https://gcc.gnu.org/ml/gcc-patches/2015-12/msg01168.html


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gcc.old/dist/gcc/final.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/final.c
diff -u src/external/gpl3/gcc.old/dist/gcc/final.c:1.3 src/external/gpl3/gcc.old/dist/gcc/final.c:1.4
--- src/external/gpl3/gcc.old/dist/gcc/final.c:1.3	Tue Sep 22 23:39:10 2015
+++ src/external/gpl3/gcc.old/dist/gcc/final.c	Tue Dec 22 11:48:44 2015
@@ -1492,6 +1492,9 @@ add_debug_prefix_map (const char *arg)
 {
   debug_prefix_map *map;
   const char *p;
+  char *env;
+  const char *old;
+  size_t oldlen;
 
   p = strchr (arg, '=');
   if (!p)
@@ -1499,9 +1502,29 @@ add_debug_prefix_map (const char *arg)
   error ("invalid argument %qs to -fdebug-prefix-map", arg);
   return;
 }
+  if (*arg == '$')
+{
+  env = xstrndup (arg+1, p - (arg+1));
+  old = getenv(env);
+  if (!old)
+	{
+	  warning (0, "environment variable %qs not set in argument to "
+		   "-fdebug-prefix-map", env);
+	  free(env);
+	  return;
+	}
+  oldlen = strlen(old);
+  free(env);
+}
+  else
+{
+  old = xstrndup (arg, p - arg);
+  oldlen = p - arg;
+}
+
   map = XNEW (debug_prefix_map);
-  map->old_prefix = xstrndup (arg, p - arg);
-  map->old_len = p - arg;
+  map->old_prefix = old;
+  map->old_len = oldlen;
   p++;
   map->new_prefix = xstrdup (p);
   map->new_len = strlen (p);



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

2015-12-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 22 16:48:44 UTC 2015

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

Log Message:
For reproducible builds, allow the source of the map to be set from the
environment, so that DW_at_producer is the same no matter what the actual
underlying source and destination directories are. See:
https://gcc.gnu.org/ml/gcc-patches/2015-12/msg01168.html


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

2015-11-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov 22 20:47:42 UTC 2015

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

Log Message:
Fix logic bug where __cpuid gets called when __get_cpuid_max() returns 0.
This happens when __level == 0, from libgcc/config/i386/cpuinfo.c#285.
This breaks early i486 CPUs which don't have cpuid


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

2015-11-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov 22 20:47:42 UTC 2015

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

Log Message:
Fix logic bug where __cpuid gets called when __get_cpuid_max() returns 0.
This happens when __level == 0, from libgcc/config/i386/cpuinfo.c#285.
This breaks early i486 CPUs which don't have cpuid


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/cpuid.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/i386/cpuid.h
diff -u src/external/gpl3/gcc.old/dist/gcc/config/i386/cpuid.h:1.3 src/external/gpl3/gcc.old/dist/gcc/config/i386/cpuid.h:1.4
--- src/external/gpl3/gcc.old/dist/gcc/config/i386/cpuid.h:1.3	Tue Sep 22 23:39:14 2015
+++ src/external/gpl3/gcc.old/dist/gcc/config/i386/cpuid.h	Sun Nov 22 15:47:42 2015
@@ -259,8 +259,9 @@ __get_cpuid (unsigned int __level,
 	 unsigned int *__ecx, unsigned int *__edx)
 {
   unsigned int __ext = __level & 0x8000;
+  unsigned int __maxlevel = __get_cpuid_max (__ext, 0);
 
-  if (__get_cpuid_max (__ext, 0) < __level)
+  if (__maxlevel == 0 || __maxlevel < __level)
 return 0;
 
   __cpuid (__level, *__eax, *__ebx, *__ecx, *__edx);



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

2015-11-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov  8 17:13:01 UTC 2015

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

Log Message:
We've never supported executable stack notes in any archs so don't add one.


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

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



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

2015-11-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov  8 17:13:01 UTC 2015

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

Log Message:
We've never supported executable stack notes in any archs so don't add one.


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

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

Modified files:

Index: src/external/gpl3/gcc.old/dist/gcc/config/rs6000/rs6000.c
diff -u src/external/gpl3/gcc.old/dist/gcc/config/rs6000/rs6000.c:1.3 src/external/gpl3/gcc.old/dist/gcc/config/rs6000/rs6000.c:1.4
--- src/external/gpl3/gcc.old/dist/gcc/config/rs6000/rs6000.c:1.3	Tue Sep 22 23:39:16 2015
+++ src/external/gpl3/gcc.old/dist/gcc/config/rs6000/rs6000.c	Sun Nov  8 12:13:01 2015
@@ -29474,8 +29474,7 @@ rs6000_elf_file_end (void)
 		 aix_struct_return ? 2 : 1);
 }
 #endif
-#if defined (POWERPC_LINUX) || defined (POWERPC_FREEBSD) \
-|| defined (POWERPC_NETBSD)
+#if defined (POWERPC_LINUX) || defined (POWERPC_FREEBSD)
   if (TARGET_32BIT || DEFAULT_ABI == ABI_ELFv2)
 file_end_indicate_exec_stack ();
 #endif



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

2014-09-15 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Sep 15 16:29:18 UTC 2014

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

Log Message:
Apply r1.2 from our GCC 4.8 version of the same file:

Kill the throw() on a forward declaration for posix_memalign (it does
not match our base declaration and may cause warnings).


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/pmm_malloc.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/i386/pmm_malloc.h
diff -u src/external/gpl3/gcc.old/dist/gcc/config/i386/pmm_malloc.h:1.1.1.1 src/external/gpl3/gcc.old/dist/gcc/config/i386/pmm_malloc.h:1.2
--- src/external/gpl3/gcc.old/dist/gcc/config/i386/pmm_malloc.h:1.1.1.1	Tue Feb 25 18:38:57 2014
+++ src/external/gpl3/gcc.old/dist/gcc/config/i386/pmm_malloc.h	Mon Sep 15 16:29:18 2014
@@ -31,7 +31,7 @@
 #ifndef __cplusplus
 extern int posix_memalign (void **, size_t, size_t);
 #else
-extern C int posix_memalign (void **, size_t, size_t) throw ();
+extern C int posix_memalign (void **, size_t, size_t);
 #endif
 
 static __inline void *



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

2014-09-15 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Sep 15 16:29:18 UTC 2014

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

Log Message:
Apply r1.2 from our GCC 4.8 version of the same file:

Kill the throw() on a forward declaration for posix_memalign (it does
not match our base declaration and may cause warnings).


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

2014-03-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Mar  7 04:14:30 UTC 2014

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

Log Message:
WCHAR_SIZE is always int on NetBSD


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

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

Modified files:

Index: src/external/gpl3/gcc.old/dist/gcc/config/rs6000/netbsd64.h
diff -u src/external/gpl3/gcc.old/dist/gcc/config/rs6000/netbsd64.h:1.1.1.1 src/external/gpl3/gcc.old/dist/gcc/config/rs6000/netbsd64.h:1.2
--- src/external/gpl3/gcc.old/dist/gcc/config/rs6000/netbsd64.h:1.1.1.1	Tue Feb 25 18:39:08 2014
+++ src/external/gpl3/gcc.old/dist/gcc/config/rs6000/netbsd64.h	Fri Mar  7 04:14:30 2014
@@ -371,7 +371,7 @@ extern int dot_symbols;
 #define	PTRDIFF_TYPE (TARGET_64BIT ? long int : int)
 
 #undef	WCHAR_TYPE
-#define	WCHAR_TYPE (TARGET_64BIT ? int : long int)
+#define	WCHAR_TYPE int
 #undef  WCHAR_TYPE_SIZE
 #define WCHAR_TYPE_SIZE 32
 



  1   2   >