[Bug c/32043] New: Basic block reordering creates two images of bb2,
yakov at emc dot com
gcc-bugzilla@gcc.gnu.org
Tue May 22 16:06:00 GMT 2007
gcc -O2 -v reord-bb.c
Using built-in specs.
Target: powerpc64-suse-linux
Configured with: ../configure --enable-threads=posix --prefix=/usr
--with-local-prefix=/usr/local --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.1.2
--enable-ssp --disable-libssp --disable-libgcj --with-slibdir=/lib
--with-system-zlib --enable-shared --enable-__cxa_atexit
--enable-libstdcxx-allocator=new --program-suffix=-4.1
--enable-version-specific-runtime-libs --without-system-libunwind
--with-cpu=default32 --enable-secureplt --with-long-double-128
--host=powerpc64-suse-linux
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (SUSE Linux)
/usr/lib/gcc/powerpc64-suse-linux/4.1.2/cc1 -quiet -v -D__unix__
-D__gnu_linux__ -D__linux__ -Dunix -D__unix -Dlinux -D__linux -Asystem=linux
-Asystem=unix -Asystem=posix reord-bb.c -msecure-plt -quiet -dumpbase
reord-bb.c -auxbase reord-bb -O2 -version -o /tmp/ccZm74jA.s
ignoring nonexistent directory
"/usr/lib/gcc/powerpc64-suse-linux/4.1.2/../../../../powerpc64-suse-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc/powerpc64-suse-linux/4.1.2/include
/usr/include
End of search list.
GNU C version 4.1.2 20061115 (prerelease) (SUSE Linux) (powerpc64-suse-linux)
compiled by GNU C version 4.1.2 20061115 (prerelease) (SUSE Linux).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 10feb4c411697eb9e5410a2cff730e44
as -a32 -mppc -many -V -Qy -o /tmp/ccmtEC9j.o /tmp/ccZm74jA.s
GNU assembler version 2.17.50.0.5 (powerpc-suse-linux) using BFD version
2.17.50.0.5 20060927 (SUSE Linux)
/tmp/ccZm74jA.s: Assembler messages:
/tmp/ccZm74jA.s:28: Error: symbol `pushAndEnd' is already defined
======================================
void foo (void);
unsigned long bar (void);
static void blah (void);
int main (void)
{
blah ();
return 0;
}
static void blah (void)
{
if (bar() == (1))
{
foo();
}
__asm__ (".globl pushAndEnd");
__asm__ ("pushAndEnd:");
}
;; Function main (main)
try_optimize_cfg iteration 1
try_optimize_cfg iteration 1
STC - round 1
Getting bb 0
Basic block 0 was visited in trace 0
Block 2 can't be copied because its size = 28.
Possible start of next round: 1 (key: -2622)
Basic block 2 was visited in trace 0
STC - round 2
Getting bb 1
Basic block 1 was visited in trace 1
STC - round 3
STC - round 4
Trace 1 (round 1): 0 [10000] 2 [10000]
Trace 2 (round 2): 1 [2622]
Connection: 1 2 exit
Fallthru edge 1->3 redirected to 3
Duplicated bb 2 (created bb 3)
Final order:
0 2 1 3
4 basic blocks, 6 edges.
Basic block 0 prev -1, next 1, loop_depth 0, count 0, freq 10000, maybe hot.
Predecessors: ENTRY [100.0%] (fallthru)
Successors: 2 [73.8%] (can_fallthru) 1 [26.2%] (fallthru,can_fallthru)
Registers live at start: 1 [1] 65 [lr]
Registers live at end: 1 [1]
Basic block 1 prev 0, next 2, loop_depth 0, count 0, freq 2622, maybe hot.
Predecessors: 0 [26.2%] (fallthru,can_fallthru)
Successors: 3 [100.0%] (fallthru,can_fallthru)
Registers live at start: 1 [1]
Registers live at end: 1 [1]
Basic block 2 prev 1, next 3, loop_depth 0, count 0, freq 7378, maybe hot.
Predecessors: 0 [73.8%] (can_fallthru)
Successors: EXIT [100.0%]
Registers live at start: 1 [1]
Registers live at end: 1 [1] 3 [3] 65 [lr]
Basic block 3 prev 2, next -2, loop_depth 0, count 0, freq 2622, maybe hot.
Predecessors: 1 [100.0%] (fallthru,can_fallthru)
Successors: EXIT [100.0%]
Registers live at start: 1 [1]
Registers live at end: 1 [1] 3 [3] 65 [lr]
Emitting label for block 1
Reordered sequence:
0 bb 0 [10000]
1 bb 2 [7378]
2 bb 1 [2622]
3 duplicate of 2 [2622]
try_optimize_cfg iteration 1
Deleted label in block 1.
Merged 2 and 3 without moving.
try_optimize_cfg iteration 2
(note:HI 2 0 6 NOTE_INSN_DELETED)
(note:HI 6 2 9 NOTE_INSN_FUNCTION_BEG)
;; Start of basic block 0, registers live: 1 [1] 65 [lr]
(note:HI 9 6 49 0 [bb 0] NOTE_INSN_BASIC_BLOCK)
(insn/f 49 9 50 0 (parallel [
(set (mem:SI (plus:SI (reg/f:SI 1 1)
(const_int -16 [0xfffffffffffffff0])) [0 S4 A8])
(reg/f:SI 1 1))
(set (reg/f:SI 1 1)
(plus:SI (reg/f:SI 1 1)
(const_int -16 [0xfffffffffffffff0])))
]) 340 {movsi_update} (nil)
(expr_list:REG_FRAME_RELATED_EXPR (set (reg/f:SI 1 1)
(plus:SI (reg/f:SI 1 1)
(const_int -16 [0xfffffffffffffff0])))
(nil)))
(insn/f 50 49 51 0 (set (reg:SI 0 0)
(reg:SI 65 lr)) 290 {*movsi_internal1} (nil)
(expr_list:REG_DEAD (reg:SI 65 lr)
(nil)))
(insn/f 51 50 52 0 (set (mem:SI (plus:SI (reg/f:SI 1 1)
(const_int 20 [0x14])) [0 S4 A8])
(reg:SI 0 0)) 290 {*movsi_internal1} (nil)
(expr_list:REG_DEAD (reg:SI 0 0)
(expr_list:REG_FRAME_RELATED_EXPR (set (mem:SI (plus:SI (reg/f:SI 1 1)
(const_int 20 [0x14])) [0 S4 A8])
(reg:SI 0 0))
(nil))))
(note 52 51 12 0 NOTE_INSN_PROLOGUE_END)
(note:HI 12 52 11 0 NOTE_INSN_DELETED)
(call_insn:HI 11 12 13 0 (parallel [
(set (reg:SI 3 3)
(call (mem:SI (symbol_ref:SI ("bar") [flags 0x41]
<function_decl 0xf7f32e00 bar>) [0 S4 A8])
(const_int 0 [0x0])))
(use (const_int 0 [0x0]))
(clobber (reg:SI 65 lr))
]) 403 {*call_value_nonlocal_sysv} (nil)
(expr_list:REG_UNUSED (reg:SI 65 lr)
(nil))
(nil))
(insn:HI 13 11 14 0 (set (reg:CC 75 7 [121])
(compare:CC (reg:SI 3 3)
(const_int 1 [0x1]))) 419 {*cmpsi_internal1}
(insn_list:REG_DEP_TRUE 11 (nil))
(expr_list:REG_DEAD (reg:SI 3 3)
(nil)))
(jump_insn:HI 14 13 20 0 (set (pc)
(if_then_else (eq (reg:CC 75 7 [121])
(const_int 0 [0x0]))
(label_ref:SI 73)
(pc))) 507 {*rs6000.md:12979} (insn_list:REG_DEP_TRUE 13
(insn_list:REG_DEP_ANTI 11 (nil)))
(expr_list:REG_DEAD (reg:CC 75 7 [121])
(expr_list:REG_BR_PROB (const_int 2622 [0xa3e])
(nil))))
;; End of basic block 0, registers live:
1 [1]
;; Start of basic block 1, registers live: 1 [1]
(note:HI 20 14 28 1 [bb 1] NOTE_INSN_BASIC_BLOCK)
(note:HI 28 20 22 1 NOTE_INSN_FUNCTION_END)
(insn:HI 22 28 24 1 (asm_input/v (".globl pushAndEnd")) -1
(insn_list:REG_DEP_ANTI 14 (insn_list:REG_DEP_TRUE 13 (insn_list:REG_DEP_TRUE
18 (insn_list:REG_DEP_TRUE 11 (nil)))))
(nil))
(insn:HI 24 22 31 1 (asm_input/v ("pushAndEnd:")) -1 (insn_list:REG_DEP_TRUE 22
(nil))
(nil))
(insn:HI 31 24 37 1 (set (reg/i:SI 3 3 [ <result> ])
(const_int 0 [0x0])) 290 {*movsi_internal1} (insn_list:REG_DEP_OUTPUT
24 (nil))
(nil))
(insn 37 31 53 1 (use (reg/i:SI 3 3 [ <result> ])) -1 (insn_list:REG_DEP_ANTI
22 (insn_list:REG_DEP_ANTI 24 (insn_list:REG_DEP_TRUE 31 (nil))))
(nil))
(note 53 37 54 1 NOTE_INSN_EPILOGUE_BEG)
(insn 54 53 55 1 (set (reg:SI 0 0)
(mem:SI (plus:SI (reg/f:SI 1 1)
(const_int 20 [0x14])) [1 S4 A8])) 290 {*movsi_internal1} (nil)
(nil))
(insn 55 54 56 1 (set (reg:SI 65 lr)
(reg:SI 0 0)) 290 {*movsi_internal1} (nil)
(expr_list:REG_DEAD (reg:SI 0 0)
(nil)))
(insn 56 55 57 1 (set (reg/f:SI 1 1)
(plus:SI (reg/f:SI 1 1)
(const_int 16 [0x10]))) 48 {*addsi3_internal1} (nil)
(nil))
(jump_insn 57 56 58 1 (parallel [
(return)
(use (reg:SI 65 lr))
]) 542 {*return_internal_si} (nil)
(nil))
;; End of basic block 1, registers live:
1 [1] 3 [3] 65 [lr]
(barrier 58 57 73)
;; Start of basic block 2, registers live: 1 [1]
(code_label 73 58 16 2 6 "" [1 uses])
(note:HI 16 73 18 2 [bb 2] NOTE_INSN_BASIC_BLOCK)
(call_insn:HI 18 16 62 2 (parallel [
(call (mem:SI (symbol_ref:SI ("foo") [flags 0x41] <function_decl
0xf7f32d00 foo>) [0 S4 A8])
(const_int 0 [0x0]))
(use (const_int 0 [0x0]))
(clobber (reg:SI 65 lr))
]) 401 {*call_nonlocal_sysv} (insn_list:REG_DEP_ANTI 13
(insn_list:REG_DEP_ANTI 11 (insn_list:REG_DEP_ANTI 14 (nil))))
(expr_list:REG_UNUSED (reg:SI 65 lr)
(nil))
(nil))
(insn 62 18 63 2 (asm_input/v (".globl pushAndEnd")) -1 (nil)
(nil))
(insn 63 62 64 2 (asm_input/v ("pushAndEnd:")) -1 (nil)
(nil))
(insn 64 63 65 2 (set (reg/i:SI 3 3 [ <result> ])
(const_int 0 [0x0])) 290 {*movsi_internal1} (nil)
(nil))
(insn 65 64 66 2 (use (reg/i:SI 3 3 [ <result> ])) -1 (nil)
(nil))
(insn 66 65 67 2 (set (reg:SI 0 0)
(mem:SI (plus:SI (reg/f:SI 1 1)
(const_int 20 [0x14])) [1 S4 A8])) 290 {*movsi_internal1} (nil)
(nil))
(insn 67 66 68 2 (set (reg:SI 65 lr)
(reg:SI 0 0)) 290 {*movsi_internal1} (nil)
(expr_list:REG_DEAD (reg:SI 0 0)
(nil)))
(insn 68 67 69 2 (set (reg/f:SI 1 1)
(plus:SI (reg/f:SI 1 1)
(const_int 16 [0x10]))) 48 {*addsi3_internal1} (nil)
(nil))
(jump_insn 69 68 72 2 (parallel [
(return)
(use (reg:SI 65 lr))
]) 542 {*return_internal_si} (nil)
(nil))
;; End of basic block 2, registers live:
1 [1] 3 [3] 65 [lr]
(barrier 72 69 47)
(note 47 72 48 1 NOTE_INSN_DELETED)
(note 48 47 0 NOTE_INSN_DELETED)
--
Summary: Basic block reordering creates two images of bb2,
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: yakov at emc dot com
GCC build triplet: gcc version 4.1.2 20061115 (prerelease) (SUSE Linux)
Configured
GCC host triplet: Linux 2.6.18.8-0.3-ppc64 #1 SMP Tue Apr 17 08:42:35 UTC
2007 ppc
GCC target triplet: powerpc64-suse-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32043
More information about the Gcc-bugs
mailing list