public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
@ 2011-05-15 19:01 danglin at gcc dot gnu.org
  2011-05-15 21:31 ` [Bug rtl-optimization/49007] " danglin at gcc dot gnu.org
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-05-15 19:01 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: ICE in extract_true_false_edges_from_block at
                    tree-cfg.c:7379
           Product: gcc
           Version: 4.3.6
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: danglin@gcc.gnu.org
              Host: hppa2.0w-hp-hpux11.11
            Target: hppa2.0w-hp-hpux11.11
             Build: hppa2.0w-hp-hpux11.11


Trunk build fails in stage2 compiling libiberty/regex.c:

make[3]: Entering directory `/test/gnu/gcc/objdir.1/libiberty'
if [ x"-fPIC" != x ] && [ ! -d pic ]; then \
          mkdir pic; \
        else true; fi
touch stamp-picdir
if [ x"-fPIC" != x ]; then \
          /test/gnu/gcc/objdir.1/./prev-gcc/xgcc
-B/test/gnu/gcc/objdir.1/./prev
-gcc/ -B/opt/gnu/gcc/gcc-4.7/hppa2.0w-hp-hpux11.11/bin/
-B/opt/gnu/gcc/gcc-4.7/h
ppa2.0w-hp-hpux11.11/bin/ -B/opt/gnu/gcc/gcc-4.7/hppa2.0w-hp-hpux11.11/lib/
-isy
stem /opt/gnu/gcc/gcc-4.7/hppa2.0w-hp-hpux11.11/include -isystem
/opt/gnu/gcc/gc
c-4.7/hppa2.0w-hp-hpux11.11/sys-include    -c -DHAVE_CONFIG_H -g -O2  -I.
-I../.
./gcc/libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat
-Wstrict-proto
types -pedantic  -fPIC ../../gcc/libiberty/regex.c -o pic/regex.o; \
        else true; fi
../../gcc/libiberty/regex.c: In function 'byte_re_match_2_internal':
../../gcc/libiberty/regex.c:8126:1: internal compiler error: vector
VEC(edge,bas
e) index domain error, in extract_true_false_edges_from_block at
tree-cfg.c:7379
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[3]: *** [regex.o] Error 1

# ./xgcc -B./ -v
Reading specs from ./specs
COLLECT_GCC=./xgcc
COLLECT_LTO_WRAPPER=./lto-wrapper
Target: hppa2.0w-hp-hpux11.11
Configured with: ../gcc/configure --with-gnu-as --with-as=/opt/gnu/bin/as
--enable-shared --with-local-prefix=/opt/gnu --prefix=/opt/gnu/gcc/gcc-4.7
--with-gmp=/opt/gnu/gcc/gcc-4.7 --enable-threads=posix --enable-debug=no
--disable-nls --without-cloog --without-ppl
--enable-languages=c,c++,objc,fortran,java,ada,obj-c++
Thread model: posix
gcc version 4.7.0 20110514 (experimental) [trunk revision 173762] (GCC) 

Bootstrap:
Configured with: ../gcc/configure --with-gnu-as --with-as=/opt/gnu/bin/as
--enab
le-shared --with-local-prefix=/opt/gnu --prefix=/opt/gnu/gcc/gcc-4.3.6
--with-gm
p=/opt/gnu/gcc/gcc-4.3.6 --enable-threads=posix --enable-debug=no --disable-nls 
--enable-checking=release
--enable-languages=c,c++,objc,fortran,java,ada,obj-c++
Thread model: posix
gcc version 4.3.6 20110514 (prerelease) [gcc-4_3-branch revision 173762] (GCC) 

Make command:
make STAGE1_CFLAGS="-g -O1" bootstrap

This is a gcc-4.3 reorg bug since bootstrap does not fail with -O0 or
STAGE1_CFLAGS="-g -O1 -fno-delayed-branch".


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
@ 2011-05-15 21:31 ` danglin at gcc dot gnu.org
  2011-05-15 23:07 ` danglin at gcc dot gnu.org
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-05-15 21:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from John David Anglin <danglin at gcc dot gnu.org> 2011-05-15 21:19:15 UTC ---
The then and else labels are the same for the cond:

Breakpoint 12, 0x00361cb4 in make_edges () at ../../gcc/gcc/tree-cfg.c:801
801      then_bb = label_to_block (then_label);
(gdb) p debug_tree ($r25)
 <label_decl 7ade2630 L.118
    type <void_type 7af39840 void VOID
        align 8 symtab 15 alias set -1 canonical type 7af39840
        pointer_to_this <pointer_type 7af398a0>>
    ignored VOID file  line 0 col 0
    align 1 context <function_decl 7b01c580 byte_re_match_2_internal>>
$22 = void
(gdb) c
Continuing.

Breakpoint 10, 0x00361cb8 in make_edges () at ../../gcc/gcc/tree-cfg.c:801
801      then_bb = label_to_block (then_label);
(gdb) disass 0x00361ca8,0x00361cc8
Dump of assembler code from 0x361ca8 to 0x361cc8:
   0x00361ca8 <make_edges+1040>:    ldo 3c(r24),r24
   0x00361cac <make_edges+1044>:    ldw c(ret0),r5
   0x00361cb0 <make_edges+1048>:    b,l 0x35a548 <label_to_block_fn>,rp
   0x00361cb4 <make_edges+1052>:    ldw 0(r9),r26
=> 0x00361cb8 <make_edges+1056>:    copy ret0,r4
   0x00361cbc <make_edges+1060>:    ldw 0(r9),r26
   0x00361cc0 <make_edges+1064>:    b,l 0x35a548 <label_to_block_fn>,rp
   0x00361cc4 <make_edges+1068>:    copy r5,r25
End of assembler dump.
(gdb) p debug_tree ($r5)          
 <label_decl 7ade2630 L.118
    type <void_type 7af39840 void VOID
        align 8 symtab 15 alias set -1 canonical type 7af39840
        pointer_to_this <pointer_type 7af398a0>>
    ignored VOID file  line 0 col 0
    align 1 context <function_decl 7b01c580 byte_re_match_2_internal>>
