Port-vax archive

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

Re: gcc-vax in NetBSD-9.0: help needed to test patches



Hi John,

On 27/7/20 5:35 am, John Klos wrote:
FYI - I haven't had time to do much with this lately because I've been traveling for work, but many things which weren't working are now working :)

The one place that is still not happy with -O2 is in pkgsrc/net/rsync:

gcc -I. -I. -I./zlib -I./popt -O2 -D_FORTIFY_SOURCE=2 -I/usr/include -DHAVE_CONFIG_H -Wall -W -I/usr/include -c checksum.c -o checksum.o
checksum.c: In function 'get_checksum2':
checksum.c:191:1: internal compiler error: in change_address_1, at emit-rtl.c:2150
 }
 ^
no stack trace because unwind library not available
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://www.NetBSD.org/support/send-pr.html> for instructions.
*** Error code 1

Any thoughts about what could be going on here?

It could be the same problem I tripped over, where GCC is trying to optimise a bit field extraction by adjusting the source address.  I don't believe that this optimisation can be done when compiling position-independent code if the source address is given by an external symbol (but happy to take advice from GCC experts!).  The attached patch should help.

cheers

kalvis


diff --git a/external/gpl3/gcc/dist/gcc/config/vax/vax.md b/external/gpl3/gcc/dist/gcc/config/vax/vax.md
index 5b0bcf9843a1..932616d313d5 100644
--- a/external/gpl3/gcc/dist/gcc/config/vax/vax.md
+++ b/external/gpl3/gcc/dist/gcc/config/vax/vax.md
@@ -804,7 +804,7 @@
 				       MEM_ADDR_SPACE (operands[0]))))"
   "*
 {
-  if (REG_P (operands[0]))
+  if (REG_P (operands[0]) || flag_pic)
     {
       if (INTVAL (operands[2]) != 0)
 	return \"insv %3,%2,%1,%0\";
@@ -834,7 +834,7 @@
 				      MEM_ADDR_SPACE (operands[1]))))"
   "*
 {
-  if (REG_P (operands[1]))
+  if (REG_P (operands[1]) || flag_pic)
     {
       if (INTVAL (operands[3]) != 0)
 	return \"extzv %3,%2,%1,%0\";
@@ -863,7 +863,7 @@
 				      MEM_ADDR_SPACE (operands[1]))))"
   "*
 {
-  if (REG_P (operands[1]))
+  if (REG_P (operands[1]) || flag_pic)
     {
       if (INTVAL (operands[3]) != 0)
 	return \"extv %3,%2,%1,%0\";


Home | Main Index | Thread Index | Old Index