public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* REQ_EQUAL and mems hoisted out of loops
@ 2003-03-25 14:02 Alan Modra
  2003-03-25 18:27 ` David Edelsohn
  2003-03-26 10:36 ` Alan Modra
  0 siblings, 2 replies; 5+ messages in thread
From: Alan Modra @ 2003-03-25 14:02 UTC (permalink / raw)
  To: gcc

gcc.c-torture/execute/991202-1.c has been failing at -O2 on
powerpc64-linux for some time.  The following rtl is just before cse2
goes wild.

When cse_insn looks at insn 50, it decides that insn 30 calculates the
same value and simplifies insn 50 down to

(set:DI (reg:DI 138) (reg:DI 127))

Oops, reg 145 has changed in the meantime at insn 41.  From what I can
tell, the REG_EQUAL notes in combination with the fact that the store
to "y" has been moved out of the loop by loop optimization, is the cause
of cse confusion.

So it seems a possible fix would be to delete all REG_EQUAL notes
that mention any mem hoisted out of a loop.  Before I try to do that,
I thought I'd solicit comments on the approach.  Reasonable?


(insn 30 28 31 1 (nil) (set:DI (reg:DI 127)
        (zero_extend:DI (reg/v:SI 145))) -1 (nil)
    (expr_list:REG_EQUAL (zero_extend:DI (mem/f:SI (symbol_ref:DI ("y")) [3 y+0 S4 A32]))
        (nil)))

(insn 31 30 32 1 (nil) (set (reg:SI 128)
        (subreg:SI (reg:DI 127) 4)) -1 (nil)
    (nil))

(insn 32 31 34 1 (nil) (set (reg/v:SI 148)
        (subreg:SI (reg:DI 127) 4)) 300 {*movsi_internal1} (nil)
    (nil))

(insn 34 32 36 1 (nil) (use (symbol_ref:DI ("y"))) -1 (nil)
    (nil))

(insn 36 34 41 1 (nil) (use (symbol_ref:DI ("y"))) -1 (nil)
    (nil))

(insn 41 36 43 1 (nil) (set (reg/v:SI 145)
        (ashift:SI (reg:SI 128)
            (const_int 1 [0x1]))) -1 (nil)
    (expr_list:REG_EQUAL (ashift:SI (reg:SI 128)
            (const_int 1 [0x1]))
        (nil)))

(note 43 41 46 1 NOTE_INSN_LOOP_CONT)

(insn 46 43 48 1 (nil) (use (symbol_ref:DI ("y"))) -1 (nil)
    (nil))

(insn 48 46 50 1 (nil) (use (symbol_ref:DI ("x"))) -1 (nil)
    (nil))

(insn 50 48 51 1 (nil) (set:DI (reg:DI 138)
        (zero_extend:DI (reg/v:SI 145))) -1 (nil)
    (expr_list:REG_EQUAL (zero_extend:DI (mem/f:SI (symbol_ref:DI ("y")) [3 y+0 S4 A32]))
        (nil)))

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-03-27 23:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-25 14:02 REQ_EQUAL and mems hoisted out of loops Alan Modra
2003-03-25 18:27 ` David Edelsohn
2003-03-26 10:36 ` Alan Modra
2003-03-26 17:26   ` Matt Kraai
2003-03-28  2:12   ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).