pa.h (MAX_PCREL17F_OFFSET): Define.
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Sun, 3 Jun 2012 12:46:44 +0000 (12:46 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Sun, 3 Jun 2012 12:46:44 +0000 (12:46 +0000)
* 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: r188151

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

index 0e102728931a626c3d75bccea000e86de63e602b..09a8923669361ae70e1d997b86f5b0d055223eba 100644 (file)
@@ -1,3 +1,11 @@
+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-03  Oleg Endo  <olegendo@gcc.gnu.org>
 
        PR target/53512
index 25ae5d81f57791eca228ad740187152a940460a5..9dee55b525dfa2fea79f7255a9a0637ec73743a5 100644 (file)
@@ -7457,7 +7457,7 @@ pa_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)
@@ -7670,7 +7670,7 @@ pa_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.  */
@@ -8029,7 +8029,7 @@ pa_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 c52e3d50877a156e31611a0b6a0ee1e2d8bcf8d1..d977c64fdb28d8e907081fdb875982206487e1cd 100644 (file)
@@ -1519,3 +1519,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)