diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-21 12:03:21 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-21 12:03:21 +0000 |
commit | 6ea7ed3e747841f1484d8fe7539cb0633121b603 (patch) | |
tree | 29e2e609b76c6706d6eade266c76dbbd6faa724a /gcc/cselib.c | |
parent | a44fa5565a54d06b65783cf4ecd5594e63c13ce6 (diff) | |
download | gcc-6ea7ed3e747841f1484d8fe7539cb0633121b603.tar.gz |
2009-10-21 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 153054
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@153056 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cselib.c')
-rw-r--r-- | gcc/cselib.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/gcc/cselib.c b/gcc/cselib.c index 2bf466258f3..aa5f7b022bc 100644 --- a/gcc/cselib.c +++ b/gcc/cselib.c @@ -662,6 +662,19 @@ rtx_equal_for_cselib_p (rtx x, rtx y) return 1; } +/* We need to pass down the mode of constants through the hash table + functions. For that purpose, wrap them in a CONST of the appropriate + mode. */ +static rtx +wrap_constant (enum machine_mode mode, rtx x) +{ + if (!CONST_INT_P (x) && GET_CODE (x) != CONST_FIXED + && (GET_CODE (x) != CONST_DOUBLE || GET_MODE (x) != VOIDmode)) + return x; + gcc_assert (mode != VOIDmode); + return gen_rtx_CONST (mode, x); +} + /* Hash an rtx. Return 0 if we couldn't hash the rtx. For registers and memory locations, we look up their cselib_val structure and return its VALUE element. @@ -1340,21 +1353,9 @@ cselib_expand_value_rtx_1 (rtx orig, struct expand_value_data *evd, default: break; } - if (scopy == NULL_RTX) - { - XEXP (copy, 0) - = gen_rtx_CONST (GET_MODE (XEXP (orig, 0)), XEXP (copy, 0)); - if (dump_file && (dump_flags & TDF_DETAILS)) - fprintf (dump_file, " wrapping const_int result in const to preserve mode %s\n", - GET_MODE_NAME (GET_MODE (XEXP (copy, 0)))); - } scopy = simplify_rtx (copy); if (scopy) - { - if (GET_MODE (copy) != GET_MODE (scopy)) - scopy = wrap_constant (GET_MODE (copy), scopy); - return scopy; - } + return scopy; return copy; } |