https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118103

--- Comment #5 from Li Pan <pan2.li at intel dot com> ---
bisect late-combine2 results in some invalid combine here for main function.

(insn 40 5 41 2 (set (reg:SI 11 a1 [151])
  (reg:SI 69 frm)) "pr118103-simple.c":67:15 2712 {frrmsi}
  (nil))

(insn 41 40 7 2 (set (reg:SI 69 frm)
  (const_int 2 [0x2])) "pr118103-simple.c":69:8 2710 {fsrmsi_restore}
  (nil))

(insn 42 10 11 2 (set (reg:SI 69 frm)
  (reg:SI 11 a1 [151])) "pr118103-simple.c":70:8 2710 {fsrmsi_restore}
    (nil))

trying to combine definition of r11 in:                                        
                                                                               
                                                                               
                                40: a1:SI=frm:SI                               
                                                                               
                                                                               
                                                          into:                
                                                                               
                                                                               
                                                                               
          42: frm:SI=a1:SI                                                     
                                                                               
                                                                               
                                    instruction becomes a no-op:               
                                                                               
                                                                               
                                                                 (set (reg:SI
69 frm)                                                                        
                                                                               
                                                                               
                    (reg:SI 69 frm))                                           
                                                                               
                                                                               
                                             original cost = 4 + 4 (weighted:
8.000000), replacement cost = 2147483647; keeping replacement
rescanning insn with uid = 42.
updating insn 42 in-place
verify found no changes in insn with uid = 42.
deleting insn 40

deleting insn with uid = 40

But when the same code in another function instead of main, we will have 

trying to combine definition of r12 in:
   18: a2:SI=frm:SI
into:
   20: frm:SI=a2:SI
-- cannot satisfy all definitions and uses in insn 20

Reply via email to