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 middle-end/48441] [4.7 Regression] ICE in mark_oprs_set


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

--- Comment #6 from Steven Bosscher <steven at gcc dot gnu.org> 2011-04-05 05:54:08 UTC ---
Not really. I meant:

Breakpoint 3, mark_oprs_set (insn=0x7ffff6edc140) at
../../trunk/gcc/cprop.c:538
538       struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
(gdb) p debug_rtx(insn)
(jump_insn 171 170 248 31 (set (pc)
        (if_then_else (eq (reg/v:SI 158 [ rval ])
                (const_int 7 [0x7]))
            (label_ref:SI 248)
            (pc))) ../../gcc/libcpp/charset.c:481 25 {*pa.md:1330}
     (expr_list:REG_BR_PROB (const_int 9550 [0x254e])
        (nil))
 -> 248)
$12 = void
(gdb) p insn_info
$14 = (struct df_insn_info *) 0x14ca078
(gdb) call df_insn_debug(insn,false,stderr)
insn 171 luid 0 defs { } uses { u226(158)} eq uses { } mws 
(gdb) cont
Continuing.

Breakpoint 3, mark_oprs_set (insn=0x7ffff6edc140) at
../../trunk/gcc/cprop.c:538
538       struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
(gdb) p debug_rtx(insn)
(jump_insn/v 171 170 257 29 (set (pc)
        (if_then_else (eq (reg/v:SI 158 [ rval ])
                (const_int 7 [0x7]))
            (label_ref:SI 257)
            (pc))) ../../gcc/libcpp/charset.c:481 25 {*pa.md:1330}
     (expr_list:REG_BR_PROB (const_int 9550 [0x254e])
        (nil))
 -> 257)
$13 = void
(gdb) p insn_info
$15 = (struct df_insn_info *) 0x0
(gdb) # So the insn is not even known anymore in DF
(gdb) call df_insn_debug(insn,false,stderr)

Program received signal SIGSEGV, Segmentation fault.
0x000000000063d9cb in df_insn_uid_debug (uid=171, follow_chain=0 '\0',
file=0x7ffff7bd8860) at ../../trunk/gcc/df-core.c:2113
2113      fprintf (file, "insn %d luid %d",
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on"
Evaluation of the expression containing the function (df_insn_debug) will be
abandoned.
(gdb) 
eq uses { } mws


The problem here is that INSN has been deleted (its INSN_DELETED_P flag is set)
and the basic block referencing it is empty:
(gdb) p debug_bb_n(29)
;; basic block 29, loop depth 1, count 0
;; prev block 28, next block 39
;; pred:       27
;; succ:       30 [100.0%]  (fallthru)
;; bb 29 artificial_defs: { }
;; bb 29 artificial_uses: { u223(3){ }u224(30){ }u225(89){ }}
;; lr  in        3 [%r3] 30 [%r30] 89 [sfp] 96 158 196 197 198 199
;; lr  use       3 [%r3] 30 [%r30] 89 [sfp] 158
;; lr  def 
;; live  in      3 [%r3] 30 [%r30] 89 [sfp] 96 158 196 197 198 199
;; live  gen    
;; live  kill   

(code_label 169 19 170 29 211 "" [1 uses])
(note 170 169 257 29 [bb 29] NOTE_INSN_BASIC_BLOCK)
;; lr  out       3 [%r3] 30 [%r30] 89 [sfp] 96 158 196 197 198 199
;; live  out     3 [%r3] 30 [%r30] 89 [sfp] 96 158 196 197 198 199


Could you please try if this patch restores bootstrap for you?

Index: cprop.c
===================================================================
--- cprop.c    (revision 171948)
+++ cprop.c    (working copy)
@@ -1797,8 +1797,8 @@ one_cprop_pass (void)
         /* Keep track of everything modified by this insn.  */
         /* ??? Need to be careful w.r.t. mods done to INSN.
                Don't call mark_oprs_set if we turned the
-               insn into a NOTE.  */
-        if (! NOTE_P (insn))
+               insn into a NOTE, or deleted the insn.  */
+        if (! NOTE_P (insn) && ! INSN_DELETED_P (insn))
           mark_oprs_set (insn);
           }
     }


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