[PATCH 1/2, rs6000] Add const_anchor for rs6000 [PR33699]

HAO CHEN GUI guihaoc@linux.ibm.com
Mon Mar 15 03:11:32 GMT 2021


Hi,

     This patch adds const_anchor for rs6000. The const_anchor is used 
in cse pass.

     The attachment are the patch diff and change log file.

     Bootstrapped and tested on powerpc64le with no regressions. Is this 
okay for trunk? Any  recommendations? Thanks a lot.

-------------- next part --------------
	* config/rs6000/rs6000.c (rs6000_option_override_internal): Set
	targetm.const_anchor, targetm.min_anchor_offset
	and targetm.max_anchor_offset.
-------------- next part --------------
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index ec068c58aa5..2b2350c53ae 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -4911,6 +4911,13 @@ rs6000_option_override_internal (bool global_init_p)
     warning (0, "%qs is deprecated and not recommended in any circumstances",
 	     "-mno-speculate-indirect-jumps");
 
+  if (TARGET_64BIT)
+    {
+      targetm.min_anchor_offset = -32768;
+      targetm.max_anchor_offset = 32767;
+      targetm.const_anchor = 0x8000;
+    }
+
   return ret;
 }
 


More information about the Gcc-patches mailing list