This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/55876] internal compiler error: in gen_rtx_SUBREG, at emit-rtl.c:776
- From: "vries at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 04 Jan 2013 16:00:07 +0000
- Subject: [Bug target/55876] internal compiler error: in gen_rtx_SUBREG, at emit-rtl.c:776
- Auto-submitted: auto-generated
- References: <bug-55876-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55876
--- Comment #2 from vries at gcc dot gnu.org 2013-01-04 16:00:07 UTC ---
This patch introduces an assert that triggers before rather than during
gen_rtx_SUBREG:
...
Index: optabs.c
===================================================================
--- optabs.c (revision 194898)
+++ optabs.c (working copy)
@@ -330,7 +330,12 @@ widen_operand (rtx op, enum machine_mode
/* If MODE is no wider than a single word, we return a paradoxical
SUBREG. */
if (GET_MODE_SIZE (mode) <= UNITS_PER_WORD)
- return gen_rtx_SUBREG (mode, force_reg (GET_MODE (op), op), 0);
+ {
+ /* Check that the result is a paradoxical subreg (outer mode strictly
+ larger than inner mode. */
+ gcc_assert (GET_MODE_SIZE (mode) > GET_MODE_SIZE (GET_MODE (op)));
+ return gen_rtx_SUBREG (mode, force_reg (GET_MODE (op), op), 0);
+ }
/* Otherwise, get an object of MODE, clobber it, and set the low-order
part to OP. */
...
This assert allows triggers both with -EB and -EL, while the original assert
only triggers with -EB.