This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/55876] internal compiler error: in gen_rtx_SUBREG, at emit-rtl.c:776


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]