]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
bfin.md (call_symbol, [...]): Allow these patterns if TARGET_LEAF_ID_SHARED_LIBRARY.
authorBernd Schmidt <bernd.schmidt@analog.com>
Mon, 20 Nov 2006 12:35:47 +0000 (12:35 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Mon, 20 Nov 2006 12:35:47 +0000 (12:35 +0000)
* config/bfin/bfin.md (call_symbol, call_value_symbol, sibcall_symbol,
sibcall_value_symbol): Allow these patterns if
TARGET_LEAF_ID_SHARED_LIBRARY.
* config/bfin/bfin.c (bfin_expand_call): Allow them here as well.
(override_options): Turn on id shared library flags if -msep-data,
but disallow the combination of these options on the command line.
* config/bfin/bfin.h (TARGET_LEAF_ID_SHARED_LIBRARY, MASK_SEP_DATA
MASK_LEAF_ID_SHARED_LIBRARY, TARGET_SEP_DATA): New macros.
(DRIVER_SELF_SPECS): -mleaf-id-shared-library implies
-mid-shared-library.
(TARGET_SWITCHES): Add -mleaf-id-shared-library and -msep-data.
* doc/invoke.texi (Blackfin Options): Document new switches.

From-SVN: r119012

gcc/ChangeLog
gcc/config/bfin/bfin.c
gcc/config/bfin/bfin.h
gcc/config/bfin/bfin.md
gcc/config/bfin/bfin.opt
gcc/config/bfin/t-bfin-elf

index bafe4c42b297eddff61a0378481c2a0d01e34c2d..e1822130709511f521efa926287dd0cc09df29c0 100644 (file)
        functions.
        (TARGET_CANNOT_FORCE_CONST_MEM): New macro.
 
+       * config/bfin/bfin.md (call_symbol, call_value_symbol, sibcall_symbol,
+       sibcall_value_symbol): Allow these patterns if
+       TARGET_LEAF_ID_SHARED_LIBRARY.
+       * config/bfin/bfin.c (bfin_expand_call): Allow them here as well.
+       (override_options): Turn on id shared library flags if -msep-data,
+       but disallow the combination of these options on the command line.
+       * config/bfin/bfin.h (TARGET_LEAF_ID_SHARED_LIBRARY, MASK_SEP_DATA
+       MASK_LEAF_ID_SHARED_LIBRARY, TARGET_SEP_DATA): New macros.
+       (DRIVER_SELF_SPECS): -mleaf-id-shared-library implies
+       -mid-shared-library.
+       (TARGET_SWITCHES): Add -mleaf-id-shared-library and -msep-data.
+       * doc/invoke.texi (Blackfin Options): Document new switches.
+
 2006-11-19  Andrew Pinski  <pinskia@gmail.com>
 
        PR rtl-opt/29879
index edc7cc49ee88b0ca175a592758a1d2f288a1958f..6238690d9c2b34f58aea5fed467fa9f4c7b4ae16 100644 (file)
@@ -948,6 +948,7 @@ bfin_expand_prologue (void)
   do_link (spreg, frame_size, false);
 
   if (TARGET_ID_SHARED_LIBRARY
+      && !TARGET_SEP_DATA
       && (current_function_uses_pic_offset_table
          || !current_function_is_leaf))
     bfin_load_pic_reg (pic_offset_table_rtx);
@@ -1780,7 +1781,7 @@ bfin_expand_call (rtx retval, rtx fnaddr, rtx callarg1, rtx cookie, int sibcall)
   else if ((!register_no_elim_operand (callee, Pmode)
            && GET_CODE (callee) != SYMBOL_REF)
           || (GET_CODE (callee) == SYMBOL_REF
-              && (flag_pic
+              && ((TARGET_ID_SHARED_LIBRARY && !TARGET_LEAF_ID_SHARED_LIBRARY)
                   || bfin_longcall_p (callee, INTVAL (cookie)))))
     {
       callee = copy_to_mode_reg (Pmode, callee);
@@ -2007,6 +2008,14 @@ override_options (void)
   if (TARGET_ID_SHARED_LIBRARY && TARGET_FDPIC)
       error ("ID shared libraries and FD-PIC mode can't be used together.");
 
+  /* Don't allow the user to specify -mid-shared-library and -msep-data
+     together, as it makes little sense from a user's point of view...  */
+  if (TARGET_SEP_DATA && TARGET_ID_SHARED_LIBRARY)
+    error ("cannot specify both -msep-data and -mid-shared-library");
+  /* ... internally, however, it's nearly the same.  */
+  if (TARGET_SEP_DATA)
+    target_flags |= MASK_ID_SHARED_LIBRARY | MASK_LEAF_ID_SHARED_LIBRARY;
+
   /* There is no single unaligned SI op for PIC code.  Sometimes we
      need to use ".4byte" and sometimes we need to use ".picptr".
      See bfin_assemble_integer for details.  */
index 00b6c29f40f372c5f210bdab26ce24cf9bac3ed1..69e60bbfd7168081fe09ec8c02dd169c5b654541 100644 (file)
@@ -51,6 +51,7 @@ extern int target_flags;
 #endif
 
 #define DRIVER_SELF_SPECS SUBTARGET_DRIVER_SELF_SPECS  "\
+ %{mleaf-id-shared-library:%{!mid-shared-library:-mid-shared-library}} \
  %{mfdpic:%{!fpic:%{!fpie:%{!fPIC:%{!fPIE:\
            %{!fno-pic:%{!fno-pie:%{!fno-PIC:%{!fno-PIE:-fpie}}}}}}}}} \
 "
index afd24e62da7b9199f3d58b2cd13c0b083cc5d649..e509d0353ad829dc57a86b7408773f737315255e 100644 (file)
         (match_operand 1 "general_operand" "g"))
    (use (match_operand 2 "" ""))]
   "! SIBLING_CALL_P (insn)
-   && !TARGET_ID_SHARED_LIBRARY
+   && (!TARGET_ID_SHARED_LIBRARY || TARGET_LEAF_ID_SHARED_LIBRARY)
    && GET_CODE (operands[0]) == SYMBOL_REF
    && !bfin_longcall_p (operands[0], INTVAL (operands[2]))"
   "call %0;"
    (use (match_operand 2 "" ""))
    (return)]
   "SIBLING_CALL_P (insn)
