diff options
author | Mark Mitchell <mark@codesourcery.com> | 2000-03-31 08:57:54 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2000-03-31 08:57:54 +0000 |
commit | c13e8210479fd194128fed8742d8a491b686a404 (patch) | |
tree | af3dfff0cabf48c3e9e50b45078202db74413026 /gcc/rtl.c | |
parent | cca8e0ff228daba37afc9279721c1fa04faa0269 (diff) | |
download | gcc-c13e8210479fd194128fed8742d8a491b686a404.zip gcc-c13e8210479fd194128fed8742d8a491b686a404.tar.gz gcc-c13e8210479fd194128fed8742d8a491b686a404.tar.bz2 |
Makefile.in (emit-rtl.o): Depend on HASHTAB_H.
* Makefile.in (emit-rtl.o): Depend on HASHTAB_H.
* alias.c (reg_known_value): Add comments.
(init_alias_analysis): Likewise.
* cse.c (exp_equiv_p): CONST_INTs are equal iff they have the same
address.
(cse_basic_block): Fix typo in comment.
* emit-rtl.c: Include hashtab.h.
(const_int_htab): New variable.
(const_int_htab_hash): New function.
(const_int_htab_eq): Likewise.
(rtx_htab_mark_1): Likewise.
(rtx_htab_mark): Likewise.
(gen_rtx_CONST_INT): Cache all CONST_INTs.
(unshare_all_rtx): Fix formatting.
(init_emit_once): Initialize const_int_htab.
* rtl.c (rtx_equal_p): CONST_INTs are equal iff they have the same
address.
* rtl.texi: Document the fact that all CONST_INTs with the same
value are shared.
From-SVN: r32844
Diffstat (limited to 'gcc/rtl.c')
-rw-r--r-- | gcc/rtl.c | 42 |
1 files changed, 26 insertions, 16 deletions
@@ -613,22 +613,32 @@ rtx_equal_p (x, y) if (GET_MODE (x) != GET_MODE (y)) return 0; - /* REG, LABEL_REF, and SYMBOL_REF can be compared nonrecursively. */ - - if (code == REG) - /* Until rtl generation is complete, don't consider a reference to the - return register of the current function the same as the return from a - called function. This eases the job of function integration. Once the - distinction is no longer needed, they can be considered equivalent. */ - return (REGNO (x) == REGNO (y) - && (! rtx_equal_function_value_matters - || REG_FUNCTION_VALUE_P (x) == REG_FUNCTION_VALUE_P (y))); - else if (code == LABEL_REF) - return XEXP (x, 0) == XEXP (y, 0); - else if (code == SYMBOL_REF) - return XSTR (x, 0) == XSTR (y, 0); - else if (code == SCRATCH || code == CONST_DOUBLE) - return 0; + /* Some RTL can be compared nonrecursively. */ + switch (code) + { + case REG: + /* Until rtl generation is complete, don't consider a reference to the + return register of the current function the same as the return from a + called function. This eases the job of function integration. Once the + distinction is no longer needed, they can be considered equivalent. */ + return (REGNO (x) == REGNO (y) + && (! rtx_equal_function_value_matters + || REG_FUNCTION_VALUE_P (x) == REG_FUNCTION_VALUE_P (y))); + + case LABEL_REF: + return XEXP (x, 0) == XEXP (y, 0); + + case SYMBOL_REF: + return XSTR (x, 0) == XSTR (y, 0); + + case SCRATCH: + case CONST_DOUBLE: + case CONST_INT: + return 0; + + default: + break; + } /* Compare the elements. If any pair of corresponding elements fail to match, return 0 for the whole things. */ |