]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
final.c (JUMP_TABLES_IN_TEXT_SECTION): Provide a default value.
authorBernd Schmidt <crux@pool.informatik.rwth-aachen.de>
Fri, 22 May 1998 00:01:23 +0000 (00:01 +0000)
committerJeff Law <law@gcc.gnu.org>
Fri, 22 May 1998 00:01:23 +0000 (18:01 -0600)
        * final.c (JUMP_TABLES_IN_TEXT_SECTION): Provide a default value.
        (shorten_branches, final_scan_insn): Test value of
        JUMP_TABLES_IN_TEXT_SECTION instead of just testing whether it
        is defined.
        * tm.texi (JUMP_TABLES_IN_TEXT_SECTION): Corresponding changes.
        * arm/coff.h: Define JUMP_TABLES_IN_TEXT_SECTION to 1.
        coff.h: Likewise.
        * i386/386bsd.h: Likewise.
        * i386/freebsd-elf.h: Likewise.
        * i386/freebsd.h: Likewise.
        * i386/netbsd.h: Likewise.
        * i386/ptx4-i.h: Likewise.
        * i386/sysv4.h: Likewise.
        * pa/pa.h: Likewise.
        * rs6000/linux.h: Likewise.
        * rs6000/rs6000.h: Likewise.
        * sh/sh.h: Likewise.
        * sparc/sp64-elf.h: Likewise.
        * v850/v850.h: Likewise.
        * rs6000/sysv4.h: Define JUMP_TABLES_IN_TEXT_SECTION to 0.
        * i386/linux.h: Define JUMP_TABLES_IN_TEXT_SECTION to (flag_pic).

From-SVN: r19940

19 files changed:
gcc/ChangeLog
gcc/config/arm/coff.h
gcc/config/arm/tcoff.h
gcc/config/i386/386bsd.h
gcc/config/i386/freebsd-elf.h
gcc/config/i386/freebsd.h
gcc/config/i386/linux.h
gcc/config/i386/netbsd.h
gcc/config/i386/ptx4-i.h
gcc/config/i386/sysv4.h
gcc/config/pa/pa.h
gcc/config/rs6000/linux.h
gcc/config/rs6000/rs6000.h
gcc/config/rs6000/sysv4.h
gcc/config/sh/sh.h
gcc/config/sparc/sp64-elf.h
gcc/config/v850/v850.h
gcc/final.c
gcc/tm.texi

index 8e88702c3676eb0c316d2f7ec03db0db96c1f6de..a4c79291d3db51cc7151395207a8bf97a143502d 100644 (file)
@@ -1,3 +1,27 @@
+Fri May 22 00:57:00 1998  Bernd Schmidt (crux@pool.informatik.rwth-aachen.de>
+
+       * final.c (JUMP_TABLES_IN_TEXT_SECTION): Provide a default value.
+       (shorten_branches, final_scan_insn): Test value of
+       JUMP_TABLES_IN_TEXT_SECTION instead of just testing whether it
+       is defined.
+       * tm.texi (JUMP_TABLES_IN_TEXT_SECTION): Corresponding changes.
+       * arm/coff.h: Define JUMP_TABLES_IN_TEXT_SECTION to 1.
+       coff.h: Likewise.
+       * i386/386bsd.h: Likewise.
+       * i386/freebsd-elf.h: Likewise.
+       * i386/freebsd.h: Likewise.
+       * i386/netbsd.h: Likewise.
+       * i386/ptx4-i.h: Likewise.
+       * i386/sysv4.h: Likewise.
+       * pa/pa.h: Likewise.
+       * rs6000/linux.h: Likewise.
+       * rs6000/rs6000.h: Likewise.
+       * sh/sh.h: Likewise.
+       * sparc/sp64-elf.h: Likewise.
+       * v850/v850.h: Likewise.
+       * rs6000/sysv4.h: Define JUMP_TABLES_IN_TEXT_SECTION to 0.
+       * i386/linux.h: Define JUMP_TABLES_IN_TEXT_SECTION to (flag_pic).
+
 Thu May 21 19:50:13 1998  J"orn Rennecke <amylaar@cygnus.co.uk>
 
        * regmove.c (gen_add3_insn): New function.
index abba7c6b787d520f2691392fcd54411f6dd22e6c..4e568cb7941f698f2f64ce0dfc84a3f4dac75561 100644 (file)
@@ -30,7 +30,7 @@ Boston, MA 02111-1307, USA.  */
    point the default.  NOT --nfp!  --with{enable?} is supposed to replace it
    (right?), so let's stop using it.  */
 #undef TARGET_DEFAULT
-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT /*+ TARGET_CPU_DEFAULT*/)
+#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32)
 
 /* ??? Is a big-endian default intended to be supported?  */
 #if 0 /*TARGET_CPU_DEFAULT & ARM_FLAG_BIG_END*/
