This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix ICE in simplify_immed_subreg on SPU
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 15 Jun 2008 17:46:54 +0200 (CEST)
- Subject: [PATCH] Fix ICE in simplify_immed_subreg on SPU
Hello,
the test cases for PR 34856 ICE on SPU because simplify_subreg is
called on a CONST_VECTOR RTX of the form:
(const_vector:V4SI [
(const:SI (plus:SI (symbol_ref:SI ("g") [flags 0x40] <var_decl 0xf70b05a0 g>)
(const_int 32 [0x20])))
(const_int 0 [0x0])
(const_int 0 [0x0])
(const_int 0 [0x0])
])
and everything but CONST_INT, CONST_DOUBLE or CONST_FIXED within
a CONST_VECTOR leads to an ICE in simplify_immed_subreg.
It seems to me that having an address constant like the above appear
within a CONST_VECTOR should be OK -- it just cannot be simplified
by simplify_immed_subreg so that function should return NULL_RTX.
The patch below implements this. Tested on spu-elf with no regressions,
fixing the following test suite FAILs:
FAIL: gcc.c-torture/compile/pr34856.c -O2 (internal compiler error)
FAIL: gcc.c-torture/compile/pr34856.c -O2 (test for excess errors)
FAIL: gcc.c-torture/compile/pr34856.c -O3 -fomit-frame-pointer (internal compiler error)
FAIL: gcc.c-torture/compile/pr34856.c -O3 -fomit-frame-pointer (test for excess errors)
FAIL: gcc.c-torture/compile/pr34856.c -O3 -fomit-frame-pointer -funroll-loops (internal compiler error)
FAIL: gcc.c-torture/compile/pr34856.c -O3 -fomit-frame-pointer -funroll-loops (test for excess errors)
FAIL: gcc.c-torture/compile/pr34856.c -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions (internal compiler error)
FAIL: gcc.c-torture/compile/pr34856.c -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions (test for excess errors)
FAIL: gcc.c-torture/compile/pr34856.c -O3 -g (internal compiler error)
FAIL: gcc.c-torture/compile/pr34856.c -O3 -g (test for excess errors)
FAIL: gcc.c-torture/compile/pr34856.c -Os (internal compiler error)
FAIL: gcc.c-torture/compile/pr34856.c -Os (test for excess errors)
FAIL: gcc.dg/pr34856.c (internal compiler error)
FAIL: gcc.dg/pr34856.c (test for excess errors)
OK for mainline and 4.3 branch?
Bye,
Ulrich
ChangeLog:
* simplify-rtx.c (simplify_immed_subreg): Do not ICE when seeing
a CONST_VECTOR with an address constant as element.
Index: gcc/simplify-rtx.c
===================================================================
*** gcc/simplify-rtx.c (revision 136680)
--- gcc/simplify-rtx.c (working copy)
*************** simplify_immed_subreg (enum machine_mode
*** 4792,4798 ****
*vp++ = 0;
}
break;
!
default:
gcc_unreachable ();
}
--- 4792,4804 ----
*vp++ = 0;
}
break;
!
! case CONST:
! case SYMBOL_REF:
! case LABEL_REF:
! /* We cannot decompose an address constant. */
! return NULL_RTX;
!
default:
gcc_unreachable ();
}
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com