diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-03-14 08:13:14 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-03-14 08:13:14 -0500 |
commit | 00f07fb912267666895463c5833b31c707e1a168 (patch) | |
tree | 2b63d169cd420d434b91dd28bd5cfdb8f6fd30dd /gcc | |
parent | 8e2b13c322771648d25066146072cdb94c02e017 (diff) | |
download | gcc-00f07fb912267666895463c5833b31c707e1a168.zip gcc-00f07fb912267666895463c5833b31c707e1a168.tar.gz gcc-00f07fb912267666895463c5833b31c707e1a168.tar.bz2 |
(output_constant_def): Do hashing and make label even if bytecode.
From-SVN: r6784
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/varasm.c | 73 |
1 files changed, 34 insertions, 39 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 89c1bba..b127de3 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -2540,38 +2540,35 @@ output_constant_def (exp) to see if any of them describes EXP. If yes, the descriptor records the label number already assigned. */ - if (!output_bytecode) - { - hash = const_hash (exp) % MAX_HASH_TABLE; + hash = const_hash (exp) % MAX_HASH_TABLE; - for (desc = const_hash_table[hash]; desc; desc = desc->next) - if (compare_constant (exp, desc)) - { - found = desc->label; - break; - } + for (desc = const_hash_table[hash]; desc; desc = desc->next) + if (compare_constant (exp, desc)) + { + found = desc->label; + break; + } - if (found == 0) - { - /* No constant equal to EXP is known to have been output. - Make a constant descriptor to enter EXP in the hash table. - Assign the label number and record it in the descriptor for - future calls to this function to find. */ - - /* Create a string containing the label name, in LABEL. */ - ASM_GENERATE_INTERNAL_LABEL (label, "LC", const_labelno); + if (found == 0) + { + /* No constant equal to EXP is known to have been output. + Make a constant descriptor to enter EXP in the hash table. + Assign the label number and record it in the descriptor for + future calls to this function to find. */ - desc = record_constant (exp); - desc->next = const_hash_table[hash]; - desc->label - = (char *) obstack_copy0 (&permanent_obstack, label, strlen (label)); - const_hash_table[hash] = desc; - } - else - { - /* Create a string containing the label name, in LABEL. */ - ASM_GENERATE_INTERNAL_LABEL (label, "LC", const_labelno); - } + /* Create a string containing the label name, in LABEL. */ + ASM_GENERATE_INTERNAL_LABEL (label, "LC", const_labelno); + + desc = record_constant (exp); + desc->next = const_hash_table[hash]; + desc->label + = (char *) obstack_copy0 (&permanent_obstack, label, strlen (label)); + const_hash_table[hash] = desc; + } + else + { + /* Create a string containing the label name, in LABEL. */ + ASM_GENERATE_INTERNAL_LABEL (label, "LC", const_labelno); } /* We have a symbol name; construct the SYMBOL_REF and the MEM. */ @@ -2580,17 +2577,15 @@ output_constant_def (exp) if (TREE_PERMANENT (exp)) end_temporary_allocation (); - if (!output_bytecode) - { - def = gen_rtx (SYMBOL_REF, Pmode, desc->label); + def = gen_rtx (SYMBOL_REF, Pmode, desc->label); - TREE_CST_RTL (exp) - = gen_rtx (MEM, TYPE_MODE (TREE_TYPE (exp)), def); - RTX_UNCHANGING_P (TREE_CST_RTL (exp)) = 1; - if (TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE - || TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE) - MEM_IN_STRUCT_P (TREE_CST_RTL (exp)) = 1; - } + TREE_CST_RTL (exp) + = gen_rtx (MEM, TYPE_MODE (TREE_TYPE (exp)), def); + RTX_UNCHANGING_P (TREE_CST_RTL (exp)) = 1; + if (TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE + || TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE) + MEM_IN_STRUCT_P (TREE_CST_RTL (exp)) = 1; + pop_obstacks (); /* Optionally set flags or add text to the name to record information |