Source-Changes-HG archive

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

[src/trunk]: src/external/gpl3/gcc/dist/gcc/config/vax Add LEGITIMATE_PIC_OPE...



details:   https://anonhg.NetBSD.org/src/rev/880f2d6af6eb
branches:  trunk
changeset: 796174:880f2d6af6eb
user:      matt <matt%NetBSD.org@localhost>
date:      Fri May 23 13:35:26 2014 +0000

description:
Add LEGITIMATE_PIC_OPERAND_P(X) to prevent global symbol + offset from
being a legitimate pic operand (because it's not).

diffstat:

 external/gpl3/gcc/dist/gcc/config/vax/vax-protos.h |   1 +
 external/gpl3/gcc/dist/gcc/config/vax/vax.c        |  18 ++++++++++++++++++
 external/gpl3/gcc/dist/gcc/config/vax/vax.h        |   4 ++++
 3 files changed, 23 insertions(+), 0 deletions(-)

diffs (60 lines):

diff -r 525894f91d3b -r 880f2d6af6eb external/gpl3/gcc/dist/gcc/config/vax/vax-protos.h
--- a/external/gpl3/gcc/dist/gcc/config/vax/vax-protos.h        Fri May 23 13:24:15 2014 +0000
+++ b/external/gpl3/gcc/dist/gcc/config/vax/vax-protos.h        Fri May 23 13:35:26 2014 +0000
@@ -18,6 +18,7 @@
 <http://www.gnu.org/licenses/>.  */
 
 extern bool legitimate_constant_address_p (rtx);
+extern bool legitimate_pic_operand_p (rtx);
 extern void vax_expand_prologue (void);
 
 #ifdef RTX_CODE
diff -r 525894f91d3b -r 880f2d6af6eb external/gpl3/gcc/dist/gcc/config/vax/vax.c
--- a/external/gpl3/gcc/dist/gcc/config/vax/vax.c       Fri May 23 13:24:15 2014 +0000
+++ b/external/gpl3/gcc/dist/gcc/config/vax/vax.c       Fri May 23 13:35:26 2014 +0000
@@ -572,6 +572,11 @@
                       sizeof (dstr), 0, 1);
       fprintf (file, "$0%c%s", ASM_DOUBLE_CHAR, dstr);
     }
+  else if (GET_CODE (x) == SUBREG)
+    {
+      debug_rtx (x);
+      output_operand_lossage ("SUBREG operand");
+    }
   else
     {
       if (flag_pic > 1 && symbolic_operand (x, SImode))
@@ -1777,6 +1782,19 @@
    return true;
 }
 
+bool
+legitimate_pic_operand_p (rtx x)
+{
+#ifdef NO_EXTERNAL_INDIRECT_ADDRESS
+  if (GET_CODE (x) != CONST)
+    return true;
+  if (GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
+      && !SYMBOL_REF_LOCAL_P (XEXP (XEXP (x, 0), 0)))
+    return false;
+#endif
+  return true;
+}
+
 /* The other macros defined here are used only in legitimate_address_p ().  */
 
 /* Nonzero if X is a hard reg that can be used as an index
diff -r 525894f91d3b -r 880f2d6af6eb external/gpl3/gcc/dist/gcc/config/vax/vax.h
--- a/external/gpl3/gcc/dist/gcc/config/vax/vax.h       Fri May 23 13:24:15 2014 +0000
+++ b/external/gpl3/gcc/dist/gcc/config/vax/vax.h       Fri May 23 13:35:26 2014 +0000
@@ -373,6 +373,10 @@
                                        RETURN_ADDRESS_OFFSET))         \
    : (rtx) 0)
 
+/* A C expression that is nonzero if X is a legitimate immediate operand
+   on the target machine when generating position independent code.  */
+
+#define LEGITIMATE_PIC_OPERAND_P(X) legitimate_pic_operand_p (X)
 
 /* Addressing modes, and classification of registers for them.  */
 



Home | Main Index | Thread Index | Old Index