$23 = void


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
  2011-05-15 21:31 ` [Bug rtl-optimization/49007] " danglin at gcc dot gnu.org
@ 2011-05-15 23:07 ` danglin at gcc dot gnu.org
  2011-05-16  5:46 ` danglin at gcc dot gnu.org
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-05-15 23:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from John David Anglin <danglin at gcc dot gnu.org> 2011-05-15 22:26:47 UTC ---
Breakpoint 5, make_cond_expr_edges (bb=0x7ac36b40) at
../../gcc/gcc/tree-cfg.c:793
793      gcc_assert (entry);
(gdb) p debug_gimple_stmt ($ret0)
if (regstart != 0B) goto <L118>; else goto <L118>;


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
  2011-05-15 21:31 ` [Bug rtl-optimization/49007] " danglin at gcc dot gnu.org
  2011-05-15 23:07 ` danglin at gcc dot gnu.org
@ 2011-05-16  5:46 ` danglin at gcc dot gnu.org
  2011-05-16 17:34 ` dave at hiauly1 dot hia.nrc.ca
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-05-16  5:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from John David Anglin <danglin at gcc dot gnu.org> 2011-05-16 01:35:28 UTC ---
By trial and error, it appears tree-cfgcleanup.c is miscompiled at -O1
without -fno-delayed-branch.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-05-16  5:46 ` danglin at gcc dot gnu.org
@ 2011-05-16 17:34 ` dave at hiauly1 dot hia.nrc.ca
  2011-05-20 19:56 ` danglin at gcc dot gnu.org
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dave at hiauly1 dot hia.nrc.ca @ 2011-05-16 17:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from dave at hiauly1 dot hia.nrc.ca 2011-05-16 16:22:28 UTC ---
On Mon, 16 May 2011, danglin at gcc dot gnu.org wrote:

> By trial and error, it appears tree-cfgcleanup.c is miscompiled at -O1
> without -fno-delayed-branch.

Attached .i file.

