Commit 74b66b3c by Richard Henderson Committed by Richard Henderson

avr.c (avr_encode_section_info): Remove.

        * config/avr/avr.c (avr_encode_section_info): Remove.
        (avr_insert_attributes): New.
        (print_operand_address): Use SYMBOL_REF_FUNCTION_P.
        (avr_assemble_integer): Likewise.

From-SVN: r65718
parent 9e57d5ca
2003-04-16 Richard Henderson <rth@redhat.com> 2003-04-16 Richard Henderson <rth@redhat.com>
* config/avr/avr.c (avr_encode_section_info): Remove.
(avr_insert_attributes): New.
(print_operand_address): Use SYMBOL_REF_FUNCTION_P.
(avr_assemble_integer): Likewise.
2003-04-16 Richard Henderson <rth@redhat.com>
* arc.c (arc_encode_section_info): Remove. * arc.c (arc_encode_section_info): Remove.
(arc_assemble_integer): Use SYMBOL_REF_FUNCTION_P. (arc_assemble_integer): Use SYMBOL_REF_FUNCTION_P.
(arc_print_operand, arc_print_operand_address): Likewise. (arc_print_operand, arc_print_operand_address): Likewise.
......
...@@ -66,7 +66,7 @@ static bool avr_assemble_integer PARAMS ((rtx, unsigned int, int)); ...@@ -66,7 +66,7 @@ static bool avr_assemble_integer PARAMS ((rtx, unsigned int, int));
static void avr_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT)); static void avr_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void avr_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT)); static void avr_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
static void avr_unique_section PARAMS ((tree, int)); static void avr_unique_section PARAMS ((tree, int));
static void avr_encode_section_info PARAMS ((tree, int)); static void avr_insert_attributes PARAMS ((tree, tree *));
static unsigned int avr_section_type_flags PARAMS ((tree, const char *, int)); static unsigned int avr_section_type_flags PARAMS ((tree, const char *, int));
static void avr_asm_out_ctor PARAMS ((rtx, int)); static void avr_asm_out_ctor PARAMS ((rtx, int));
...@@ -226,8 +226,8 @@ int avr_case_values_threshold = 30000; ...@@ -226,8 +226,8 @@ int avr_case_values_threshold = 30000;
#define TARGET_ATTRIBUTE_TABLE avr_attribute_table #define TARGET_ATTRIBUTE_TABLE avr_attribute_table
#undef TARGET_ASM_UNIQUE_SECTION #undef TARGET_ASM_UNIQUE_SECTION
#define TARGET_ASM_UNIQUE_SECTION avr_unique_section #define TARGET_ASM_UNIQUE_SECTION avr_unique_section
#undef TARGET_ENCODE_SECTION_INFO #undef TARGET_INSERT_ATTRIBUTES
#define TARGET_ENCODE_SECTION_INFO avr_encode_section_info #define TARGET_INSERT_ATTRIBUTES avr_insert_attributes
#undef TARGET_SECTION_TYPE_FLAGS #undef TARGET_SECTION_TYPE_FLAGS
#define TARGET_SECTION_TYPE_FLAGS avr_section_type_flags #define TARGET_SECTION_TYPE_FLAGS avr_section_type_flags
#undef TARGET_RTX_COSTS #undef TARGET_RTX_COSTS
...@@ -1088,7 +1088,7 @@ print_operand_address (file, addr) ...@@ -1088,7 +1088,7 @@ print_operand_address (file, addr)
default: default:
if (CONSTANT_ADDRESS_P (addr) if (CONSTANT_ADDRESS_P (addr)
&& ((GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_FLAG (addr)) && ((GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (addr))
|| GET_CODE (addr) == LABEL_REF)) || GET_CODE (addr) == LABEL_REF))
{ {
fprintf (file, "pm("); fprintf (file, "pm(");
...@@ -4569,7 +4569,7 @@ avr_assemble_integer (x, size, aligned_p) ...@@ -4569,7 +4569,7 @@ avr_assemble_integer (x, size, aligned_p)
int aligned_p; int aligned_p;
{ {
if (size == POINTER_SIZE / BITS_PER_UNIT && aligned_p if (size == POINTER_SIZE / BITS_PER_UNIT && aligned_p
&& ((GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_FLAG (x)) && ((GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (x))
|| GET_CODE (x) == LABEL_REF)) || GET_CODE (x) == LABEL_REF))
{ {
fputs ("\t.word\tpm(", asm_out_file); fputs ("\t.word\tpm(", asm_out_file);
...@@ -4838,23 +4838,25 @@ avr_progmem_p (decl) ...@@ -4838,23 +4838,25 @@ avr_progmem_p (decl)
return 0; return 0;
} }
/* Encode section information about tree DECL. */ /* Add the section attribute if the variable is in progmem. */
static void static void
avr_encode_section_info (decl, first) avr_insert_attributes (node, attributes)
tree decl; tree node;
int first; tree *attributes;
{ {
if (TREE_CODE (decl) == FUNCTION_DECL) if (TREE_CODE (node) == VAR_DECL
SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1; && (TREE_STATIC (node) || DECL_EXTERNAL (node))
else if (first && avr_progmem_p (node))
&& (TREE_STATIC (decl) || DECL_EXTERNAL (decl))
&& TREE_CODE (decl) == VAR_DECL
&& avr_progmem_p (decl))
{ {
static const char *const dsec = ".progmem.data"; static const char dsec[] = ".progmem.data";
DECL_SECTION_NAME (decl) = build_string (strlen (dsec), dsec); *attributes = tree_cons (get_identifier ("section"),
TREE_READONLY (decl) = 1; build_tree_list (NULL, build_string (strlen (dsec), dsec)),
*attributes);
/* ??? This seems sketchy. Why can't the user declare the
thing const in the first place? */
TREE_READONLY (node) = 1;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment