summaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-12 04:03:49 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-12 04:03:49 +0000
commit738a6bdaaa22a526fae65016127c229d99f377b4 (patch)
tree40360d8b10e6d2d13c2b1ae77545f00bc6f2121b /gcc/config
parent7c862e3891ee1a34e2c33424cbc753055c523423 (diff)
downloadgcc-738a6bdaaa22a526fae65016127c229d99f377b4.tar.gz
* symtab.c (section_hash): New hash.
(symtab_unregister_node): Clear section before freeing. (hash_section_hash_entry): New haser. (eq_sections): New function. (symtab_node::set_section_for_node): New method. (set_section_1): Update. (symtab_node::set_section): Take string instead of tree as parameter. (symtab_resolve_alias): Update. * cgraph.h (section_hash_entry_d): New structure. (section_hash_entry): New typedef. (cgraph_node): Change comdat_group_ to x_comdat_group, change section_ to x_section and turn into section_hash_entry; update accestors; put set_section_for_node offline. * tree.c (decl_section_name): Turn into string. (set_decl_section_name): Change parameter to be string. * tree.h (decl_section_name, set_decl_section_name): Update prototypes. * sdbout.c (sdbout_one_type): Update. * tree-vect-data-refs.c (vect_can_force_dr_alignment_p): Update. * varasm.c (IN_NAMED_SECTION, get_named_section, resolve_unique_section, hot_function_section, get_named_text_section, USE_SELECT_SECTION_FOR_FUNCTIONS, default_function_rodata_section, make_decl_rtl, default_unique_section): Update. * config/c6x/c6x.c (c6x_in_small_data_p): Update. (c6x_elf_unique_section): Update. * config/nios2/nios2.c (nios2_in_small_data_p): Update. * config/pa/pa.c (pa_function_section): Update. * config/pa/pa.h (IN_NAMED_SECTION_P): Update. * config/ia64/ia64.c (ia64_in_small_data_p): Update. * config/arc/arc.c (arc_in_small_data_p): Update. * config/arm/unknown-elf.h (IN_NAMED_SECTION_P): Update. * config/mcore/mcore.c (mcore_unique_section): Update. * config/mips/mips.c (mips16_build_function_stub): Update. (mips16_build_call_stub): Update. (mips_function_rodata_section): Update. (mips_in_small_data_p): Update. * config/score/score.c (score_in_small_data_p): Update. * config/rx/rx.c (rx_in_small_data): Update. * config/rs6000/rs6000.c (rs6000_elf_in_small_data_p): Update. (rs6000_xcoff_asm_named_section): Update. (rs6000_xcoff_unique_section): Update. * config/frv/frv.c (frv_string_begins_with): Update. (frv_in_small_data_p): Update. * config/v850/v850.c (v850_encode_data_area): Update. * config/bfin/bfin.c (DECL_SECTION_NAME): Update. (bfin_handle_l1_data_attribute): Update. (bfin_handle_l2_attribute): Update. * config/mep/mep.c (mep_unique_section): Update. * config/microblaze/microblaze.c (microblaze_elf_in_small_data_p): Update. * config/h8300/h8300.c (h8300_handle_eightbit_data_attribute): Update. (h8300_handle_tiny_data_attribute): Update. * config/m32r/m32r.c (m32r_in_small_data_p): Update. (m32r_in_small_data_p): Update. * config/alpha/alpha.c (alpha_in_small_data_p): Update. * config/i386/i386.c (ix86_in_large_data_p): Update. * config/i386/winnt.c (i386_pe_unique_section): Update. * config/darwin.c (darwin_function_section): Update. * config/lm32/lm32.c (lm32_in_small_data_p): Update. * tree-emutls.c (get_emutls_init_templ_addr): Update. (new_emutls_decl): Update. * lto-cgraph.c (lto_output_node, input_node, input_varpool_node, input_varpool_node): Update. (ead_string_cst): Turn to ... (read_string): ... this one. * dwarf2out.c (secname_for_decl): Update. * asan.c (asan_protect_global): Update. * c-family/c-common.c (handle_section_attribute): Update handling for section names that are no longer trees. * java/class.c (build_utf8_ref): Update handling for section names that are no longer trees. (emit_register_classes_in_jcr_section): Update. * vtable-class-hierarchy.c: Update handling for section names that are no longer trees. * decl.c (duplicate_decls): Likewise. * gcc-interface/utils.c: Update handling for section names that are no longer trees. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211489 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/alpha/alpha.c2
-rw-r--r--gcc/config/arc/arc.c2
-rw-r--r--gcc/config/arm/unknown-elf.h2
-rw-r--r--gcc/config/bfin/bfin.c25
-rw-r--r--gcc/config/c6x/c6x.c4
-rw-r--r--gcc/config/darwin.c2
-rw-r--r--gcc/config/frv/frv.c9
-rw-r--r--gcc/config/h8300/h8300.c4
-rw-r--r--gcc/config/i386/i386.c4
-rw-r--r--gcc/config/i386/winnt.c2
-rw-r--r--gcc/config/ia64/ia64.c2
-rw-r--r--gcc/config/lm32/lm32.c2
-rw-r--r--gcc/config/m32r/m32r.c5
-rw-r--r--gcc/config/mcore/mcore.c2
-rw-r--r--gcc/config/mep/mep.c2
-rw-r--r--gcc/config/microblaze/microblaze.c2
-rw-r--r--gcc/config/mips/mips.c8
-rw-r--r--gcc/config/nios2/nios2.c2
-rw-r--r--gcc/config/pa/pa.c4
-rw-r--r--gcc/config/pa/pa.h2
-rw-r--r--gcc/config/rs6000/rs6000.c6
-rw-r--r--gcc/config/rx/rx.c8
-rw-r--r--gcc/config/score/score.c2
-rw-r--r--gcc/config/v850/v850.c2
24 files changed, 49 insertions, 56 deletions
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 77ba003add5..b06a5aafa6d 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -682,7 +682,7 @@ alpha_in_small_data_p (const_tree exp)
if (TREE_CODE (exp) == VAR_DECL && DECL_SECTION_NAME (exp))
{
- const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (exp));
+ const char *section = DECL_SECTION_NAME (exp);
if (strcmp (section, ".sdata") == 0
|| strcmp (section, ".sbss") == 0)
return true;
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 0aa43c2ce2e..6e558cb76bc 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -6277,7 +6277,7 @@ arc_in_small_data_p (const_tree decl)
const char *name;
/* Reject anything that isn't in a known small-data section. */
- name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
+ name = DECL_SECTION_NAME (decl);
if (strcmp (name, ".sdata") != 0 && strcmp (name, ".sbss") != 0)
return false;
diff --git a/gcc/config/arm/unknown-elf.h b/gcc/config/arm/unknown-elf.h
index ec6f9a48894..56aa166272f 100644
--- a/gcc/config/arm/unknown-elf.h
+++ b/gcc/config/arm/unknown-elf.h
@@ -50,7 +50,7 @@
/* Return a nonzero value if DECL has a section attribute. */
#define IN_NAMED_SECTION_P(DECL) \
((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \
- && DECL_SECTION_NAME (DECL) != NULL_TREE)
+ && DECL_SECTION_NAME (DECL) != NULL)
#undef ASM_OUTPUT_ALIGNED_BSS
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index 3c6ed7b9a11..35bbace4c07 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -4760,8 +4760,8 @@ bfin_handle_l1_text_attribute (tree *node, tree name, tree ARG_UNUSED (args),
/* The decl may have already been given a section attribute
from a previous declaration. Ensure they match. */
- else if (DECL_SECTION_NAME (decl) != NULL_TREE
- && strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)),
+ else if (DECL_SECTION_NAME (decl) != NULL
+ && strcmp (DECL_SECTION_NAME (decl),
".l1.text") != 0)
{
error ("section of %q+D conflicts with previous declaration",
@@ -4769,7 +4769,7 @@ bfin_handle_l1_text_attribute (tree *node, tree name, tree ARG_UNUSED (args),
*no_add_attrs = true;
}
else
- set_decl_section_name (decl, build_string (9, ".l1.text"));
+ set_decl_section_name (decl, ".l1.text");
return NULL_TREE;
}
@@ -4811,8 +4811,8 @@ bfin_handle_l1_data_attribute (tree *node, tree name, tree ARG_UNUSED (args),
/* The decl may have already been given a section attribute
from a previous declaration. Ensure they match. */
- if (DECL_SECTION_NAME (decl) != NULL_TREE
- && strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)),
+ if (DECL_SECTION_NAME (decl) != NULL
+ && strcmp (DECL_SECTION_NAME (decl),
section_name) != 0)
{
error ("section of %q+D conflicts with previous declaration",
@@ -4820,8 +4820,7 @@ bfin_handle_l1_data_attribute (tree *node, tree name, tree ARG_UNUSED (args),
*no_add_attrs = true;
}
else
- DECL_SECTION_NAME (decl)
- = build_string (strlen (section_name) + 1, section_name);
+ set_decl_section_name (decl, section_name);
}
return NULL_TREE;
@@ -4838,8 +4837,8 @@ bfin_handle_l2_attribute (tree *node, tree ARG_UNUSED (name),
if (TREE_CODE (decl) == FUNCTION_DECL)
{
- if (DECL_SECTION_NAME (decl) != NULL_TREE
- && strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)),
+ if (DECL_SECTION_NAME (decl) != NULL
+ && strcmp (DECL_SECTION_NAME (decl),
".l2.text") != 0)
{
error ("section of %q+D conflicts with previous declaration",
@@ -4847,12 +4846,12 @@ bfin_handle_l2_attribute (tree *node, tree ARG_UNUSED (name),
*no_add_attrs = true;
}
else
- set_decl_section_name (decl, build_string (9, ".l2.text"));
+ set_decl_section_name (decl, ".l2.text");
}
else if (TREE_CODE (decl) == VAR_DECL)
{
- if (DECL_SECTION_NAME (decl) != NULL_TREE
- && strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)),
+ if (DECL_SECTION_NAME (decl) != NULL
+ && strcmp (DECL_SECTION_NAME (decl),
".l2.data") != 0)
{
error ("section of %q+D conflicts with previous declaration",
@@ -4860,7 +4859,7 @@ bfin_handle_l2_attribute (tree *node, tree ARG_UNUSED (name),
*no_add_attrs = true;
}
else
- set_decl_section_name (decl, build_string (9, ".l2.data"));
+ set_decl_section_name (decl, ".l2.data");
}
return NULL_TREE;
diff --git a/gcc/config/c6x/c6x.c b/gcc/config/c6x/c6x.c
index 90a37481290..7fa60b96e1d 100644
--- a/gcc/config/c6x/c6x.c
+++ b/gcc/config/c6x/c6x.c
@@ -868,7 +868,7 @@ c6x_in_small_data_p (const_tree exp)
if (TREE_CODE (exp) == VAR_DECL && DECL_SECTION_NAME (exp))
{
- const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (exp));
+ const char *section = DECL_SECTION_NAME (exp);
if (strcmp (section, ".neardata") == 0
|| strncmp (section, ".neardata.", 10) == 0
@@ -1060,7 +1060,7 @@ c6x_elf_unique_section (tree decl, int reloc)
string = ACONCAT ((linkonce, prefix, ".", name, NULL));
- set_decl_section_name (decl, build_string (strlen (string), string));
+ set_decl_section_name (decl, string);
return;
}
default_unique_section (decl, reloc);
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index a2c87491d21..d13983ce811 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -3604,7 +3604,7 @@ darwin_function_section (tree decl, enum node_frequency freq,
/* If there is a specified section name, we should not be trying to
override. */
- if (decl && DECL_SECTION_NAME (decl) != NULL_TREE)
+ if (decl && DECL_SECTION_NAME (decl) != NULL)
return get_named_section (decl, NULL, 0);
/* We always put unlikely executed stuff in the cold section. */
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index 98992b29db8..98a5336a995 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -263,7 +263,7 @@ static frv_stack_t *frv_stack_cache = (frv_stack_t *)0;
static void frv_option_override (void);
static bool frv_legitimate_address_p (enum machine_mode, rtx, bool);
static int frv_default_flags_for_cpu (void);
-static int frv_string_begins_with (const_tree, const char *);
+static int frv_string_begins_with (const char *, const char *);
static FRV_INLINE bool frv_small_data_reloc_p (rtx, int);
static void frv_print_operand (FILE *, rtx, int);
static void frv_print_operand_address (FILE *, rtx);
@@ -773,13 +773,12 @@ frv_option_override (void)
/* Return true if NAME (a STRING_CST node) begins with PREFIX. */
static int
-frv_string_begins_with (const_tree name, const char *prefix)
+frv_string_begins_with (const char *name, const char *prefix)
{
const int prefix_len = strlen (prefix);
/* Remember: NAME's length includes the null terminator. */
- return (TREE_STRING_LENGTH (name) > prefix_len
- && strncmp (TREE_STRING_POINTER (name), prefix, prefix_len) == 0);
+ return (strncmp (name, prefix, prefix_len) == 0);
}
/* Implement TARGET_CONDITIONAL_REGISTER_USAGE. */
@@ -9475,7 +9474,7 @@ static bool
frv_in_small_data_p (const_tree decl)
{
HOST_WIDE_INT size;
- const_tree section_name;
+ const char *section_name;
/* Don't apply the -G flag to internal compiler structures. We
should leave such structures in the main data section, partly
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 3c90340aaed..998afd510be 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -5461,7 +5461,7 @@ h8300_handle_eightbit_data_attribute (tree *node, tree name,
if (TREE_STATIC (decl) || DECL_EXTERNAL (decl))
{
- set_decl_section_name (decl, build_string (7, ".eight"));
+ set_decl_section_name (decl, ".eight");
}
else
{
@@ -5485,7 +5485,7 @@ h8300_handle_tiny_data_attribute (tree *node, tree name,
if (TREE_STATIC (decl) || DECL_EXTERNAL (decl))
{
- set_decl_section_name (decl, build_string (6, ".tiny"));
+ set_decl_section_name (decl, ".tiny");
}
else
{
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 2050aaf005c..41f1b7f84bc 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -5028,7 +5028,7 @@ ix86_in_large_data_p (tree exp)
if (TREE_CODE (exp) == VAR_DECL && DECL_SECTION_NAME (exp))
{
- const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (exp));
+ const char *section = DECL_SECTION_NAME (exp);
if (strcmp (section, ".ldata") == 0
|| strcmp (section, ".lbss") == 0)
return true;
@@ -5193,7 +5193,7 @@ x86_64_elf_unique_section (tree decl, int reloc)
string = ACONCAT ((linkonce, prefix, ".", name, NULL));
- set_decl_section_name (decl, build_string (strlen (string), string));
+ set_decl_section_name (decl, string);
return;
}
}
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index ee22375c227..10c0b003f8d 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -438,7 +438,7 @@ i386_pe_unique_section (tree decl, int reloc)
string = XALLOCAVEC (char, len + 1);
sprintf (string, "%s%s", prefix, name);
- set_decl_section_name (decl, build_string (len, string));
+ set_decl_section_name (decl, string);
}
/* Local and global relocs can be placed always into readonly memory for
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index cb9a9ca8af8..de486c6dfac 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -9893,7 +9893,7 @@ ia64_in_small_data_p (const_tree exp)
if (TREE_CODE (exp) == VAR_DECL && DECL_SECTION_NAME (exp))
{
- const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (exp));
+ const char *section = DECL_SECTION_NAME (exp);
if (strcmp (section, ".sdata") == 0
|| strncmp (section, ".sdata.", 7) == 0
diff --git a/gcc/config/lm32/lm32.c b/gcc/config/lm32/lm32.c
index fe3dcf4057f..bfba0489974 100644
--- a/gcc/config/lm32/lm32.c
+++ b/gcc/config/lm32/lm32.c
@@ -791,7 +791,7 @@ lm32_in_small_data_p (const_tree exp)
if (TREE_CODE (exp) == VAR_DECL && DECL_SECTION_NAME (exp))
{
- const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (exp));
+ const char *section = DECL_SECTION_NAME (exp);
if (strcmp (section, ".sdata") == 0 || strcmp (section, ".sbss") == 0)
return true;
}
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index 2286a857439..35c136edb99 100644
--- a/gcc/config/m32r/m32r.c
+++ b/gcc/config/m32r/m32r.c
@@ -463,7 +463,7 @@ m32r_encode_section_info (tree decl, rtx rtl, int first)
static bool
m32r_in_small_data_p (const_tree decl)
{
- const_tree section;
+ const char *section;
if (TREE_CODE (decl) != VAR_DECL)
return false;
@@ -474,8 +474,7 @@ m32r_in_small_data_p (const_tree decl)
section = DECL_SECTION_NAME (decl);
if (section)
{
- const char *const name = TREE_STRING_POINTER (section);
- if (strcmp (name, ".sdata") == 0 || strcmp (name, ".sbss") == 0)
+ if (strcmp (section, ".sdata") == 0 || strcmp (section, ".sbss") == 0)
return true;
}
else
diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c
index f9af66b5b59..5ff8daf015e 100644
--- a/gcc/config/mcore/mcore.c
+++ b/gcc/config/mcore/mcore.c
@@ -3089,7 +3089,7 @@ mcore_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED)
sprintf (string, "%s%s", prefix, name);
- set_decl_section_name (decl, build_string (len, string));
+ set_decl_section_name (decl, string);
}
int
diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c
index 2f2d0faee27..853821c8771 100644
--- a/gcc/config/mep/mep.c
+++ b/gcc/config/mep/mep.c
@@ -4658,7 +4658,7 @@ mep_unique_section (tree decl, int reloc)
sprintf (string, "%s%s", prefix, name);
- set_decl_section_name (decl, build_string (len, string));
+ set_decl_section_name (decl, string);
}
/* Given a decl, a section name, and whether the decl initializer
diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
index cf2dc74cccc..0c2aec84ac2 100644
--- a/gcc/config/microblaze/microblaze.c
+++ b/gcc/config/microblaze/microblaze.c
@@ -3067,7 +3067,7 @@ microblaze_elf_in_small_data_p (const_tree decl)
if (TREE_CODE (decl) == VAR_DECL && DECL_SECTION_NAME (decl))
{
- const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
+ const char *section = DECL_SECTION_NAME (decl);
if (strcmp (section, ".sdata") == 0
|| strcmp (section, ".sdata2") == 0
|| strcmp (section, ".sbss") == 0
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 73b6963ba65..585b7555765 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -6618,7 +6618,7 @@ mips16_build_function_stub (void)
stubdecl = build_decl (BUILTINS_LOCATION,
FUNCTION_DECL, get_identifier (stubname),
build_function_type_list (void_type_node, NULL_TREE));
- set_decl_section_name (stubdecl, build_string (strlen (secname), secname));
+ set_decl_section_name (stubdecl, secname);
DECL_RESULT (stubdecl) = build_decl (BUILTINS_LOCATION,
RESULT_DECL, NULL_TREE, void_type_node);
@@ -6872,7 +6872,7 @@ mips16_build_call_stub (rtx retval, rtx *fn_ptr, rtx args_size, int fp_code)
FUNCTION_DECL, stubid,
build_function_type_list (void_type_node,
NULL_TREE));
- set_decl_section_name (stubdecl, build_string (strlen (secname), secname));
+ set_decl_section_name (stubdecl, secname);
DECL_RESULT (stubdecl) = build_decl (BUILTINS_LOCATION,
RESULT_DECL, NULL_TREE,
void_type_node);
@@ -8490,7 +8490,7 @@ mips_function_rodata_section (tree decl)
if (decl && DECL_SECTION_NAME (decl))
{
- const char *name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
+ const char *name = DECL_SECTION_NAME (decl);
if (DECL_COMDAT_GROUP (decl) && strncmp (name, ".gnu.linkonce.t.", 16) == 0)
{
char *rname = ASTRDUP (name);
@@ -8530,7 +8530,7 @@ mips_in_small_data_p (const_tree decl)
const char *name;
/* Reject anything that isn't in a known small-data section. */
- name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
+ name = DECL_SECTION_NAME (decl);
if (strcmp (name, ".sdata") != 0 && strcmp (name, ".sbss") != 0)
return false;
diff --git a/gcc/config/nios2/nios2.c b/gcc/config/nios2/nios2.c
index ff3536d1c21..354e3d9a6e6 100644
--- a/gcc/config/nios2/nios2.c
+++ b/gcc/config/nios2/nios2.c
@@ -1628,7 +1628,7 @@ nios2_in_small_data_p (const_tree exp)
{
if (DECL_SECTION_NAME (exp))
{
- const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (exp));
+ const char *section = DECL_SECTION_NAME (exp);
if (nios2_section_threshold > 0
&& nios2_small_section_name_p (section))
return true;
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index fe3881e8092..e13674143fe 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -10262,10 +10262,10 @@ pa_function_section (tree decl, enum node_frequency freq,
/* Force nested functions into the same section as the containing
function. */
if (decl
- && DECL_SECTION_NAME (decl) == NULL_TREE
+ && DECL_SECTION_NAME (decl) == NULL
&& DECL_CONTEXT (decl) != NULL_TREE
&& TREE_CODE (DECL_CONTEXT (decl)) == FUNCTION_DECL
- && DECL_SECTION_NAME (DECL_CONTEXT (decl)) == NULL_TREE)
+ && DECL_SECTION_NAME (DECL_CONTEXT (decl)) == NULL)
return function_section (DECL_CONTEXT (decl));
/* Otherwise, use the default function section. */
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index ac3f0ebe74e..3f9f06bb6f2 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -955,7 +955,7 @@ do { \
/* Return a nonzero value if DECL has a section attribute. */
#define IN_NAMED_SECTION_P(DECL) \
((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \
- && DECL_SECTION_NAME (DECL) != NULL_TREE)
+ && DECL_SECTION_NAME (DECL) != NULL)
/* Define this macro if references to a symbol must be treated
differently depending on something about the variable or
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 3e3a4878428..98abcf211b4 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -28508,7 +28508,7 @@ rs6000_elf_in_small_data_p (const_tree decl)
if (TREE_CODE (decl) == VAR_DECL && DECL_SECTION_NAME (decl))
{
- const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
+ const char *section = DECL_SECTION_NAME (decl);
if (compare_section_name (section, ".sdata")
|| compare_section_name (section, ".sdata2")
|| compare_section_name (section, ".gnu.linkonce.s")
@@ -29277,7 +29277,7 @@ rs6000_xcoff_asm_named_section (const char *name, unsigned int flags,
#define IN_NAMED_SECTION(DECL) \
((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \
- && DECL_SECTION_NAME (DECL) != NULL_TREE)
+ && DECL_SECTION_NAME (DECL) != NULL)
static section *
rs6000_xcoff_select_section (tree decl, int reloc,
@@ -29342,7 +29342,7 @@ rs6000_xcoff_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED)
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
name = (*targetm.strip_name_encoding) (name);
- set_decl_section_name (decl, build_string (strlen (name), name));
+ set_decl_section_name (decl, name);
}
/* Select section for constant in constant pool.
diff --git a/gcc/config/rx/rx.c b/gcc/config/rx/rx.c
index 2a525f33580..3fc2847ac60 100644
--- a/gcc/config/rx/rx.c
+++ b/gcc/config/rx/rx.c
@@ -2219,7 +2219,7 @@ static bool
rx_in_small_data (const_tree decl)
{
int size;
- const_tree section;
+ const char * section;
if (rx_small_data_limit == 0)
return false;
@@ -2238,11 +2238,7 @@ rx_in_small_data (const_tree decl)
section = DECL_SECTION_NAME (decl);
if (section)
- {
- const char * const name = TREE_STRING_POINTER (section);
-
- return (strcmp (name, "D_2") == 0) || (strcmp (name, "B_2") == 0);
- }
+ return (strcmp (section, "D_2") == 0) || (strcmp (section, "B_2") == 0);
size = int_size_in_bytes (TREE_TYPE (decl));
diff --git a/gcc/config/score/score.c b/gcc/config/score/score.c
index 576a2a0cde9..d65684c45e4 100644
--- a/gcc/config/score/score.c
+++ b/gcc/config/score/score.c
@@ -668,7 +668,7 @@ score_in_small_data_p (const_tree decl)
if (TREE_CODE (decl) == VAR_DECL && DECL_SECTION_NAME (decl) != 0)
{
const char *name;
- name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
+ name = DECL_SECTION_NAME (decl);
if (strcmp (name, ".sdata") != 0
&& strcmp (name, ".sbss") != 0)
return true;
diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c
index 070a5cbd7d1..f736c44bae8 100644
--- a/gcc/config/v850/v850.c
+++ b/gcc/config/v850/v850.c
@@ -2190,7 +2190,7 @@ v850_encode_data_area (tree decl, rtx symbol)
{
if (DECL_SECTION_NAME (decl))
{
- const char *name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
+ const char *name = DECL_SECTION_NAME (decl);
if (streq (name, ".zdata") || streq (name, ".zbss"))
v850_set_data_area (decl, DATA_AREA_ZDA);