Dave


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-05-16 17:34 ` dave at hiauly1 dot hia.nrc.ca
@ 2011-05-20 19:56 ` danglin at gcc dot gnu.org
  2011-05-21  3:37 ` danglin at gcc dot gnu.org
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-05-20 19:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from John David Anglin <danglin at gcc dot gnu.org> 2011-05-20 19:19:35 UTC ---
This loop in cleanup_tree_cfg_1 is miscompiled:

  /* Start by iterating over all basic blocks.  We cannot use FOR_EACH_BB,
     since the basic blocks may get removed.  */
  n = last_basic_block;
  for (i = NUM_FIXED_BLOCKS; i < n; i++)
    {
      bb = BASIC_BLOCK (i);
      if (bb)
        retval |= cleanup_tree_cfg_bb (bb);
    }

The dbr pass incorrectly optimizes the loop index register $r4
causing the index to increment by two when cleanup_tree_cfg_bb
is called.  As a result, a cleanup is skipped for bb=0x7ac36b40.
This is generated code:

   0x005d5600 <+264>:   ldo 2(r4),ret0
=> 0x005d5604 <+268>:   ldw,s ret0(r26),r26
   0x005d5608 <+272>:   cmpib,= 0,r26,0x5d5624 <cleanup_tree_cfg+300>
   0x005d560c <+276>:   ldo 1(r4),r4
   0x005d5610 <+280>:   b,l 0x5d4018 <cleanup_tree_cfg_bb>,rp
   0x005d5614 <+284>:   nop
   0x005d5618 <+288>:   or ret0,r6,ret0
   0x005d561c <+292>:   extrw,u ret0,31,8,r6
   0x005d5620 <+296>:   ldo 1(r4),r4
   0x005d5624 <+300>:   cmpb,<<,n r4,r5,0x5d55b0 <cleanup_tree_cfg+184>
   0x005d5628 <+304>:   ldw 0(r3),ret0

With -fno-delayed-branch we have instead:

   0x005d58e8 <+288>:   ldo 2(r4),ret0
=> 0x005d58ec <+292>:   ldw,s ret0(r26),r26
   0x005d58f0 <+296>:   cmpib,=,n 0,r26,0x5d5904 <cleanup_tree_cfg+316>
   0x005d58f4 <+300>:   b,l 0x5d4190 <cleanup_tree_cfg_bb>,rp
   0x005d58f8 <+304>:   nop
   0x005d58fc <+308>:   or ret0,r6,ret0
   0x005d5900 <+312>:   extrw,u ret0,31,8,r6
   0x005d5904 <+316>:   ldo 1(r4),r4
   0x005d5908 <+320>:   cmpb,<< r4,r5,0x5d588c <cleanup_tree_cfg+196>
   0x005d590c <+324>:   nop

The barriers dump has:

(insn 95 94 96 ../../gcc/gcc/basic-block.h:194 (set (reg:SI 28 %r28 [143])
        (plus:SI (reg/v:SI 4 %r4 [orig:111 i ] [111])
            (const_int 2 [0x2]))) 111 {addsi3} (nil))

(insn 96 95 97 ../../gcc/gcc/basic-block.h:194 (set (reg/v/f:SI 26 %r26
[orig:110
bb ] [110])
        (mem/s/f/j:SI (plus:SI (mult:SI (reg:SI 28 %r28 [143])
                    (const_int 4 [0x4]))
                (reg/f:SI 26 %r26 [orig:104 iftmp.1903 ] [104])) [0
<variable>.vec
 S4 A32])) 37 {*pa.md:2542} (expr_list:REG_DEAD (reg:SI 28 %r28 [143])
        (nil)))

(jump_insn 97 96 98 ../../gcc/gcc/tree-cfgcleanup.c:698 (set (pc)
        (if_then_else (eq (reg/v/f:SI 26 %r26 [orig:110 bb ] [110])
                (const_int 0 [0x0]))
            (label_ref 105)
            (pc))) 25 {*pa.md:1770} (expr_list:REG_BR_PROB (const_int 2820
[0xb04]
)
        (nil)))

(note 98 97 100 [bb 18] NOTE_INSN_BASIC_BLOCK)

(call_insn 100 98 101 ../../gcc/gcc/tree-cfgcleanup.c:699 (parallel [
            (set (reg:SI 28 %r28)
                (call (mem:SI (symbol_ref/v:SI ("@cleanup_tree_cfg_bb") [flags
0x2
03] <function_decl 7a193b60 cleanup_tree_cfg_bb>) [0 S4 A32])
                    (const_int 16 [0x10])))
            (clobber (reg:SI 1 %r1))
            (clobber (reg:SI 2 %r2))
            (use (const_int 0 [0x0]))
        ]) 212 {call_val_symref} (expr_list:REG_DEAD (reg:SI 26 %r26)
        (expr_list:REG_EH_REGION (const_int 0 [0x0])
            (nil)))
    (expr_list:REG_DEP_TRUE (use (reg:SI 26 %r26))
        (nil)))

(note 101 100 103 NOTE_INSN_DELETED)

(insn 103 101 104 ../../gcc/gcc/tree-cfgcleanup.c:699 (set (reg:SI 28 %r28
[145])
        (ior:SI (reg:SI 28 %r28)
            (reg/v:SI 6 %r6 [orig:109 retval+-3 ] [109]))) 131 {*pa.md:6187}
(expr
_list:REG_DEAD (reg/v:SI 6 %r6 [orig:109 retval+-3 ] [109])
        (nil)))

(insn 104 103 105 ../../gcc/gcc/tree-cfgcleanup.c:699 (set (reg/v:SI 6 %r6
[orig:1
09 retval+-3 ] [109])
        (zero_extend:SI (reg:QI 28 %r28 [orig:145+3 ] [145]))) 83 {*pa.md:5001}
(e
xpr_list:REG_DEAD (reg:QI 28 %r28 [orig:145+3 ] [145])
        (nil)))

(code_label 105 104 106 601 "" [1 uses])

(note 106 105 107 [bb 19] NOTE_INSN_BASIC_BLOCK)

(insn 107 106 109 ../../gcc/gcc/tree-cfgcleanup.c:695 (set (reg/v:SI 4 %r4
[orig:1
11 i ] [111])
        (plus:SI (reg/v:SI 4 %r4 [orig:111 i ] [111])
            (const_int 1 [0x1]))) 111 {addsi3} (nil))

(jump_insn 109 107 369 ../../gcc/gcc/tree-cfgcleanup.c:695 (set (pc)
        (if_then_else (gtu (reg/v:SI 5 %r5 [orig:112 n ] [112])
                (reg/v:SI 4 %r4 [orig:111 i ] [111]))
            (label_ref 108)
            (pc))) 25 {*pa.md:1770} (expr_list:REG_BR_PROB (const_int 9700
[0x25e4
])
        (nil)))

The dbr dump has:

(insn 95 94 435 ../../gcc/gcc/basic-block.h:194 (set (reg:SI 28 %r28 [143])
        (plus:SI (reg/v:SI 4 %r4 [orig:111 i ] [111])
            (const_int 2 [0x2]))) 111 {addsi3} (nil))

(code_label 435 95 96 620 "" [1 uses])

(insn 96 435 467 ../../gcc/gcc/basic-block.h:194 (set (reg/v/f:SI 26 %r26
[orig:11
0 bb ] [110])
        (mem/s/f/j:SI (plus:SI (mult:SI (reg:SI 28 %r28 [143])
                    (const_int 4 [0x4]))
                (reg/f:SI 26 %r26 [orig:104 iftmp.1903 ] [104])) [0
<variable>.vec
 S4 A32])) 37 {*pa.md:2542} (expr_list:REG_DEAD (reg:SI 28 %r28 [143])
        (nil)))

(insn 467 96 98 ../../gcc/gcc/tree-cfgcleanup.c:698 (sequence [
            (jump_insn 97 96 107 ../../gcc/gcc/tree-cfgcleanup.c:698 (set (pc)
                    (if_then_else (eq (reg/v/f:SI 26 %r26 [orig:110 bb ] [110])
                            (const_int 0 [0x0]))
                        (label_ref:SI 466)
                        (pc))) 25 {*pa.md:1770} (expr_list:REG_BR_PRED
(const_int
16 [0x10])
                    (expr_list:REG_BR_PROB (const_int 2820 [0xb04])
                        (nil))))
            (insn/s 107 97 98 (set (reg/v:SI 4 %r4 [orig:111 i ] [111])
                    (plus:SI (reg/v:SI 4 %r4 [orig:111 i ] [111])
                        (const_int 1 [0x1]))) 111 {addsi3} (nil))
        ]) -1 (nil))

(note 98 467 100 [bb 18] NOTE_INSN_BASIC_BLOCK)

(call_insn 100 98 101 ../../gcc/gcc/tree-cfgcleanup.c:699 (parallel [
            (set (reg:SI 28 %r28)
                (call (mem:SI (symbol_ref/v:SI ("@cleanup_tree_cfg_bb") [flags
0x2
03] <function_decl 7a193b60 cleanup_tree_cfg_bb>) [0 S4 A32])
                    (const_int 16 [0x10])))
            (clobber (reg:SI 1 %r1))
            (clobber (reg:SI 2 %r2))
            (use (const_int 0 [0x0]))
        ]) 212 {call_val_symref} (expr_list:REG_DEAD (reg:SI 26 %r26)
        (expr_list:REG_EH_REGION (const_int 0 [0x0])
            (nil)))
    (expr_list:REG_DEP_TRUE (use (reg:SI 26 %r26))
        (nil)))

(note 101 100 103 NOTE_INSN_DELETED)

(insn 103 101 104 ../../gcc/gcc/tree-cfgcleanup.c:699 (set (reg:SI 28 %r28
[145])
        (ior:SI (reg:SI 28 %r28)
            (reg/v:SI 6 %r6 [orig:109 retval+-3 ] [109]))) 131 {*pa.md:6187}
(expr
_list:REG_DEAD (reg/v:SI 6 %r6 [orig:109 retval+-3 ] [109])
        (nil)))

(insn 104 103 106 ../../gcc/gcc/tree-cfgcleanup.c:699 (set (reg/v:SI 6 %r6
[orig:1
09 retval+-3 ] [109])
        (zero_extend:SI (reg:QI 28 %r28 [orig:145+3 ] [145]))) 83 {*pa.md:5001}
(e
xpr_list:REG_DEAD (reg:QI 28 %r28 [orig:145+3 ] [145])
        (nil)))

(note 106 104 107 [bb 19] NOTE_INSN_BASIC_BLOCK)

(insn 107 106 466 ../../gcc/gcc/tree-cfgcleanup.c:695 (set (reg/v:SI 4 %r4
[orig:1
11 i ] [111])
        (plus:SI (reg/v:SI 4 %r4 [orig:111 i ] [111])
            (const_int 1 [0x1]))) 111 {addsi3} (nil))

(code_label 466 107 438 625 "" [1 uses])

(insn 438 466 369 ../../gcc/gcc/tree-cfgcleanup.c:695 (sequence [
            (jump_insn/u 109 466 66 ../../gcc/gcc/tree-cfgcleanup.c:695 (set
(pc)
                    (if_then_else (gtu (reg/v:SI 5 %r5 [orig:112 n ] [112])
                            (reg/v:SI 4 %r4 [orig:111 i ] [111]))
                        (label_ref 108)
                        (pc))) 25 {*pa.md:1770} (expr_list:REG_BR_PRED
(const_int
14 [0xe])
                    (expr_list:REG_BR_PROB (const_int 9700 [0x25e4])
                        (nil))))
            (insn/s 66 109 369 (set (reg/f:SI 28 %r28 [orig:133 cfun ] [133])
                    (mem/f/c/i:SI (reg/f:SI 3 %r3 [217]) [0 cfun+0 S4 A32])) 37
{*
pa.md:2542} (expr_list:REG_EQUIV (mem/f/c/i:SI (reg/f:SI 3 %r3 [217]) [0 cfun+0
S4
 A32])
                    (nil)))
        ]) -1 (nil))


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-05-20 19:56 ` danglin at gcc dot gnu.org
@ 2011-05-21  3:37 ` danglin at gcc dot gnu.org
  2011-05-21  4:17 ` danglin at gcc dot gnu.org
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-05-21  3:37 UTC (permalink / raw)
  To: gcc-bugs

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