-   && !TARGET_ID_SHARED_LIBRARY
+   && (!TARGET_ID_SHARED_LIBRARY || TARGET_LEAF_ID_SHARED_LIBRARY)
    && GET_CODE (operands[0]) == SYMBOL_REF
    && !bfin_longcall_p (operands[0], INTVAL (operands[2]))"
   "jump.l %0;"
              (match_operand 2 "general_operand" "g")))
    (use (match_operand 3 "" ""))]
   "! SIBLING_CALL_P (insn)
-   && !TARGET_ID_SHARED_LIBRARY
+   && (!TARGET_ID_SHARED_LIBRARY || TARGET_LEAF_ID_SHARED_LIBRARY)
    && GET_CODE (operands[1]) == SYMBOL_REF
    && !bfin_longcall_p (operands[1], INTVAL (operands[3]))"
   "call %1;"
    (use (match_operand 3 "" ""))
    (return)]
   "SIBLING_CALL_P (insn)
-   && !TARGET_ID_SHARED_LIBRARY
+   && (!TARGET_ID_SHARED_LIBRARY || TARGET_LEAF_ID_SHARED_LIBRARY)
    && GET_CODE (operands[1]) == SYMBOL_REF
    && !bfin_longcall_p (operands[1], INTVAL (operands[3]))"
   "jump.l %1;"
index 5fe54c9cfb736838f1772d78b67492b3960d85ba..5b53fecac6bd91a0e6a2ea26500eff7ca7b2ec17 100644 (file)
@@ -40,10 +40,19 @@ mid-shared-library
 Target Report Mask(ID_SHARED_LIBRARY)
 Enabled ID based shared library
 
+mleaf-id-shared-library
+Target Report Mask(LEAF_ID_SHARED_LIBRARY)
+Generate code that won't be linked against any other ID shared libraries,
+but may be used as a shared library.
+
 mshared-library-id=
 Target RejectNegative Joined UInteger Var(bfin_library_id)
 ID of shared library to build
 
+msep-data
+Target Report Mask(SEP_DATA)
+Enable separate data segment
+
 mlong-calls
 Target Report Mask(LONG_CALLS)
 Avoid generating pc-relative calls; use indirection
index 8b30cf624975ecb053ad5aadecd46ec34ecb7e01..5f40318518f2720150176f39ba4d4192e753a36e 100644 (file)
@@ -22,10 +22,12 @@ GCC_CFLAGS += -N
 CRTSTUFF_T_CFLAGS = -fpic
 TARGET_LIBGCC2_CFLAGS = -fpic
 
-MULTILIB_OPTIONS=mid-shared-library mfdpic
+MULTILIB_OPTIONS=mid-shared-library mleaf-id-shared-library
+MULTILIB_OPTIONS+=msep-data mfdpic
 MULTILIB_DEFAULTS=
 MULTILIB_DIRNAMES=
-MULTILIB_EXCEPTIONS=mid-shared-library/mfdpic
+MULTILIB_EXCEPTIONS=mid-shared-library*/mfdpic mleaf-id-shared-library*
+MULTILIB_EXCEPTIONS+=*msep-data*
 
 # Assemble startup files.
 $(T)crti.o: $(srcdir)/config/bfin/crti.s $(GCC_PASSES)