]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: pa.h (MAX_PCREL17F_OFFSET): Define.
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Sun, 17 Jun 2012 01:33:06 +0000 (01:33 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Sun, 17 Jun 2012 01:33:06 +0000 (01:33 +0000)
Backport from mainline:
2012-06-03  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

* config/pa/pa.h (MAX_PCREL17F_OFFSET): Define.
* config/pa/pa.c (pa_attr_length_millicode_call): Use
MAX_PCREL17F_OFFSET instead of fixed offset.
(pa_attr_length_call): Likewise.
(pa_attr_length_indirect_call): Likewise.

From-SVN: r188702

gcc/ChangeLog
gcc/config/pa/pa.c
gcc/config/pa/pa.h

index 23660deef80b5d5266234688f87b773dd6b7362c..3ead1f150f89d11650eeda6dbf708747fde3fd20 100644 (file)
@@ -1,3 +1,14 @@
+2012-06-16  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       Backport from mainline:
+       2012-06-03  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       * config/pa/pa.h (MAX_PCREL17F_OFFSET): Define.
+       * config/pa/pa.c (pa_attr_length_millicode_call): Use
+       MAX_PCREL17F_OFFSET instead of fixed offset.
+       (pa_attr_length_call): Likewise.
+       (pa_attr_length_indirect_call): Likewise.
+
 2012-06-12  Christian Bruel  <christian.bruel@st.com>
 
        PR target/53621
index 6f67ca8ea3454680d3e1ce825c00fdc149dad877..83e6e859e780599d3fe1ce5ee258d5daf780b643 100644 (file)
@@ -7544,7 +7544,7 @@ attr_length_millicode_call (rtx insn)
     return 24;
   else
     {
-      if (!TARGET_LONG_CALLS && distance < 240000)
+      if (!TARGET_LONG_CALLS && distance < MAX_PCREL17F_OFFSET)
        return 8;
 
       if (TARGET_LONG_ABS_CALL && !flag_pic)
@@ -7757,7 +7757,7 @@ attr_length_call (rtx insn, int sibcall)
   /* pc-relative branch.  */
   if (!TARGET_LONG_CALLS
       && ((TARGET_PA_20 && !sibcall && distance < 7600000)
-         || distance < 240000))
+         || distance < MAX_PCREL17F_OFFSET))
     length += 8;
 
   /* 64-bit plabel sequence.  */
@@ -8116,7 +8116,7 @@ attr_length_indirect_call (rtx insn)
   if (TARGET_FAST_INDIRECT_CALLS
       || (!TARGET_PORTABLE_RUNTIME
          && ((TARGET_PA_20 && !TARGET_SOM && distance < 7600000)
-             || distance < 240000)))
+             || distance < MAX_PCREL17F_OFFSET)))
     return 8;
 
   if (flag_pic)
index 012186854de53877ab0814ff0a959032d0bedec1..e59cd5d45780286bd78707c266a2af1e36c2f00f 100644 (file)
@@ -1563,3 +1563,12 @@ do {                                                                     \
 #undef TARGET_HAVE_TLS
 #define TARGET_HAVE_TLS true
 #endif
+
+/* The maximum offset in bytes for a PA 1.X pc-relative call to the
+   head of the preceding stub table.  The selected offsets have been
+   chosen so that approximately one call stub is allocated for every
+   86.7 instructions.  A long branch stub is two instructions when
+   not generating PIC code.  For HP-UX and ELF targets, PIC stubs are
+   seven and four instructions, respectively.  */  
+#define MAX_PCREL17F_OFFSET \
+  (flag_pic ? (TARGET_HPUX ? 198164 : 221312) : 240000)