John David Anglin <danglin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.05.21 02:50:41
     Ever Confirmed|0                           |1

--- Comment #6 from John David Anglin <danglin at gcc dot gnu.org> 2011-05-21 02:50:41 UTC ---
Confirmed with i686-apple-darwin9 cross to hppa2.0w-hp-hpux11.11: 

Compile command:
./cc1 -fpreprocessed tree-cfgcleanup.i -quiet -dumpbase tree-cfgcleanup.c -da
-auxbase-strip tree-cfgcleanup.o -g -O1 -W -Wall -Wwrite-strings -Wcast-qual
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings
-Wold-style-definition -Wc++-compat -version -fno-common -o tree-cfgcleanup.s


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-05-21  3:37 ` danglin at gcc dot gnu.org
@ 2011-05-21  4:17 ` danglin at gcc dot gnu.org
  2011-05-21  7:16 ` pinskia at gcc dot gnu.org
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-05-21  4:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from John David Anglin <danglin at gcc dot gnu.org> 2011-05-21 03:59:49 UTC ---
Comparing reorg.c from 4.3 versus 4.4, it seems like the problem
may be latent in more recent versions.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2011-05-21  4:17 ` danglin at gcc dot gnu.org
@ 2011-05-21  7:16 ` pinskia at gcc dot gnu.org
  2011-05-21 15:26 ` dave at hiauly1 dot hia.nrc.ca
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-05-21  7:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-05-21 04:51:10 UTC ---
Could this have been fixed by PR 42775 which does not change reorg but rather
free_cfg?


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2011-05-21  7:16 ` pinskia at gcc dot gnu.org
@ 2011-05-21 15:26 ` dave at hiauly1 dot hia.nrc.ca
  2011-05-21 23:23 ` danglin at gcc dot gnu.org
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dave at hiauly1 dot hia.nrc.ca @ 2011-05-21 15:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from dave at hiauly1 dot hia.nrc.ca 2011-05-21 14:57:02 UTC ---
> Could this have been fixed by PR 42775 which does not change reorg but rather
> free_cfg?

No.  I have tried it on hppa2.0w-hp-hpux11.11 and just tried it with
darwin cross.  Eric had mentioned it when I backported the fix for PR
45593.

I'm not sure why the ldo instruction at the branch target isn't deleted
when it is added to the delay slot.

Dave


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2011-05-21 15:26 ` dave at hiauly1 dot hia.nrc.ca
@ 2011-05-21 23:23 ` danglin at gcc dot gnu.org
  2011-05-23  6:52 ` danglin at gcc dot gnu.org
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-05-21 23:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from John David Anglin <danglin at gcc dot gnu.org> 2011-05-21 22:47:34 UTC ---
This PR seems similar to PR rtl-optimization/40710.

It seems opposite_needed is incorrectly calculated after the
first delay slot iteration in fill_slots_from_thread:

    mark_target_live_regs (get_insns (), opposite_thread, &opposite_needed);

Breakpoint 22, fill_slots_from_thread (insn=0x1b98f30, condition=0x1b99fa0,
thread=0x1b981e0, opposite_thread=0x1b98f90, likely=0, thread_if_true=1,
own_thread=0, slots_to_fill=1, pslots_filled=0xbfffee4c, delay_list=0x0) at
../../gcc/gcc/reorg.c:2600
2600      new_thread = thread = try_split (PATTERN (thread), thread, 0);
(gdb) p/x opposite_needed
$69 = {
  memory = 0x1, 
  unch_memory = 0x0, 
  volatil = 0x0, 
  cc = 0x0, 
  regs = {0x440000e8, 0x0, 0x0}
}

Register %r4 is no longer marked as alive, so

(gdb) p debug_rtx (thread)
(insn 107 106 438 ../../gcc/gcc/tree-cfgcleanup.c:695 (set (reg/v:SI 4 %r4
[orig:111 i ] [111])
        (plus:SI (reg/v:SI 4 %r4 [orig:111 i ] [111])
            (const_int 1 [0x1]))) 111 {addsi3} (nil))

