diff options
author | Jakub Jelinek <jakub@redhat.com> | 2018-04-10 17:31:57 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-04-10 17:31:57 +0200 |
commit | e0cf12bab54f45840d9af4ed573a2e6aee4b448f (patch) | |
tree | bcae03e70c5920c8e845d53b7cab32e268135c9b /gcc/combine.c | |
parent | efbf619bab726bad8d69c8d765cc2e6cba3d9fc3 (diff) | |
download | gcc-e0cf12bab54f45840d9af4ed573a2e6aee4b448f.zip gcc-e0cf12bab54f45840d9af4ed573a2e6aee4b448f.tar.gz gcc-e0cf12bab54f45840d9af4ed573a2e6aee4b448f.tar.bz2 |
re PR rtl-optimization/85300 (ICE in exact_int_to_float_conversion_p, at simplify-rtx.c:895)
PR rtl-optimization/85300
* combine.c (subst): Handle subst of CONST_SCALAR_INT_P new_rtx also
into FLOAT and UNSIGNED_FLOAT like ZERO_EXTEND, return a CLOBBER if
simplify_unary_operation fails.
* gcc.dg/pr85300.c: New test.
From-SVN: r259285
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index ff672ad..3ad050f 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -5575,11 +5575,15 @@ subst (rtx x, rtx from, rtx to, int in_dest, int in_cond, int unique_copy) x = gen_rtx_CLOBBER (mode, const0_rtx); } else if (CONST_SCALAR_INT_P (new_rtx) - && GET_CODE (x) == ZERO_EXTEND) + && (GET_CODE (x) == ZERO_EXTEND + || GET_CODE (x) == FLOAT + || GET_CODE (x) == UNSIGNED_FLOAT)) { - x = simplify_unary_operation (ZERO_EXTEND, GET_MODE (x), - new_rtx, GET_MODE (XEXP (x, 0))); - gcc_assert (x); + x = simplify_unary_operation (GET_CODE (x), GET_MODE (x), + new_rtx, + GET_MODE (XEXP (x, 0))); + if (!x) + return gen_rtx_CLOBBER (VOIDmode, const0_rtx); } else SUBST (XEXP (x, i), new_rtx); |