This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RFA: gcc.dg/simd-1.c fix for x86
- From: Joern Rennecke <joern dot rennecke at superh dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 07 Jul 2002 18:50:39 +0100
- Subject: RFA: gcc.dg/simd-1.c fix for x86
- Organization: SuperH UK Ltd.
Bootstrapped and regression tested on i686-pc-linux-gnu.
--
--------------------------
SuperH
2430 Aztec West / Almondsbury / BRISTOL / BS32 4AQ
T:+44 1454 462330
Regression testing on i686-linux-gnu showed an gcc.sg/simd-1.c failure.
A syntax error caused expand_binop to be called to subtract const0_rtx
from a vector. expand_binop doesn't find a direct handler. It sees
a CONST_INT and calls expand_unop to negate that. expand_unop sees
that this is a vector operation and calls expand_vector_unop.
expand_vector_unop doesn't find a vector mode to handle the negation in
as such, so it tries to expand this using sub_optab, which has us back
at square one with expand_binop being asked to subtract const_int 0
from a vector. Hence, cc1 dies from stack overflow due to infinite
recursion.
expand_vector_binop already has code to handle the const0_rtx (by
copying it to a register), but that is only after attempting to
expand using sub_optab.
Sun Jul 7 17:47:56 2002 J"orn Rennecke <joern.rennecke@superh.com>
* optabs.c (expand_vector_unop): Don't expand using sub_optab
if we got the wrong mode.
Index: optabs.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/optabs.c,v
retrieving revision 1.139
diff -p -r1.139 optabs.c
*** optabs.c 3 Jul 2002 09:49:43 -0000 1.139
--- optabs.c 7 Jul 2002 16:47:53 -0000
*************** expand_vector_unop (mode, unoptab, op0,
*** 2069,2075 ****
submode = tmode;
}
/* If there is no negate operation, try doing a subtract from zero. */
! if (unoptab == neg_optab && GET_MODE_CLASS (submode) == MODE_INT)
{
rtx temp;
temp = expand_binop (mode, sub_optab, CONST0_RTX (mode), op0,
--- 2069,2078 ----
submode = tmode;
}
/* If there is no negate operation, try doing a subtract from zero. */
! if (unoptab == neg_optab && GET_MODE_CLASS (submode) == MODE_INT
! /* Avoid infinite recursion when an
! error has left us with the wrong mode. */
! && GET_MODE (op0) == mode)
{
rtx temp;
temp = expand_binop (mode, sub_optab, CONST0_RTX (mode), op0,