[Bug rtl-optimization/49982] New: [4.7 Regression] ICE in fixup_args_size_notes, at expr.c:3625

kkojima at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Aug 5 02:32:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49982

           Summary: [4.7 Regression] ICE in fixup_args_size_notes, at
                    expr.c:3625
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: kkojima@gcc.gnu.org
                CC: rth@gcc.gnu.org
            Target: sh-*-*


For sh-elf, gcc.c-torture/compile/20030224-1.c fails at -O0 -m4 with ICE:

internal compiler error: in fixup_args_size_notes, at expr.c:3625

#0  fancy_abort (file=0x88edae8 "../../ORIG/trunk/gcc/expr.c", line=3625, 
    function=0x88ee6af "fixup_args_size_notes")
    at ../../ORIG/trunk/gcc/diagnostic.c:893
#1  0x0828560f in fixup_args_size_notes (prev=0xb7f8e18c, last=0xb7f8e1b0, 
    end_args_size=0) at ../../ORIG/trunk/gcc/expr.c:3625

where prev and last are

(gdb) call debug_rtx(prev)
(insn 183 182 304 6 (clobber (mem:BLK (reg/f:SI 15 r15) [0 A8]))
20030224-1.c:16 -1
     (nil))
(gdb) call debug_rtx(last)
(insn 184 305 185 6 (set (reg/f:SI 15 r15)
        (reg/f:SI 15 r15)) 20030224-1.c:16 176 {movsi_ie}
     (expr_list:REG_ARGS_SIZE (const_int 0 [0])
        (expr_list:REG_DEAD (reg:SI 76 fr12 [260])
            (nil))))

It seems that the latter (set stack_pointer_rtx stack_pointer_rtx)
insn confuses fixup_args_size_notes.  The patch below works for me.

--- ORIG/trunk/gcc/expr.c    2011-08-04 10:13:24.000000000 +0900
+++ trunk/gcc/expr.c    2011-08-04 20:53:14.000000000 +0900
@@ -3628,6 +3628,8 @@ fixup_args_size_notes (rtx prev, rtx las
           && XEXP (SET_SRC (set), 0) == stack_pointer_rtx
           && CONST_INT_P (XEXP (SET_SRC (set), 1)))
         this_delta = INTVAL (XEXP (SET_SRC (set), 1));
+      else if (SET_SRC (set) == stack_pointer_rtx)
+        this_delta = 0;
       else
         saw_unknown = true;
     }



More information about the Gcc-bugs mailing list