http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46391
Summary: false dependencies are computed after vectorization (#2) Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: roy.1ro...@gmail.com Created attachment 22343 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22343 preprocessed file When compiling function with ia64: int nor(char* __restrict__ c, char* __restrict__ d) { int i, sum = 0; for (i = 0; i < 256; i++) d[i] = c[i]; return sum; } before sched1 we have: (insn 91 329 330 4 (set (mem:V8QI (reg/v/f:DI 435 [ d ]) [0 MEM[(char *)d_43]+0 S8 A64]) (reg:V8QI 430 [ vect_var_?25 ])) a.c:5 384 {*movv8qi_internal} (expr_list:REG_DEAD (reg:V8QI 430 [ vect_var_?25 ]) (nil))) (insn 330 91 253 4 (set (reg/f:DI 450) (plus:DI (reg/v/f:DI 435 [ d ]) (const_int 8 [0x8]))) a.c:5 205 {adddi3} (nil)) (insn 253 330 254 4 (set (reg:V8QI 455 [ vect_var_?25 ]) (mem:V8QI (reg:DI 449) [0 MEM[(char *)D.2084_33]+0 S8 A64])) a.c:5 384 {*movv8qi_internal} (nil)) insn 91 is a store and 253 is a load from a different location (two different restrict pointers). These insns should not have a dependency between them but we can see in sched1 that they do have: ;; ====================================================== ;; -- basic block 4 from 89 to 340 -- before reload ;; ====================================================== ;; --------------- forward dependences: ------------ ;; --- Region Dependences --- b 4 bb 0 ;; insn code bb dep prio cost reservation ;; ---- ---- -- --- ---- ---- ----------- ;; 89 384 4 0 1 1 2_M_only_um01 : 340 321 320 310 299 288 277 266 255 91 ;; 329 205 4 0 3 1 2_A : 340 320 254 253 ;; 91 384 4 1 0 1 2_M_only_um23 : 340 322 321 319 310 308 299 297 288 286 277 275 266 264 255 253 ;; 330 205 4 0 2 1 2_A : 340 322 256 255 ;; 253 384 4 2 1 1 2_M_only_um01 : 340 321 310 299 288 277 266 255 ;; 254 205 4 1 2 1 2_A : 340 264 ;; 255 384 4 4 0 1 2_M_only_um23 : 340 321 319 310 308 299 297 288 286 277 275 266 264 A similar bug was fixed a few months ago (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44479). Might be connected. Using built-in specs. COLLECT_GCC=./xgcc Target: ia64-linux-elf Configured with: Thread model: single gcc version 4.6.0 20101106 (experimental) (GCC) COLLECT_GCC_OPTIONS='-v' '-save-temps' '-O3' '-funroll-loops' '-fdump-rtl-all' '-fsched-verbose=8' cc1 -E -quiet -v -iprefix /home/swproj/sw/users/eyalhar/ia64-new/gcc/../lib/gcc/ia64-linux-elf/4.6.0/ a.c -funroll-loops -fdump-rtl-all -fsched-verbose=8 -O3 -fpch-preprocess -o a.i ignoring nonexistent directory "/home/swproj/sw/users/eyalhar/ia64-new/gcc/../lib/gcc/ia64-linux-elf/4.6.0/include" ignoring nonexistent directory "/home/swproj/sw/users/eyalhar/ia64-new/gcc/../lib/gcc/ia64-linux-elf/4.6.0/include-fixed" ignoring nonexistent directory "/home/swproj/sw/users/eyalhar/ia64-new/gcc/../lib/gcc/ia64-linux-elf/4.6.0/../../../../ia64-linux-elf/sys-include" ignoring nonexistent directory "/home/swproj/sw/users/eyalhar/ia64-new/gcc/../lib/gcc/ia64-linux-elf/4.6.0/../../../../ia64-linux-elf/include" ignoring nonexistent directory "/home/swproj/sw/users/eyalhar/ia64-new/gcc/../lib/gcc/../../lib/gcc/ia64-linux-elf/4.6.0/include" ignoring nonexistent directory "/home/swproj/sw/users/eyalhar/ia64-new/gcc/../lib/gcc/../../lib/gcc/ia64-linux-elf/4.6.0/include-fixed" ignoring nonexistent directory "/home/swproj/sw/users/eyalhar/ia64-new/gcc/../lib/gcc/../../lib/gcc/ia64-linux-elf/4.6.0/../../../../ia64-linux-elf/sys-include" ignoring nonexistent directory "/home/swproj/sw/users/eyalhar/ia64-new/gcc/../lib/gcc/../../lib/gcc/ia64-linux-elf/4.6.0/../../../../ia64-linux-elf/include" #include "..." search starts here: #include <...> search starts here: End of search list. COLLECT_GCC_OPTIONS='-v' '-save-temps' '-O3' '-funroll-loops' '-fdump-rtl-all' '-fsched-verbose=8' cc1 -fpreprocessed a.i -quiet -dumpbase a.c -auxbase a -O3 -version -funroll-loops -fdump-rtl-all -fsched-verbose=8 -o a.s GNU C (GCC) version 4.6.0 20101106 (experimental) (ia64-linux-elf) compiled by GNU C version 4.1.2 20080704 (Red Hat 4.1.2-44), GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1 GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 GNU C (GCC) version 4.6.0 20101106 (experimental) (ia64-linux-elf) compiled by GNU C version 4.1.2 20080704 (Red Hat 4.1.2-44), GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1 GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 Compiler executable checksum: 48128c38ed97d38ae5641e25d3ca761e COLLECT_GCC_OPTIONS='-v' '-save-temps' '-O3' '-funroll-loops' '-fdump-rtl-all' '-fsched-verbose=8' as -N so -o a.o a.s