]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[RS6000] Built-in __PCREL__ define
authorAlan Modra <amodra@gmail.com>
Wed, 23 Sep 2020 10:45:39 +0000 (20:15 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 24 Sep 2020 14:00:14 +0000 (23:30 +0930)
Useful in assembly to know details of power10 function calls.

PR target/97166
* config/rs6000/rs6000-c.c (rs6000_target_modify_macros):
Conditionally define __PCREL__.

(cherry picked from commit 677b9150f54a0483d3de1182ac40717b7c4431a5)

gcc/config/rs6000/rs6000-c.c

index fcf36fc622e80f240d6d3cd4d1f6d2fcc3c8f252..7e211fdbf3167048d0f8017df501efc7fd9d1213 100644 (file)
@@ -597,6 +597,9 @@ rs6000_target_modify_macros (bool define_p, HOST_WIDE_INT flags,
   /* Tell the user if we support the MMA instructions.  */
   if ((flags & OPTION_MASK_MMA) != 0)
     rs6000_define_or_undefine_macro (define_p, "__MMA__");
+  /* Whether pc-relative code is being generated.  */
+  if ((flags & OPTION_MASK_PCREL) != 0)
+    rs6000_define_or_undefine_macro (define_p, "__PCREL__");
 }
 
 void