@@ -104,7 +104,7 @@ do {                                                                \
 /* Define this macro if jump tables (for `tablejump' insns) should be
    output in the text section, along with the assembler instructions.
    Otherwise, the readonly data section is used.  */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
 
 #undef READONLY_DATA_SECTION
 #define READONLY_DATA_SECTION  rdata_section
index 5fabe5dd555e35b0569b480f4dc6a63818e4a356..fe047e7cd27956892ef66cfd3fd379b6f6697e59 100644 (file)
@@ -87,7 +87,7 @@ do {                                                          \
 /* Define this macro if jump tables (for `tablejump' insns) should be
    output in the text section, along with the assembler instructions.
    Otherwise, the readonly data section is used.  */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
 
 #undef READONLY_DATA_SECTION
 #define READONLY_DATA_SECTION  rdata_section
index 25994376aea2c1043c4dcf622f0c7cea23ca6cb1..7962321325c93ae52ac47c8eed822bd89a4217ff 100644 (file)
@@ -69,7 +69,7 @@
 /* Indicate that jump tables go in the text section.  This is
    necessary when compiling PIC code.  */
 
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
 
 /* Don't default to pcc-struct-return, because gcc is the only compiler, and
    we want to retain compatibility with older gcc versions.  */
index 196a76a18f921b4fae90d4f0fd01bbaa191cf955..6f99a886e8789b19190fba478a497900ef2451a7 100644 (file)
@@ -38,7 +38,7 @@ Boston, MA 02111-1307, USA.  */
 
 /* Indicate that jump tables go in the text section.  This is
    necessary when compiling PIC code.  */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
 
 /* Copy this from the svr4 specifications... */
 /* Define the register numbers to be used in Dwarf debugging information.
index d5deacdc3487bf8adcfff40ac9e068a5d42661bc..40f703ec6c65941372b798d08e205474b2a3196c 100644 (file)
@@ -84,7 +84,7 @@ Boston, MA 02111-1307, USA.  */
 /* Indicate that jump tables go in the text section.  This is
    necessary when compiling PIC code.  */
 
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
 
 /* Don't default to pcc-struct-return, because gcc is the only compiler, and
    we want to retain compatibility with older gcc versions.  */
index e178015645425693b5f9b9cc9805d89067d8da61..50341bd4ef1389bec37a0c79cae8bd50be4b7965 100644 (file)
@@ -49,7 +49,7 @@ Boston, MA 02111-1307, USA.  */
 
 /* Indicate that jump tables go in the text section.  This is
    necessary when compiling PIC code.  */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
 
 /* Copy this from the svr4 specifications... */
 /* Define the register numbers to be used in Dwarf debugging information.
index c7aeddf66054bfaf1dccdfc70dcf1551039260da..5978aec5c4b0cdd8147dccdf6e8c605e1ca4e180 100644 (file)
@@ -50,7 +50,7 @@
 /* Indicate that jump tables go in the text section.  This is
    necessary when compiling PIC code.  */
 
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
 
 /* Don't default to pcc-struct-return, because gcc is the only compiler, and
    we want to retain compatibility with older gcc versions.  */
index 36836f6ed309b675c37ef1307d29f36517feef9a..1537b4a4ceee589894da297e55dc2d7f2a37d2c1 100644 (file)
@@ -244,4 +244,4 @@ do { long value[3];                                                 \
 /* Indicate that jump tables go in the text section.  This is
    necessary when compiling PIC code.  */
 
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
index 3a72cdd7dcf8eb2778392f1456c359bb61e1224a..0127d69cbb62f04a0dcab904d0cd539d74aad474 100644 (file)
@@ -242,7 +242,7 @@ do { long value[3];                                                 \
 /* Indicate that jump tables go in the text section.  This is
    necessary when compiling PIC code.  */
 
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
 
 /* A C statement (sans semicolon) to output to the stdio stream
    FILE the assembler definition of uninitialized global DECL named
index 6f9c9be86b16fd7dff7285e75feffcfe93f2b903..5e506a4f410ed54689f73a686f6883dbaccc9916 100644 (file)
@@ -2321,7 +2321,7 @@ DTORS_SECTION_FUNCTION
     fprintf (FILE, "\tb L$%04d\n\tnop\n", VALUE)
 
 /* Jump tables are executable code and live in the TEXT section on the PA.  */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
 
 /* This is how to output an element of a case-vector that is relative.
    This must be defined correctly as it is used when generating PIC code.
index 21d9bc8dbfbb15237e34258323a1208cfacb4038..1843fb82faf3187350e0638f0032c7067f025229 100644 (file)
@@ -69,4 +69,4 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #endif
 
 #undef JUMP_TABLES_IN_TEXT_SECTION
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
index 7ac3cf60c9c6e3e7ad27ebd388472ade823405f7..66756a0b975821b27f5b51185446bc9ba59123b8 100644 (file)
@@ -2375,7 +2375,7 @@ extern int rs6000_trunc_used;
 
 /* Indicate that jump tables go in the text section.  */
 
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
 
 /* Define the routines to implement these extra sections.  */
 
index 9cbb597b8b559ef988f023fc53a3f4d6ab72a784..1a7439a3383c681eaf59e2dda368f9420a6b7e96 100644 (file)
@@ -331,6 +331,7 @@ do {                                                                        \
 
 /* Put jump tables in read-only memory, rather than in .text.  */
 #undef JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 0
 
 /* Disable AIX-ism that disables turning -B into -L if the argument specifies a
    relative file name.  This breaks setting GCC_EXEC_PREFIX to D:\path under
index dce9acb1acdbe24eb600abd762a7eb382ce71638..5c347fcdff5f147bf0e7be553c42953dc5d97252 100644 (file)
@@ -1518,7 +1518,7 @@ dtors_section()                                                   \
 
 /* Define this so that jump tables go in same section as the current function,
    which could be text or it could be a user defined section.  */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
 
 /* A C statement to output something to the assembler file to switch to section
    NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or
index a6f3e72c1dfc7c22897ecb0b1e2eeaad95e0745f..24828664496c8d5c98a7a01be772f90aa71ca015 100644 (file)
@@ -104,7 +104,7 @@ crtbegin.o%s \
    tables from other label refs (when we need to).  */
 /* ??? Revisit this.  */
 #undef JUMP_TABLES_IN_TEXT_SECTION
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
 
 /* System V Release 4 uses DWARF debugging info.
    GDB doesn't support 64 bit stabs yet and the desired debug format is DWARF
index 0161379f409ab7921924216a3d4c833acdb2b707..2ccbe98925b6d141cced7e741efbc8fb8f0ff5c6 100644 (file)
@@ -1326,7 +1326,7 @@ do { char dstr[30];                                       \
 
 /* The switch instruction requires that the jump table immediately follow
    it. */
-#define JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
 
 /* svr4.h defines this assuming that 4 byte alignment is required.  */
 #undef ASM_OUTPUT_BEFORE_CASE_LABEL
index f6f6670f17456fcf473e47a54715f1789b2167b0..d30e5b24d81357e4f4f4ee857b848baf2ee47631 100644 (file)
@@ -130,6 +130,10 @@ Boston, MA 02111-1307, USA.  */
 #define IS_ASM_LOGICAL_LINE_SEPARATOR(C) ((C) == ';')
 #endif
 
+#ifndef JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 0
+#endif
+
 /* Nonzero means this function is a leaf function, with no function calls. 
    This variable exists to be examined in FUNCTION_PROLOGUE
    and FUNCTION_EPILOGUE.  Always zero, unless set by some action.  */
@@ -1062,23 +1066,27 @@ shorten_branches (first)
              max_skip = LABEL_ALIGN_MAX_SKIP;
            }
          next = NEXT_INSN (insn);
-/* ADDR_VECs only take room if read-only data goes into the text section.  */
-#if !defined(READONLY_DATA_SECTION) || defined(JUMP_TABLES_IN_TEXT_SECTION)
-         if (next && GET_CODE (next) == JUMP_INSN)
-           {
-             rtx nextbody = PATTERN (next);
-             if (GET_CODE (nextbody) == ADDR_VEC
-                 || GET_CODE (nextbody) == ADDR_DIFF_VEC)
-               {
-                 log = ADDR_VEC_ALIGN (next);
-                 if (max_log < log)
-                   {
-                     max_log = log;
-                     max_skip = LABEL_ALIGN_MAX_SKIP;
-                   }
-               }
-           }
+         /* ADDR_VECs only take room if read-only data goes into the text
+            section.  */
+         if (JUMP_TABLES_IN_TEXT_SECTION
+#if !defined(READONLY_DATA_SECTION)
+             || 1
 #endif
+             )
+           if (next && GET_CODE (next) == JUMP_INSN)
+             {
+               rtx nextbody = PATTERN (next);
+               if (GET_CODE (nextbody) == ADDR_VEC
+                   || GET_CODE (nextbody) == ADDR_DIFF_VEC)
+                 {
+                   log = ADDR_VEC_ALIGN (next);
+                   if (max_log < log)
+                     {
+                       max_log = log;
+                       max_skip = LABEL_ALIGN_MAX_SKIP;
+                     }
+                 }
+             }
          LABEL_TO_ALIGNMENT (insn) = max_log;
          LABEL_TO_MAX_SKIP (insn) = max_skip;
          max_log = 0;
@@ -1254,11 +1262,15 @@ shorten_branches (first)
        {
          /* This only takes room if read-only data goes into the text
             section.  */
-#if !defined(READONLY_DATA_SECTION) || defined(JUMP_TABLES_IN_TEXT_SECTION)
-         insn_lengths[uid] = (XVECLEN (body, GET_CODE (body) == ADDR_DIFF_VEC)
-                              * GET_MODE_SIZE (GET_MODE (body)));
+         if (JUMP_TABLES_IN_TEXT_SECTION
+#if !defined(READONLY_DATA_SECTION)
+             || 1
+#endif
+             )
+           insn_lengths[uid] = (XVECLEN (body,
+                                         GET_CODE (body) == ADDR_DIFF_VEC)
+                                * GET_MODE_SIZE (GET_MODE (body)));
          /* Alignment is handled by ADDR_VEC_ALIGN.  */
-#endif
        }
       else if (asm_noperands (body) >= 0)
        insn_lengths[uid] = asm_insn_count (body) * insn_default_length (insn);
@@ -1449,13 +1461,19 @@ shorten_branches (first)
              PUT_MODE (body, CASE_VECTOR_SHORTEN_MODE (min_addr - rel_addr,
                                                        max_addr - rel_addr,
                                                        body));
-#if !defined(READONLY_DATA_SECTION) || defined(JUMP_TABLES_IN_TEXT_SECTION)
-             insn_lengths[uid]
-               = (XVECLEN (body, 1) * GET_MODE_SIZE (GET_MODE (body)));
-             insn_current_address += insn_lengths[uid];
-             if (insn_lengths[uid] != old_length)
-               something_changed = 1;
+             if (JUMP_TABLES_IN_TEXT_SECTION
+#if !defined(READONLY_DATA_SECTION)
+                 || 1
 #endif
+                 )
+               {
+                 insn_lengths[uid]
+                   = (XVECLEN (body, 1) * GET_MODE_SIZE (GET_MODE (body)));
+                 insn_current_address += insn_lengths[uid];
+                 if (insn_lengths[uid] != old_length)
+                   something_changed = 1;
+               }
+
              continue;
            }
 #endif /* CASE_VECTOR_SHORTEN_MODE */
@@ -2307,16 +2325,18 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
          if (GET_CODE (nextbody) == ADDR_VEC
              || GET_CODE (nextbody) == ADDR_DIFF_VEC)
            {
-#ifndef JUMP_TABLES_IN_TEXT_SECTION
-             readonly_data_section ();
+             if (! JUMP_TABLES_IN_TEXT_SECTION)
+               {
+                 readonly_data_section ();
 #ifdef READONLY_DATA_SECTION
-             ASM_OUTPUT_ALIGN (file,
-                               exact_log2 (BIGGEST_ALIGNMENT
-                                           / BITS_PER_UNIT));
+                 ASM_OUTPUT_ALIGN (file,
+                                   exact_log2 (BIGGEST_ALIGNMENT
+                                               / BITS_PER_UNIT));
 #endif /* READONLY_DATA_SECTION */
-#else /* JUMP_TABLES_IN_TEXT_SECTION */
-             function_section (current_function_decl);
-#endif /* JUMP_TABLES_IN_TEXT_SECTION */
+               }
+             else
+               function_section (current_function_decl);
+
 #ifdef ASM_OUTPUT_CASE_LABEL
              ASM_OUTPUT_CASE_LABEL (file, "L", CODE_LABEL_NUMBER (insn),
                                     NEXT_INSN (insn));
index 120b497dbdb3f73c7dcfaa408b9b688d81b77251..0968754821a60b372617564801b9897d438bbd97 100644 (file)
@@ -4826,9 +4826,10 @@ data section.
 
 @findex JUMP_TABLES_IN_TEXT_SECTION
 @item JUMP_TABLES_IN_TEXT_SECTION
-Define this macro if jump tables (for @code{tablejump} insns) should be
-output in the text section, along with the assembler instructions.
-Otherwise, the readonly data section is used.
+Define this macro to be an expression with a non-zero value if jump 
+tables (for @code{tablejump} insns) should be output in the text
+section, along with the assembler instructions.  Otherwise, the
+readonly data section is used.
 
 This macro is irrelevant if there is no separate readonly data section.