is moved from the branch target.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2011-05-21 23:23 ` danglin at gcc dot gnu.org
@ 2011-05-23  6:52 ` danglin at gcc dot gnu.org
  2011-05-23  7:51 ` ebotcazou at gcc dot gnu.org
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-05-23  6:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from John David Anglin <danglin at gcc dot gnu.org> 2011-05-23 02:39:31 UTC ---
It seems to me the following is broken:

   Once we have found a basic block and a corresponding first insn, we can
   accurately compute the live status (by starting at a label following a
   BARRIER, we are immune to actions taken by reload and jump.)  Then we
   scan all insns between that point and our target.  For each CLOBBER (or
   for call-clobbered regs when we pass a CALL_INSN), mark the appropriate
   registers are dead.  For a SET, mark them as live.

In this case, we have at the start of the first search:

Breakpoint 12, mark_target_live_regs (insns=0x1b8a020, target=0x1b98f90,
res=0xbfffeda0) at ../../gcc/gcc/resource.c:975
975          for (insn = start_insn; insn != stop_insn;
(gdb) p debug_rtx_list (start_insn, 12)
(code_label 322 386 91 16 617 "" [1 uses])

(note 91 322 433 [bb 16] NOTE_INSN_BASIC_BLOCK)

(insn 433 91 64 (use (insn/s 92 59 366 (set (reg/v:SI 4 %r4 [orig:111 i ]
[111])
                (const_int 2 [0x2])) 37 {*pa.md:2542} (expr_list:REG_EQUAL
(const_int 2 [0x2])
                (nil)))) -1 (nil))

The actual set for %r4 is in bb 10:

(insn 434 58 366 ../../gcc/gcc/basic-block.h:194 (sequence [
            (jump_insn 59 58 92 ../../gcc/gcc/basic-block.h:194 (set (pc)
                    (if_then_else (gtu (reg:SI 28 %r28 [orig:132
<variable>.base.num ] [132])
                            (const_int 2 [0x2]))
                        (label_ref:SI 322)
                        (pc))) 25 {*pa.md:1770} (expr_list:REG_DEAD (reg:SI 28
%r28 [orig:132 <variable>.base.num ] [132])
                    (expr_list:REG_BR_PROB (const_int 9700 [0x25e4])
                        (nil))))
            (insn/s 92 59 366 (set (reg/v:SI 4 %r4 [orig:111 i ] [111])
                    (const_int 2 [0x2])) 37 {*pa.md:2542} (expr_list:REG_EQUAL
(const_int 2 [0x2])
                    (nil)))
        ]) -1 (nil))

On the next iteration, insn 433 has been deleted but regs_live at
the start of bb 16 is still the same as before:

Breakpoint 12, mark_target_live_regs (insns=0x1b8a020, target=0x1b98f90,
res=0xbfffeda0) at ../../gcc/gcc/resource.c:975
975          for (insn = start_insn; insn != stop_insn;
(gdb) p debug_rtx_list (start_insn, 12)
(note 91 386 465 [bb 16] NOTE_INSN_BASIC_BLOCK)

(code_label 465 91 464 624 "" [1 uses])

(insn 464 465 65 (use (insn/v 64 91 465 ../../gcc/gcc/tree-cfgcleanup.c:697
(set (reg/f:SI 1 %r1 [216])
                (high:SI (symbol_ref:SI ("cfun") [flags 0x240] <var_decl
0xc204e0 cfun>))) 49 {*pa.md:3017} (expr_list:REG_EQUIV (high:SI (symbol_ref:SI
("cfun") [flags 0x240] <var_decl 0xc204e0 cfun>))
                (nil)))) -1 (nil))

(insn 65 464 94 ../../gcc/gcc/tree-cfgcleanup.c:697 (set (reg/f:SI 3 %r3 [217])
        (lo_sum:SI (reg/f:SI 1 %r1 [216])
            (symbol_ref:SI ("cfun") [flags 0x240] <var_decl 0xc204e0 cfun>)))
52 {*pa.md:3097} (expr_list:REG_DEAD (reg/f:SI 1 %r1 [216])
        (nil)))

(note 94 65 95 [bb 17] NOTE_INSN_BASIC_BLOCK)

(insn 95 94 435 ../../gcc/gcc/basic-block.h:194 (set (reg:SI 28 %r28 [143])
        (plus:SI (reg/v:SI 4 %r4 [orig:111 i ] [111])
            (const_int 2 [0x2]))) 111 {addsi3} (nil))

(code_label 435 95 96 620 "" [1 uses])

(insn 96 435 97 ../../gcc/gcc/basic-block.h:194 (set (reg/v/f:SI 26 %r26
[orig:110 bb ] [110])
        (mem/s/f/j:SI (plus:SI (mult:SI (reg:SI 28 %r28 [143])
                    (const_int 4 [0x4]))
                (reg/f:SI 26 %r26 [orig:104 iftmp.1903 ] [104])) [0
<variable>.vec S4 A32])) 37 {*pa.md:2542} (expr_list:REG_DEAD (reg:SI 28 %r28
[143])
        (nil)))

(jump_insn 97 96 98 ../../gcc/gcc/tree-cfgcleanup.c:698 (set (pc)
        (if_then_else (eq (reg/v/f:SI 26 %r26 [orig:110 bb ] [110])
                (const_int 0 [0x0]))
            (label_ref 105)
            (pc))) 25 {*pa.md:1770} (expr_list:REG_BR_PROB (const_int 2820
[0xb04])
        (nil)))

(note 98 97 100 [bb 18] NOTE_INSN_BASIC_BLOCK)

(call_insn 100 98 101 ../../gcc/gcc/tree-cfgcleanup.c:699 (parallel [
            (set (reg:SI 28 %r28)
                (call (mem:SI (symbol_ref/v:SI ("@cleanup_tree_cfg_bb") [flags
0x203] <function_decl 0x1564850 cleanup_tree_cfg_bb>) [0 S4 A32])
                    (const_int 16 [0x10])))
            (clobber (reg:SI 1 %r1))
            (clobber (reg:SI 2 %r2))
            (use (const_int 0 [0x0]))
        ]) 212 {call_val_symref} (expr_list:REG_DEAD (reg:SI 26 %r26)
        (expr_list:REG_EH_REGION (const_int 0 [0x0])
            (nil)))
    (expr_list:REG_DEP_TRUE (use (reg:SI 26 %r26))
        (nil)))

(note 101 100 103 NOTE_INSN_DELETED)

So, %r4 is not marked as alive.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2011-05-23  6:52 ` danglin at gcc dot gnu.org
@ 2011-05-23  7:51 ` ebotcazou at gcc dot gnu.org
  2011-05-23 16:28 ` danglin at gcc dot gnu.org
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2011-05-23  7:51 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot
                   |                            |gnu.org

--- Comment #12 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-05-23 06:44:36 UTC ---
> On the next iteration, insn 433 has been deleted but regs_live at
> the start of bb 16 is still the same as before:

I think that it shouldn't be deleted, see the head comment of update_block.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2011-05-23  7:51 ` ebotcazou at gcc dot gnu.org
@ 2011-05-23 16:28 ` danglin at gcc dot gnu.org
  2011-05-23 16:44 ` danglin at gcc dot gnu.org
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-05-23 16:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from John David Anglin <danglin at gcc dot gnu.org> 2011-05-23 15:57:49 UTC ---
This is how insn 433 is deleted:

Breakpoint 14, delete_insn (insn=0x1ba9c60) at ../../gcc/gcc/cfgrtl.c:110
110      rtx next = NEXT_INSN (insn);
(gdb) bt
#0  delete_insn (insn=0x1ba9c60) at ../../gcc/gcc/cfgrtl.c:110
#1  0x002775b7 in delete_related_insns (insn=0x1ba9c60) at
../../gcc/gcc/jump.c:1137
#2  0x0027789a in delete_related_insns (insn=0x1ba1390) at
../../gcc/gcc/jump.c:1228
#3  0x00277e42 in redirect_jump_2 (jump=0x1ba9cc0, olabel=0x1ba1390,
nlabel=0x1bac660, delete_unused=1, invert=0) at ../../gcc/gcc/jump.c:1430
#4  0x00277cfc in redirect_jump (jump=0x1ba9cc0, nlabel=0x1bac660,
delete_unused=1) at ../../gcc/gcc/jump.c:1391
#5  0x00354b3d in reorg_redirect_jump (jump=0x1ba9cc0, nlabel=0x1bac660) at
../../gcc/gcc/reorg.c:1883
#6  0x003578d4 in relax_delay_slots (first=0x1b8a020) at
../../gcc/gcc/reorg.c:3525
#7  0x003581e1 in dbr_schedule (first=0x1b8a020) at ../../gcc/gcc/reorg.c:3894
#8  0x003589ba in rest_of_handle_delay_slots () at ../../gcc/gcc/reorg.c:4066
#9  0x002e3e22 in execute_one_pass (pass=0x634340) at
../../gcc/gcc/passes.c:1122
#10 0x002e3fd9 in execute_pass_list (pass=0x634340) at
../../gcc/gcc/passes.c:1176
#11 0x002e3ff5 in execute_pass_list (pass=0x633b80) at
../../gcc/gcc/passes.c:1177
#12 0x002e3ff5 in execute_pass_list (pass=0x633b40) at
../../gcc/gcc/passes.c:1177
#13 0x003f6ba7 in tree_rest_of_compilation (fndecl=0x1276ee0) at
../../gcc/gcc/tree-optimize.c:404
#14 0x00533c4c in cgraph_expand_function (node=0x156b280) at
../../gcc/gcc/cgraphunit.c:1166
#15 0x00533e08 in cgraph_expand_all_functions () at
../../gcc/gcc/cgraphunit.c:1229
#16 0x0053445b in cgraph_optimize () at ../../gcc/gcc/cgraphunit.c:1436
#17 0x00015f5f in c_write_global_declarations () at ../../gcc/gcc/c-decl.c:8099
#18 0x003a7942 in compile_file () at ../../gcc/gcc/toplev.c:1055
#19 0x003a9902 in do_compile () at ../../gcc/gcc/toplev.c:2244
#20 0x003a997a in toplev_main (argc=27, argv=0xbffff1c8) at
../../gcc/gcc/toplev.c:2276
#21 0x00081cab in main (argc=27, argv=0xbffff1c8) at ../../gcc/gcc/main.c:35
(gdb) p debug_rtx (insn)
(insn 433 91 64 (use (insn/s 92 59 366 (set (reg/v:SI 4 %r4 [orig:111 i ]
[111])
                (const_int 2 [0x2])) 37 {*pa.md:2542} (expr_list:REG_EQUAL
(const_int 2 [0x2])
                (nil)))) -1 (nil))
