OSDN Git Service

* config/sparc/sparc.c: Include dwarf2out.h.
authordavem <davem@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 19 Mar 2010 05:34:12 +0000 (05:34 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 00:29:45 +0000 (09:29 +0900)
(emit_pic_helper): Delete.
(pic_helper_symbol_name): Delete.
(pic_helper_emitted_p): Delete.
(pic_helper_needed): New.
(USE_HIDDEN_LINKONCE): Define to '1' if HAVE_GAS_HIDDEN else '0'.
(get_pc_thunk_name): New.
(load_pic_register): Remove 'delay_pic_helper' arg.  Use
get_thunk_pc_name and ggc_strdup to generate PIC thunk symbol.
Set pic_helper_needed to true.  Don't call emit_pic_helper.
(sparc_expand_prologue): Update load_pic_register call.
(sparc_output_mi_thunk): Likewise.
(sparc_file_end): Emit a hidden comdat symbol for the PIC
thunk if possible.  Output CFI information as needed.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157557 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/sparc/sparc.c

index 02be2ca..45a4634 100644 (file)
@@ -1,3 +1,21 @@
+2010-03-19  David S. Miller  <davem@davemloft.net>
+
+       With help from Eric Botcazou.
+       * config/sparc/sparc.c: Include dwarf2out.h.
+       (emit_pic_helper): Delete.
+       (pic_helper_symbol_name): Delete.
+       (pic_helper_emitted_p): Delete.
+       (pic_helper_needed): New.
+       (USE_HIDDEN_LINKONCE): Define to '1' if HAVE_GAS_HIDDEN else '0'.
+       (get_pc_thunk_name): New.
+       (load_pic_register): Remove 'delay_pic_helper' arg.  Use
+       get_thunk_pc_name and ggc_strdup to generate PIC thunk symbol.
+       Set pic_helper_needed to true.  Don't call emit_pic_helper.
+       (sparc_expand_prologue): Update load_pic_register call.
+       (sparc_output_mi_thunk): Likewise.
+       (sparc_file_end): Emit a hidden comdat symbol for the PIC
+       thunk if possible.  Output CFI information as needed.
+
 2010-03-11  Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
            Jack Howarth <howarth@bromo.med.uc.edu>
 
index 26c96c4..38711d3 100644 (file)
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "rtl.h"
 #include "regs.h"
 #include "hard-reg-set.h"
+#include "real.h"
 #include "insn-config.h"
 #include "insn-codes.h"
 #include "conditions.h"
@@ -385,7 +386,7 @@ static void sparc_init_libfuncs (void);
 static void sparc_init_builtins (void);
 static void sparc_vis_init_builtins (void);
 static rtx sparc_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
-static tree sparc_fold_builtin (tree, int, tree *, bool);
+static tree sparc_fold_builtin (tree, tree, bool);
 static int sparc_vis_mul8x16 (int, int);
 static tree sparc_handle_vis_mul8x16 (int, tree, tree, tree);
 static void sparc_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
@@ -412,7 +413,6 @@ static bool sparc_tls_referenced_p (rtx);
 static rtx legitimize_tls_address (rtx);
 static rtx legitimize_pic_address (rtx, rtx);
 static rtx sparc_legitimize_address (rtx, rtx, enum machine_mode);
-static bool sparc_mode_dependent_address_p (const_rtx);
 static bool sparc_pass_by_reference (CUMULATIVE_ARGS *,
                                     enum machine_mode, const_tree, bool);
 static int sparc_arg_partial_bytes (CUMULATIVE_ARGS *,
@@ -500,8 +500,6 @@ static bool fpu_option_set = false;
 
 #undef TARGET_LEGITIMIZE_ADDRESS
 #define TARGET_LEGITIMIZE_ADDRESS sparc_legitimize_address
-#undef TARGET_MODE_DEPENDENT_ADDRESS_P
-#define TARGET_MODE_DEPENDENT_ADDRESS_P sparc_mode_dependent_address_p
 
 #undef TARGET_EXPAND_BUILTIN
 #define TARGET_EXPAND_BUILTIN sparc_expand_builtin
@@ -3522,35 +3520,6 @@ sparc_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
   return x;
 }
 
-/* Return true if ADDR (a legitimate address expression)
-   has an effect that depends on the machine mode it is used for.
-
-   In PIC mode,
-
-      (mem:HI [%l7+a])
-
-   is not equivalent to
-
-      (mem:QI [%l7+a]) (mem:QI [%l7+a+1])
-
-   because [%l7+a+1] is interpreted as the address of (a+1).  */
-
-
-static bool
-sparc_mode_dependent_address_p (const_rtx addr)
-{
-  if (flag_pic && GET_CODE (addr) == PLUS)
-    {
-      rtx op0 = XEXP (addr, 0);
-      rtx op1 = XEXP (addr, 1);
-      if (op0 == pic_offset_table_rtx
-         && SYMBOLIC_CONST (op1))
-       return true;
-    }
-
-  return false;
-}
-
 #ifdef HAVE_GAS_HIDDEN
 # define USE_HIDDEN_LINKONCE 1
 #else
@@ -8403,8 +8372,7 @@ sparc_handle_vis_mul8x16 (int fncode, tree inner_type, tree elts0, tree elts1)
    function could not be folded.  */
 
 static tree
-sparc_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED,
-                   tree *args, bool ignore)
+sparc_fold_builtin (tree fndecl, tree arglist, bool ignore)
 {
   tree arg0, arg1, arg2;
   tree rtype = TREE_TYPE (TREE_TYPE (fndecl));
@@ -8418,7 +8386,7 @@ sparc_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED,
   switch (icode)
     {
     case CODE_FOR_fexpand_vis:
-      arg0 = args[0];
+      arg0 = TREE_VALUE (arglist);
       STRIP_NOPS (arg0);
 
       if (TREE_CODE (arg0) == VECTOR_CST)
@@ -8441,8 +8409,8 @@ sparc_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED,
     case CODE_FOR_fmul8x16_vis:
     case CODE_FOR_fmul8x16au_vis:
     case CODE_FOR_fmul8x16al_vis:
-      arg0 = args[0];
-      arg1 = args[1];
+      arg0 = TREE_VALUE (arglist);
+      arg1 = TREE_VALUE (TREE_CHAIN (arglist));
       STRIP_NOPS (arg0);
       STRIP_NOPS (arg1);
 
@@ -8459,8 +8427,8 @@ sparc_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED,
       break;
 
     case CODE_FOR_fpmerge_vis:
-      arg0 = args[0];
-      arg1 = args[1];
+      arg0 = TREE_VALUE (arglist);
+      arg1 = TREE_VALUE (TREE_CHAIN (arglist));
       STRIP_NOPS (arg0);
       STRIP_NOPS (arg1);
 
@@ -8482,9 +8450,9 @@ sparc_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED,
       break;
 
     case CODE_FOR_pdist_vis:
-      arg0 = args[0];
-      arg1 = args[1];
-      arg2 = args[2];
+      arg0 = TREE_VALUE (arglist);
+      arg1 = TREE_VALUE (TREE_CHAIN (arglist));
+      arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist)));
       STRIP_NOPS (arg0);
       STRIP_NOPS (arg1);
       STRIP_NOPS (arg2);