static GTY(()) section *unnamed_sections;
/* Return a nonzero value if DECL has a section attribute. */
+#ifndef IN_NAMED_SECTION
#define IN_NAMED_SECTION(DECL) \
((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \
&& DECL_SECTION_NAME (DECL) != NULL_TREE)
+#endif
/* Hash table of named sections. */
static GTY((param_is (section))) htab_t section_htab;
/* Specifying a section attribute on a variable forces it into a
non-.bss section, and thus it cannot be common. */
- /* FIXME: In general this code should not be necessary because
- visibility pass is doing the same work. But notice_global_symbol
- is called early and it needs to make DECL_RTL to get the name.
- we take care of recomputing the DECL_RTL after visibility is changed. */
- if (TREE_CODE (decl) == VAR_DECL
- && DECL_SECTION_NAME (decl) != NULL_TREE
- && DECL_INITIAL (decl) == NULL_TREE
- && DECL_COMMON (decl))
- DECL_COMMON (decl) = 0;
+ gcc_assert (!(TREE_CODE (decl) == VAR_DECL
+ && DECL_SECTION_NAME (decl) != NULL_TREE
+ && DECL_INITIAL (decl) == NULL_TREE
+ && DECL_COMMON (decl))
+ || !DECL_COMMON (decl));
/* Variables can't be both common and weak. */
- if (TREE_CODE (decl) == VAR_DECL && DECL_WEAK (decl))
- DECL_COMMON (decl) = 0;
+ gcc_assert (TREE_CODE (decl) != VAR_DECL
+ || !DECL_WEAK (decl)
+ || !DECL_COMMON (decl));
if (use_object_blocks_p () && use_blocks_for_decl_p (decl))
x = create_block_symbol (name, get_block_for_decl (decl), -1);
* tree_low_cst (TREE_OPERAND (target, 1), 0));
target = TREE_OPERAND (target, 0);
}
- else if (TREE_CODE (target) == INDIRECT_REF
- && TREE_CODE (TREE_OPERAND (target, 0)) == NOP_EXPR
- && TREE_CODE (TREE_OPERAND (TREE_OPERAND (target, 0), 0))
- == ADDR_EXPR)
- target = TREE_OPERAND (TREE_OPERAND (TREE_OPERAND (target, 0), 0), 0);
else
break;
}
return (const_hash_1 (TREE_REALPART (exp)) * 5
+ const_hash_1 (TREE_IMAGPART (exp)));
- case VECTOR_CST:
- {
- tree link;
-
- hi = 7 + TYPE_VECTOR_SUBPARTS (TREE_TYPE (exp));
-
- for (link = TREE_VECTOR_CST_ELTS (exp); link; link = TREE_CHAIN (link))
- hi = hi * 563 + const_hash_1 (TREE_VALUE (link));
-
- return hi;
- }
-
case CONSTRUCTOR:
{
unsigned HOST_WIDE_INT idx;
return (compare_constant (TREE_REALPART (t1), TREE_REALPART (t2))
&& compare_constant (TREE_IMAGPART (t1), TREE_IMAGPART (t2)));
- case VECTOR_CST:
- {
- tree link1, link2;
-
- if (TYPE_VECTOR_SUBPARTS (TREE_TYPE (t1))
- != TYPE_VECTOR_SUBPARTS (TREE_TYPE (t2)))
- return 0;
-
- link2 = TREE_VECTOR_CST_ELTS (t2);
- for (link1 = TREE_VECTOR_CST_ELTS (t1);
- link1;
- link1 = TREE_CHAIN (link1))
- {
- if (!compare_constant (TREE_VALUE (link1), TREE_VALUE (link2)))
- return 0;
- link2 = TREE_CHAIN (link2);
- }
-
- return 1;
- }
-
case CONSTRUCTOR:
{
VEC(constructor_elt, gc) *v1, *v2;
case FDESC_EXPR:
{
struct addr_const value1, value2;
- enum rtx_code code;
- int ret;
decode_addr_const (t1, &value1);
decode_addr_const (t2, &value2);
-
- if (value1.offset != value2.offset)
- return 0;
-
- code = GET_CODE (value1.base);
- if (code != GET_CODE (value2.base))
- return 0;
-
- switch (code)
- {
- case SYMBOL_REF:
- ret = (strcmp (XSTR (value1.base, 0), XSTR (value2.base, 0)) == 0);
- break;
-
- case LABEL_REF:
- ret = (CODE_LABEL_NUMBER (XEXP (value1.base, 0))
- == CODE_LABEL_NUMBER (XEXP (value2.base, 0)));
- break;
-
- default:
- gcc_unreachable ();
- }
- return ret;
+ return (value1.offset == value2.offset
+ && strcmp (XSTR (value1.base, 0), XSTR (value2.base, 0)) == 0);
}
case PLUS_EXPR:
return build1 (TREE_CODE (exp), TREE_TYPE (exp),
copy_constant (TREE_OPERAND (exp, 0)));
- case VECTOR_CST:
- return build_vector (TREE_TYPE (exp),
- copy_list (TREE_VECTOR_CST_ELTS (exp)));
-
case CONSTRUCTOR:
{
tree copy = copy_node (exp);
the visibility type VIS, which must not be VISIBILITY_DEFAULT. */
void
-default_assemble_visibility (tree decl ATTRIBUTE_UNUSED,
- int vis ATTRIBUTE_UNUSED)
+default_assemble_visibility (tree decl, int vis)
{
-#ifdef HAVE_GAS_HIDDEN
static const char * const visibility_types[] = {
NULL, "protected", "hidden", "internal"
};
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
type = visibility_types[vis];
+#ifdef HAVE_GAS_HIDDEN
fprintf (asm_out_file, "\t.%s\t", type);
assemble_name (asm_out_file, name);
fprintf (asm_out_file, "\n");