$61 = void


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2011-05-23 16:28 ` danglin at gcc dot gnu.org
@ 2011-05-23 16:44 ` danglin at gcc dot gnu.org
  2011-05-23 17:20 ` danglin at gcc dot gnu.org
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-05-23 16:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from John David Anglin <danglin at gcc dot gnu.org> 2011-05-23 15:48:43 UTC ---
Ok, I'll see if I can find out why it's being deleted.  In the first try,
we have the following rtl:

Breakpoint 12, mark_target_live_regs (insns=0x1b8a020, target=0x1b98f90,
res=0xbfffeda0) at ../../gcc/gcc/resource.c:975
975          for (insn = start_insn; insn != stop_insn;
(gdb) p debug_rtx_list (start_insn, 12)
(code_label 322 386 91 16 617 "" [1 uses])

(note 91 322 433 [bb 16] NOTE_INSN_BASIC_BLOCK)

(insn 433 91 64 (use (insn/s 92 59 366 (set (reg/v:SI 4 %r4 [orig:111 i ]
[111])
                (const_int 2 [0x2])) 37 {*pa.md:2542} (expr_list:REG_EQUAL
(const_int 2 [0x2])
                (nil)))) -1 (nil))

(insn 64 433 65 ../../gcc/gcc/tree-cfgcleanup.c:697 (set (reg/f:SI 1 %r1 [216])
        (high:SI (symbol_ref:SI ("cfun") [flags 0x240] <var_decl 0xc204e0
cfun>))) 49 {*pa.md:3017} (expr_list:REG_EQUIV (high:SI (symbol_ref:SI ("cfun")
[flags 0x240] <var_decl 0xc204e0 cfun>))
        (nil)))

(insn 65 64 94 ../../gcc/gcc/tree-cfgcleanup.c:697 (set (reg/f:SI 3 %r3 [217])
        (lo_sum:SI (reg/f:SI 1 %r1 [216])
            (symbol_ref:SI ("cfun") [flags 0x240] <var_decl 0xc204e0 cfun>)))
52 {*pa.md:3097} (expr_list:REG_DEAD (reg/f:SI 1 %r1 [216])
        (nil)))

(note 94 65 95 [bb 17] NOTE_INSN_BASIC_BLOCK)

(insn 95 94 435 ../../gcc/gcc/basic-block.h:194 (set (reg:SI 28 %r28 [143])
        (plus:SI (reg/v:SI 4 %r4 [orig:111 i ] [111])
            (const_int 2 [0x2]))) 111 {addsi3} (nil))

(code_label 435 95 96 620 "" [1 uses])

(insn 96 435 97 ../../gcc/gcc/basic-block.h:194 (set (reg/v/f:SI 26 %r26
[orig:110 bb ] [110])
        (mem/s/f/j:SI (plus:SI (mult:SI (reg:SI 28 %r28 [143])
                    (const_int 4 [0x4]))
                (reg/f:SI 26 %r26 [orig:104 iftmp.1903 ] [104])) [0
<variable>.vec S4 A32])) 37 {*pa.md:2542} (expr_list:REG_DEAD (reg:SI 28 %r28
[143])
        (nil)))

(jump_insn 97 96 98 ../../gcc/gcc/tree-cfgcleanup.c:698 (set (pc)
        (if_then_else (eq (reg/v/f:SI 26 %r26 [orig:110 bb ] [110])
                (const_int 0 [0x0]))
            (label_ref 105)
            (pc))) 25 {*pa.md:1770} (expr_list:REG_BR_PROB (const_int 2820
[0xb04])
        (nil)))

(note 98 97 100 [bb 18] NOTE_INSN_BASIC_BLOCK)

(call_insn 100 98 101 ../../gcc/gcc/tree-cfgcleanup.c:699 (parallel [
            (set (reg:SI 28 %r28)
                (call (mem:SI (symbol_ref/v:SI ("@cleanup_tree_cfg_bb") [flags
0x203] <function_decl 0x1564850 cleanup_tree_cfg_bb>) [0 S4 A32])
                    (const_int 16 [0x10])))
            (clobber (reg:SI 1 %r1))
            (clobber (reg:SI 2 %r2))
            (use (const_int 0 [0x0]))
        ]) 212 {call_val_symref} (expr_list:REG_DEAD (reg:SI 26 %r26)
        (expr_list:REG_EH_REGION (const_int 0 [0x0])
            (nil)))
    (expr_list:REG_DEP_TRUE (use (reg:SI 26 %r26))
        (nil)))

As can be seen, insn 64 is subsequently replaced by a use.  Maybe this causes
the deletion of insn 433.

433 to be deleted


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2011-05-23 16:44 ` danglin at gcc dot gnu.org
@ 2011-05-23 17:20 ` danglin at gcc dot gnu.org
  2011-05-23 17:22 ` danglin at gcc dot gnu.org
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-05-23 17:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from John David Anglin <danglin at gcc dot gnu.org> 2011-05-23 16:53:04 UTC ---
Jump is redirected here:

Breakpoint 17, reorg_redirect_jump (jump=0x1ba9cc0, nlabel=0x1bac660) at
../../gcc/gcc/reorg.c:1882
1882      incr_ticks_for_insn (jump);
(gdb) bt
#0  reorg_redirect_jump (jump=0x1ba9cc0, nlabel=0x1bac660) at
../../gcc/gcc/reorg.c:1882
#1  0x003578d4 in relax_delay_slots (first=0x1b8a020) at
../../gcc/gcc/reorg.c:3525
#2  0x003581e1 in dbr_schedule (first=0x1b8a020) at ../../gcc/gcc/reorg.c:3894
#3  0x003589ba in rest_of_handle_delay_slots () at ../../gcc/gcc/reorg.c:4066
#4  0x002e3e22 in execute_one_pass (pass=0x634340) at
../../gcc/gcc/passes.c:1122
#5  0x002e3fd9 in execute_pass_list (pass=0x634340) at
../../gcc/gcc/passes.c:1176
#6  0x002e3ff5 in execute_pass_list (pass=0x633b80) at
../../gcc/gcc/passes.c:1177
#7  0x002e3ff5 in execute_pass_list (pass=0x633b40) at
../../gcc/gcc/passes.c:1177
#8  0x003f6ba7 in tree_rest_of_compilation (fndecl=0x1276ee0) at
../../gcc/gcc/tree-optimize.c:404
#9  0x00533c4c in cgraph_expand_function (node=0x156b280) at
../../gcc/gcc/cgraphunit.c:1166
#10 0x00533e08 in cgraph_expand_all_functions () at
../../gcc/gcc/cgraphunit.c:1229
#11 0x0053445b in cgraph_optimize () at ../../gcc/gcc/cgraphunit.c:1436
#12 0x00015f5f in c_write_global_declarations () at ../../gcc/gcc/c-decl.c:8099
#13 0x003a7942 in compile_file () at ../../gcc/gcc/toplev.c:1055
#14 0x003a9902 in do_compile () at ../../gcc/gcc/toplev.c:2244
#15 0x003a997a in toplev_main (argc=27, argv=0xbffff1c8) at
../../gcc/gcc/toplev.c:2276
#16 0x00081cab in main (argc=27, argv=0xbffff1c8) at ../../gcc/gcc/main.c:35
(gdb) p debug_rtx (nlabel)
(code_label 465 64 464 624 "" [0 uses])
$72 = void
(gdb) p debug_rtx (jump)  
(jump_insn 59 58 92 ../../gcc/gcc/basic-block.h:194 (set (pc)
        (if_then_else (gtu (reg:SI 28 %r28 [orig:132 <variable>.base.num ]
[132])
                (const_int 2 [0x2]))
            (label_ref:SI 322)
            (pc))) 25 {*pa.md:1770} (expr_list:REG_DEAD (reg:SI 28 %r28
[orig:132 <variable>.base.num ] [132])
        (expr_list:REG_BR_PROB (const_int 9700 [0x25e4])
            (nil))))
$73 = void


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2011-05-23 17:20 ` danglin at gcc dot gnu.org
@ 2011-05-23 17:22 ` danglin at gcc dot gnu.org
  2011-05-23 17:24 ` danglin at gcc dot gnu.org
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-05-23 17:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from John David Anglin <danglin at gcc dot gnu.org> 2011-05-23 16:40:57 UTC ---
The use is deleted because insn 434 has been retargeted from
code_label 322 to code_label 465:

(insn 434 58 366 ../../gcc/gcc/basic-block.h:194 (sequence [
            (jump_insn 59 58 92 ../../gcc/gcc/basic-block.h:194 (set (pc)
                    (if_then_else (gtu (reg:SI 28 %r28 [orig:132
<variable>.base.num ] [132])
                            (const_int 2 [0x2]))
                        (label_ref:SI 465)
                        (pc))) 25 {*pa.md:1770} (expr_list:REG_DEAD (reg:SI 28
%r28 [orig:132 <variable>.base.num ] [132])
                    (expr_list:REG_BR_PROB (const_int 9700 [0x25e4])
                        (nil))))
            (insn/s 92 59 366 (set (reg/v:SI 4 %r4 [orig:111 i ] [111])
                    (const_int 2 [0x2])) 37 {*pa.md:2542} (expr_list:REG_EQUAL
(const_int 2 [0x2])
                    (nil)))
        ]) -1 (nil))

The code_label 322 then has zero uses.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2011-05-23 17:22 ` danglin at gcc dot gnu.org
@ 2011-05-23 17:24 ` danglin at gcc dot gnu.org
  2011-05-23 17:51 ` danglin at gcc dot gnu.org
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-05-23 17:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #18 from John David Anglin <danglin at gcc dot gnu.org> 2011-05-23 16:57:02 UTC ---
So, the problem is here:

             /* Figure out where to emit the special USE insn so we don't
                 later incorrectly compute register live/death info.  */
              rtx tmp = next_active_insn (trial);
              if (tmp == 0)
                tmp = find_end_label ();

              if (tmp)
                {
                  /* Insert the special USE insn and update dataflow info.  */
                  update_block (trial, tmp);

                  /* Now emit a label before the special USE insn, and
                     redirect our jump to the new label.  */
                  target_label = get_label_before (PREV_INSN (tmp));
                  reorg_redirect_jump (delay_insn, target_label);
                  next = insn;
                  continue;
                }

This code fails to handle the case where there already is a use.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (16 preceding siblings ...)
  2011-05-23 17:24 ` danglin at gcc dot gnu.org
@ 2011-05-23 17:51 ` danglin at gcc dot gnu.org
  2011-05-23 18:23 ` ebotcazou at gcc dot gnu.org
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-05-23 17:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from John David Anglin <danglin at gcc dot gnu.org> 2011-05-23 16:18:41 UTC ---
Breakpoint 15, delete_related_insns (insn=0x1ba1390) at
../../gcc/gcc/jump.c:1126
1126      int was_code_label = (LABEL_P (insn));
(gdb) p debug_rtx (insn)
(code_label 322 386 91 16 617 "" [0 uses])
$65 = void
(gdb) p debug_rtx_list (insn, 5)
(code_label 322 386 91 16 617 "" [0 uses])

(note 91 322 433 [bb 16] NOTE_INSN_BASIC_BLOCK)

(insn 433 91 64 (use (insn/s 92 59 366 (set (reg/v:SI 4 %r4 [orig:111 i ]
[111])
                (const_int 2 [0x2])) 37 {*pa.md:2542} (expr_list:REG_EQUAL
(const_int 2 [0x2])
                (nil)))) -1 (nil))

(insn 64 433 465 ../../gcc/gcc/tree-cfgcleanup.c:697 (set (reg/f:SI 1 %r1
[216])
        (high:SI (symbol_ref:SI ("cfun") [flags 0x240] <var_decl 0xc204e0
cfun>))) 49 {*pa.md:3017} (expr_list:REG_EQUIV (high:SI (symbol_ref:SI ("cfun")
[flags 0x240] <var_decl 0xc204e0 cfun>))
        (nil)))

(code_label 465 64 464 624 "" [1 uses])


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (17 preceding siblings ...)
  2011-05-23 17:51 ` danglin at gcc dot gnu.org
