[Bug rtl-optimization/14770] redundant store due to the fact that implicit set is not noticed

steven at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Aug 14 19:17:00 GMT 2004


------- Additional Comments From steven at gcc dot gnu dot org  2004-08-14 19:17 -------
gcse only finds implicit sets of the form (cmp (reg) (value)), 
not (cmp (mem) (value)).  That said, we actually do find the 
implicit set since we still have a load to a reg when doing 
gcse.  So we find: 
 
GCSE pass 1 
 
Implicit set of reg 58 in basic block 1 
Found 1 implicit sets 
SET hash table (11 buckets, 1 entries) 
Index 0 (hash value 3) 
  (set (reg/v:SI 58 [ a ]) 
    (const_int 0 [0x0])) 
 
CPROP of bar, pass 1: 1624 bytes needed, 0 const props, 0 copy props 
PRE GCSE of bar, pass 1: 2472 bytes needed, 0 substs, 0 insns created 
CPROP of bar, pass 2: 4096 bytes needed, 0 const props, 0 copy props 
 
;; Processing block from 2 to 24, 6 sets. 
(note 2 0 9 NOTE_INSN_DELETED) 
 
;; Start of basic block 0, registers live: (nil) 
(note 9 2 6 0 [bb 0] NOTE_INSN_BASIC_BLOCK) 
 
(insn 6 9 7 0 (set (reg/v:SI 58 [ a ]) 
        (mem/i:SI (reg/f:SI 16 argp) [2 a+0 S4 A32])) 37 
{*movsi_1_nointernunit} (nil) 
    (nil)) 
 
(note 7 6 12 0 NOTE_INSN_FUNCTION_BEG) 
 
(insn 12 7 13 0 (set (reg:CCZ 17 flags) 
        (compare:CCZ (reg/v:SI 58 [ a ]) 
            (const_int 0 [0x0]))) 0 {*cmpsi_ccno_1} (nil) 
    (nil)) 
 
(jump_insn 13 12 15 0 (set (pc) 
        (if_then_else (ne (reg:CCZ 17 flags) 
                (const_int 0 [0x0])) 
            (label_ref 24) 
            (pc))) 345 {*jcc_1} (nil) 
    (nil)) 
;; End of basic block 0, registers live: 
 (nil) 
 
;; Start of basic block 1, registers live: (nil) 
(note 15 13 17 1 [bb 1] NOTE_INSN_BASIC_BLOCK) 
 
(insn 17 15 18 1 (set (mem:SI (reg/f:SI 16 argp) [0 S4 A32]) 
        (const_int 0 [0x0])) 37 {*movsi_1_nointernunit} (nil) 
    (nil)) 
 
(call_insn/j 18 17 19 1 (call (mem:QI (symbol_ref:SI ("foo") [flags 0x41] 
<function_decl 0x401f3244 foo>) [0 S1 A8]) 
        (const_int 4 [0x4])) -1 (nil) 
    (nil) 
    (nil)) 
;; End of basic block 1, registers live: 
 (nil) 
 
(barrier 19 18 22) 
 
(note 22 19 24 NOTE_INSN_FUNCTION_END) 
 
;; Start of basic block 2, registers live: (nil) 
(code_label 24 22 25 2 1 "" [1 uses]) 
 
(note 25 24 0 2 [bb 2] NOTE_INSN_BASIC_BLOCK) 
;; End of basic block 2, registers live: 
 (nil) 
 
 
We could make a pass that deletes explicit sets when there is 
an implicit set already.  I plan to do some work in the RTL 
const/copyprop dept. so I'll see if I can come up with some 
trickery to get rid of this redundant set in the process. 
 
 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |steven at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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



More information about the Gcc-bugs mailing list