[Bug target/53975] [ia64] Target register of a speculative load moved to a branch register prior to the chk.s instruction
steven at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jul 18 23:13:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53975
--- Comment #8 from Steven Bosscher <steven at gcc dot gnu.org> 2012-07-18 23:13:32 UTC ---
Created attachment 27827
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27827
Somewhat reduced, preprocessed test case
Fails with a cross-compiler from x86_64 to ia64 with trunk r189633. Compile
with: "-O3 -ffreestanding -fno-builtin -std=gnu99 -fno-unwind-tables
-mfixed-range=f32-f127 -mno-pic -mno-sdata t.c -dAP -fdump-rtl-all".
Everything looks ok up to machine-reorg. The .218r.compgotos dump has:
(insn 2105 2104 2106 118 (set (reg:DI 122 r71)
(mem/f:DI (reg/f:DI 34 r37 [1005]) [3 ps_90(D)->data+0 S8 A64])) t.c:95
6 {movdi_internal}
(nil))
(insn 2106 2105 2107 118 (set (reg:DI 14 r14)
(mem/f:DI (reg/v/f:DI 113 r33 [orig:610 ps ] [610]) [3
ps_90(D)->str_write+0 S8 A64])) t.c:95 6 {movdi_internal}
(nil))
(insn 2107 2106 2108 118 (set (reg:DI 326 b6)
(reg:DI 14 r14)) t.c:95 6 {movdi_internal}
(expr_list:REG_DEAD (reg:DI 14 r14)
(nil)))
But the .220r.mach dump has:
deleting insn with uid = 2106.
scanning new insn with uid = 3366.
...
(insn 3366 3398 3365 117 (set (reg:DI 14 r14)
(unspec:DI [
(mem/f:DI (reg/v/f:DI 113 r33 [orig:610 ps ] [610]) [3
ps_90(D)->str_write+0 S8 A64])
] UNSPEC_LDS)) 23 {movdi_speculative}
(nil))
(insn 3365 3366 2104 117 (set (reg:DI 122 r71)
(unspec:DI [
(mem/f:DI (reg/f:DI 34 r37 [1005]) [3 ps_90(D)->data+0 S8 A64])
] UNSPEC_LDS)) 23 {movdi_speculative}
(nil))
...
(insn 2107 892 893 117 (set (reg:DI 326 b6)
(reg:DI 14 r14)) t.c:95 6 {movdi_internal}
(expr_list:REG_DEAD (reg:DI 14 r14)
(nil)))
...
(jump_insn:TI 3374 3410 3409 137 (set (pc)
(if_then_else (ne (unspec [
(reg:DI 14 r14)
] UNSPEC_CHKS)
(const_int 0 [0]))
(pc)
(label_ref 3369))) t.c:95 101 {speculation_check_di}
(nil)
-> 3369)
This is done by the selective scheduler.
(Work-around: -fno-fselective-scheduling -fno-fselective-scheduling2)
More information about the Gcc-bugs
mailing list