@ 2011-05-23 18:23 ` ebotcazou at gcc dot gnu.org
  2011-05-23 19:15 ` dave at hiauly1 dot hia.nrc.ca
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2011-05-23 18:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-05-23 18:00:56 UTC ---
> This code fails to handle the case where there already is a use.

This should have been fixed in 4.5 and above:

        PR rtl-optimization/40086
        * reorg.c (relax_delay_slots): When looking for redundant insn at
        the branch target, use next_real_insn, not next_active_insn.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (18 preceding siblings ...)
  2011-05-23 18:23 ` ebotcazou at gcc dot gnu.org
@ 2011-05-23 19:15 ` dave at hiauly1 dot hia.nrc.ca
  2011-05-23 20:14 ` ebotcazou at gcc dot gnu.org
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dave at hiauly1 dot hia.nrc.ca @ 2011-05-23 19:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #20 from dave at hiauly1 dot hia.nrc.ca 2011-05-23 18:52:27 UTC ---
On Mon, 23 May 2011, ebotcazou at gcc dot gnu.org wrote:

> > This code fails to handle the case where there already is a use.
> 
> This should have been fixed in 4.5 and above:
> 
>         PR rtl-optimization/40086
>         * reorg.c (relax_delay_slots): When looking for redundant insn at
>         the branch target, use next_real_insn, not next_active_insn.

Yes, looks like the fix.  This appears to be a regression given the comment
about using next_real_insn in fill_simple_delay_slots.

Ok to backport this fix after testing to 4.3 and 4.4?  I would also
like to backport this fix

    PR rtl-optimization/42775
    * cfgrtl.c (rest_of_pass_free_cfg): Recompute notes if delay slot
    scheduling is enabled.

Hopefully, this will fix delay branch handling on these branches.

Dave


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (19 preceding siblings ...)
  2011-05-23 19:15 ` dave at hiauly1 dot hia.nrc.ca
@ 2011-05-23 20:14 ` ebotcazou at gcc dot gnu.org
  2011-05-23 23:17 ` danglin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2011-05-23 20:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #21 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-05-23 19:33:36 UTC ---
> Ok to backport this fix after testing to 4.3 and 4.4?  I would also
> like to backport this fix
> 
>     PR rtl-optimization/42775
>     * cfgrtl.c (rest_of_pass_free_cfg): Recompute notes if delay slot
>     scheduling is enabled.
> 
> Hopefully, this will fix delay branch handling on these branches.

OK for everything.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (20 preceding siblings ...)
  2011-05-23 20:14 ` ebotcazou at gcc dot gnu.org
@ 2011-05-23 23:17 ` danglin at gcc dot gnu.org
  2011-05-24 19:10 ` danglin at gcc dot gnu.org
  2011-05-24 19:46 ` danglin at gcc dot gnu.org
  23 siblings, 0 replies; 25+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-05-23 23:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #22 from John David Anglin <danglin at gcc dot gnu.org> 2011-05-23 22:31:59 UTC ---
Author: danglin
Date: Mon May 23 22:31:55 2011
New Revision: 174090

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174090
Log:
    PR rtl-optimization/49007
    Backport from mainline:
    2009-11-30  Hans-Peter Nilsson  <hp@axis.com>

    PR rtl-optimization/40086
    * reorg.c (relax_delay_slots): When looking for redundant insn at
    the branch target, use next_real_insn, not next_active_insn.


Modified:
    branches/gcc-4_4-branch/gcc/ChangeLog
    branches/gcc-4_4-branch/gcc/reorg.c


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (21 preceding siblings ...)
  2011-05-23 23:17 ` danglin at gcc dot gnu.org
@ 2011-05-24 19:10 ` danglin at gcc dot gnu.org
  2011-05-24 19:46 ` danglin at gcc dot gnu.org
  23 siblings, 0 replies; 25+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-05-24 19:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #23 from John David Anglin <danglin at gcc dot gnu.org> 2011-05-24 18:44:38 UTC ---
Author: danglin
Date: Tue May 24 18:44:35 2011
New Revision: 174132

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174132
Log:
    PR rtl-optimization/49007
    Backport from mainline:
    2009-11-30  Hans-Peter Nilsson  <hp@axis.com>

    PR rtl-optimization/40086
    * reorg.c (relax_delay_slots): When looking for redundant insn at
    the branch target, use next_real_insn, not next_active_insn.


Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/reorg.c


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug rtl-optimization/49007] ICE in extract_true_false_edges_from_block at tree-cfg.c:7379
  2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
                   ` (22 preceding siblings ...)
  2011-05-24 19:10 ` danglin at gcc dot gnu.org
@ 2011-05-24 19:46 ` danglin at gcc dot gnu.org
  23 siblings, 0 replies; 25+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-05-24 19:46 UTC (permalink / raw)
  To: gcc-bugs

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

John David Anglin <danglin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #24 from John David Anglin <danglin at gcc dot gnu.org> 2011-05-24 19:08:23 UTC ---
Fixed.


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2011-05-24 19:41 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-15 19:01 [Bug rtl-optimization/49007] New: ICE in extract_true_false_edges_from_block at tree-cfg.c:7379 danglin at gcc dot gnu.org
2011-05-15 21:31 ` [Bug rtl-optimization/49007] " danglin at gcc dot gnu.org
2011-05-15 23:07 ` danglin at gcc dot gnu.org
2011-05-16  5:46 ` danglin at gcc dot gnu.org
2011-05-16 17:34 ` dave at hiauly1 dot hia.nrc.ca
2011-05-20 19:56 ` danglin at gcc dot gnu.org
2011-05-21  3:37 ` danglin at gcc dot gnu.org
2011-05-21  4:17 ` danglin at gcc dot gnu.org
2011-05-21  7:16 ` pinskia at gcc dot gnu.org
2011-05-21 15:26 ` dave at hiauly1 dot hia.nrc.ca
2011-05-21 23:23 ` danglin at gcc dot gnu.org
2011-05-23  6:52 ` danglin at gcc dot gnu.org
2011-05-23  7:51 ` ebotcazou at gcc dot gnu.org
2011-05-23 16:28 ` danglin at gcc dot gnu.org
2011-05-23 16:44 ` danglin at gcc dot gnu.org
2011-05-23 17:20 ` danglin at gcc dot gnu.org
2011-05-23 17:22 ` danglin at gcc dot gnu.org
2011-05-23 17:24 ` danglin at gcc dot gnu.org
2011-05-23 17:51 ` danglin at gcc dot gnu.org
2011-05-23 18:23 ` ebotcazou at gcc dot gnu.org
2011-05-23 19:15 ` dave at hiauly1 dot hia.nrc.ca
2011-05-23 20:14 ` ebotcazou at gcc dot gnu.org
2011-05-23 23:17 ` danglin at gcc dot gnu.org
2011-05-24 19:10 ` danglin at gcc dot gnu.org
2011-05-24 19:46 ` danglin at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).