Commit 2e676d78 by Bernd Schmidt Committed by Bernd Schmidt

Prevent aborts taking a vector mode subreg of a constant integer

From-SVN: r52467
parent 3d980b9f
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
(handle_vector_size_attribute): Use it to avoid generating a (handle_vector_size_attribute): Use it to avoid generating a
new type node each time we are called. new type node each time we are called.
* combine.c (subst): Avoid trying to make a vector mode subreg of
an integer constant.
(gen_lowpart_for_combine): Likewise.
2002-04-18 Roger Sayle <roger@eyesopen.com> 2002-04-18 Roger Sayle <roger@eyesopen.com>
Jakub Jelinek <jakub@redhat.com> Jakub Jelinek <jakub@redhat.com>
......
...@@ -3538,6 +3538,9 @@ subst (x, from, to, in_dest, unique_copy) ...@@ -3538,6 +3538,9 @@ subst (x, from, to, in_dest, unique_copy)
if (GET_CODE (new) == CONST_INT && GET_CODE (x) == SUBREG) if (GET_CODE (new) == CONST_INT && GET_CODE (x) == SUBREG)
{ {
if (VECTOR_MODE_P (GET_MODE (x)))
return gen_rtx_CLOBBER (VOIDmode, const0_rtx);
x = simplify_subreg (GET_MODE (x), new, x = simplify_subreg (GET_MODE (x), new,
GET_MODE (SUBREG_REG (x)), GET_MODE (SUBREG_REG (x)),
SUBREG_BYTE (x)); SUBREG_BYTE (x));
...@@ -9800,6 +9803,12 @@ gen_lowpart_for_combine (mode, x) ...@@ -9800,6 +9803,12 @@ gen_lowpart_for_combine (mode, x)
|| GET_MODE_SIZE (GET_MODE (x)) == GET_MODE_SIZE (mode))) || GET_MODE_SIZE (GET_MODE (x)) == GET_MODE_SIZE (mode)))
return gen_rtx_CLOBBER (GET_MODE (x), const0_rtx); return gen_rtx_CLOBBER (GET_MODE (x), const0_rtx);
/* simplify_gen_subreg does not know how to handle the case where we try
to convert an integer constant to a vector.
??? We could try to teach it to generate CONST_VECTORs. */
if (GET_MODE (x) == VOIDmode && VECTOR_MODE_P (mode))
return gen_rtx_CLOBBER (GET_MODE (x), const0_rtx);
/* X might be a paradoxical (subreg (mem)). In that case, gen_lowpart /* X might be a paradoxical (subreg (mem)). In that case, gen_lowpart
won't know what to do. So we will strip off the SUBREG here and won't know what to do. So we will strip off the SUBREG here and
process normally. */ process normally. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment