diff options
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 96 |
1 files changed, 49 insertions, 47 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 84b4c48..2215fdd 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -268,6 +268,7 @@ data_section () in_section = in_data; } } + /* Tell assembler to ALWAYS switch to data section, in case it's not sure where it is. */ @@ -339,7 +340,7 @@ get_named_section_flags (section) { struct in_named_entry **slot; - slot = (struct in_named_entry**) + slot = (struct in_named_entry **) htab_find_slot_with_hash (in_named_htab, section, htab_hash_string (section), NO_INSERT); @@ -347,7 +348,7 @@ get_named_section_flags (section) } /* Returns true if the section has been declared before. Sets internal - flag on this section in in_named_hash so subsequent calls on this + flag on this section in in_named_hash so subsequent calls on this section will return false. */ bool @@ -356,15 +357,15 @@ named_section_first_declaration (name) { struct in_named_entry **slot; - slot = (struct in_named_entry**) - htab_find_slot_with_hash (in_named_htab, name, + slot = (struct in_named_entry **) + htab_find_slot_with_hash (in_named_htab, name, htab_hash_string (name), NO_INSERT); if (! (*slot)->declared) { (*slot)->declared = true; return true; } - else + else { return false; } @@ -381,7 +382,7 @@ set_named_section_flags (section, flags) { struct in_named_entry **slot, *entry; - slot = (struct in_named_entry**) + slot = (struct in_named_entry **) htab_find_slot_with_hash (in_named_htab, section, htab_hash_string (section), INSERT); entry = *slot; @@ -412,7 +413,7 @@ named_section_flags (name, flags) if (! set_named_section_flags (name, flags)) abort (); - (* targetm.asm_out.named_section) (name, flags); + (*targetm.asm_out.named_section) (name, flags); if (flags & SECTION_FORGET) in_section = no_section; @@ -624,9 +625,9 @@ default_exception_section () void mergeable_string_section (decl, align, flags) - tree decl ATTRIBUTE_UNUSED; - unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED; - unsigned int flags ATTRIBUTE_UNUSED; + tree decl ATTRIBUTE_UNUSED; + unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED; + unsigned int flags ATTRIBUTE_UNUSED; { #ifdef HAVE_GAS_SHF_MERGE if (flag_merge_constants @@ -657,7 +658,7 @@ mergeable_string_section (decl, align, flags) for (i = 0; i < len; i += unit) { for (j = 0; j < unit; j++) - if (str [i + j] != '\0') + if (str[i + j] != '\0') break; if (j == unit) break; @@ -693,15 +694,15 @@ mergeable_string_section (decl, align, flags) } #endif readonly_data_section (); -} +} /* Tell assembler to switch to the section for constant merging. */ void mergeable_constant_section (mode, align, flags) - enum machine_mode mode ATTRIBUTE_UNUSED; - unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED; - unsigned int flags ATTRIBUTE_UNUSED; + enum machine_mode mode ATTRIBUTE_UNUSED; + unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED; + unsigned int flags ATTRIBUTE_UNUSED; { #ifdef HAVE_GAS_SHF_MERGE unsigned int modesize = GET_MODE_BITSIZE (mode); @@ -720,7 +721,7 @@ mergeable_constant_section (mode, align, flags) flags |= (align / 8) | SECTION_MERGE; named_section_flags (name, flags); return; - } + } #endif readonly_data_section (); } @@ -729,7 +730,7 @@ mergeable_constant_section (mode, align, flags) static const char * strip_reg_name (name) - const char *name; + const char *name; { #ifdef REGISTER_PREFIX if (!strncmp (name, REGISTER_PREFIX, strlen (REGISTER_PREFIX))) @@ -750,7 +751,7 @@ strip_reg_name (name) int decode_reg_name (asmspec) - const char *asmspec; + const char *asmspec; { if (asmspec != 0) { @@ -1203,7 +1204,7 @@ assemble_start_function (decl, fnname) { #ifdef ASM_OUTPUT_MAX_SKIP_ALIGN ASM_OUTPUT_MAX_SKIP_ALIGN (asm_out_file, - align_functions_log, align_functions-1); + align_functions_log, align_functions - 1); #else ASM_OUTPUT_ALIGN (asm_out_file, align_functions_log); #endif @@ -1373,7 +1374,7 @@ assemble_string (p, size) static void asm_emit_uninitialised (decl, name, size, rounded) tree decl; - const char * name; + const char *name; int size ATTRIBUTE_UNUSED; int rounded ATTRIBUTE_UNUSED; { @@ -2486,7 +2487,7 @@ const_str_htab_eq (x, y) static void const_str_htab_del (dfsp) - void *dfsp; + void *dfsp; { free (dfsp); } @@ -2778,7 +2779,7 @@ compare_constant_1 (exp, p) && TREE_CODE (TREE_PURPOSE (link)) == FIELD_DECL) { if (memcmp ((char *) &TREE_PURPOSE (link), p, - sizeof TREE_PURPOSE (link))) + sizeof TREE_PURPOSE (link))) return 0; p += sizeof TREE_PURPOSE (link); @@ -2839,7 +2840,7 @@ compare_constant_1 (exp, p) tree new = (*lang_hooks.expand_constant) (exp); if (new != exp) - return compare_constant_1 (new, p); + return compare_constant_1 (new, p); else return 0; } @@ -2935,7 +2936,7 @@ record_constant_1 (exp) obstack_grow (&permanent_obstack, &nbytes, sizeof (nbytes)); obstack_blank (&permanent_obstack, nbytes); get_set_constructor_bytes - (exp, (unsigned char *) permanent_obstack.next_free-nbytes, + (exp, (unsigned char *) permanent_obstack.next_free - nbytes, nbytes); return; } @@ -3053,7 +3054,7 @@ record_constant_1 (exp) tree new = (*lang_hooks.expand_constant) (exp); if (new != exp) - record_constant_1 (new); + record_constant_1 (new); return; } } @@ -3631,16 +3632,16 @@ decode_rtx_const (mode, x, value) if (value->kind == RTX_INT && value->un.addr.base != 0 && GET_CODE (value->un.addr.base) == UNSPEC) - { + { /* For a simple UNSPEC, the base is set to the operand, the kind field is set to the index of - the unspec expression. + the unspec expression. Together with the code below, in case that - the operand is a SYMBOL_REF or LABEL_REF, - the address of the string or the code_label + the operand is a SYMBOL_REF or LABEL_REF, + the address of the string or the code_label is taken as base. */ if (XVECLEN (value->un.addr.base, 0) == 1) - { + { value->kind = RTX_UNSPEC + XINT (value->un.addr.base, 1); value->un.addr.base = XVECEXP (value->un.addr.base, 0, 0); } @@ -3768,7 +3769,7 @@ mem_for_const_double (x) return 0; } - + /* Given a constant rtx X, make (or find) a memory constant for its value and return a MEM rtx to refer to it in memory. */ @@ -3797,7 +3798,7 @@ force_const_mem (mode, x) desc = record_constant_rtx (mode, x); desc->next = const_rtx_hash_table[hash]; const_rtx_hash_table[hash] = desc; - + /* Align the location counter as required by EXP's data type. */ align = GET_MODE_ALIGNMENT (mode == VOIDmode ? word_mode : mode); #ifdef CONSTANT_ALIGNMENT @@ -3826,7 +3827,7 @@ force_const_mem (mode, x) first_pool = pool; else last_pool->next = pool; - + last_pool = pool; pool_offset += GET_MODE_SIZE (mode); @@ -3944,8 +3945,8 @@ get_pool_size () void output_constant_pool (fnname, fndecl) - const char *fnname ATTRIBUTE_UNUSED; - tree fndecl ATTRIBUTE_UNUSED; + const char *fnname ATTRIBUTE_UNUSED; + tree fndecl ATTRIBUTE_UNUSED; { struct pool_constant *pool; rtx x; @@ -4055,7 +4056,7 @@ output_constant_pool (fnname, fndecl) } break; - case MODE_VECTOR_INT: + case MODE_VECTOR_INT: { int i, units; rtx elt; @@ -4202,10 +4203,11 @@ mark_constant (current_rtx, data) if (CONSTANT_POOL_ADDRESS_P (x)) { struct pool_constant *pool = find_pool_constant (cfun, x); - if (pool->mark == 0) { - pool->mark = 1; - for_each_rtx (&(pool->constant), &mark_constant, NULL); - } + if (pool->mark == 0) + { + pool->mark = 1; + for_each_rtx (&(pool->constant), &mark_constant, NULL); + } else return -1; } @@ -4279,7 +4281,7 @@ output_addressed_constants (exp) case CONSTRUCTOR: for (tem = CONSTRUCTOR_ELTS (exp); tem; tem = TREE_CHAIN (tem)) if (TREE_VALUE (tem) != 0) - reloc |= output_addressed_constants (TREE_VALUE (tem)); + reloc |= output_addressed_constants (TREE_VALUE (tem)); break; @@ -4397,7 +4399,7 @@ initializer_constant_valid_p (value, endtype) case PLUS_EXPR: if (! INTEGRAL_TYPE_P (endtype) || TYPE_PRECISION (endtype) >= POINTER_SIZE) - { + { tree valid0 = initializer_constant_valid_p (TREE_OPERAND (value, 0), endtype); tree valid1 = initializer_constant_valid_p (TREE_OPERAND (value, 1), @@ -4407,7 +4409,7 @@ initializer_constant_valid_p (value, endtype) return valid1; if (valid1 == null_pointer_node) return valid0; - } + } break; case MINUS_EXPR: @@ -4614,7 +4616,7 @@ output_constant (exp, size, align) if (TREE_CODE (exp) == INTEGER_CST) assemble_integer (expand_expr (exp, NULL_RTX, VOIDmode, EXPAND_INITIALIZER), - thissize, align, 1); + thissize, align, 1); else if (TREE_CODE (exp) == CONSTRUCTOR) { unsigned char *buffer = (unsigned char *) alloca (thissize); @@ -4656,7 +4658,7 @@ array_size_for_constructor (val) return TREE_STRING_LENGTH (val); max_index = NULL_TREE; - for (i = CONSTRUCTOR_ELTS (val); i ; i = TREE_CHAIN (i)) + for (i = CONSTRUCTOR_ELTS (val); i; i = TREE_CHAIN (i)) { tree index = TREE_PURPOSE (i); @@ -5050,7 +5052,7 @@ weak_finish () { tree t; - for (t = weak_decls; t ; t = TREE_CHAIN (t)) + for (t = weak_decls; t; t = TREE_CHAIN (t)) { tree decl = TREE_VALUE (t); const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); @@ -5234,7 +5236,7 @@ void init_varasm_once () { const_str_htab = htab_create (128, const_str_htab_hash, const_str_htab_eq, - const_str_htab_del); + const_str_htab_del); in_named_htab = htab_create (31, in_named_entry_hash, in_named_entry_eq, NULL); |