+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>
#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"
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,
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 *,
#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
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
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));
switch (icode)
{
case CODE_FOR_fexpand_vis:
- arg0 = args[0];
+ arg0 = TREE_VALUE (arglist);
STRIP_NOPS (arg0);
if (TREE_CODE (arg0) == VECTOR_CST)
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);
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);
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);