This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Deep CSE bug!


On Fri, 2004-06-18 at 08:20, Roger Sayle wrote:

> My understanding (and working hypothesis) of REG_EQUAL notes is that they
> describe the SET_SRC of a SET instruction, and their interpretation is
> completely independent of the set's target, SET_DEST.
Not really.  A REG_EQUAL note indicates what value the destination
register will have after execution of the execution of the insn
containing the REG_EQUAL note.

> 
> I believe the semantics are (or should be) that given an instruction
> 
> 	(set (foo) (bar))
> 	  (REG_EQUAL  baz)
> 
> that it is the REG_EQUAL note states that at the point this instruction
> is executed "bar" will have the same value as "baz".
Not directly.  The REG_EQUAL note indicates what value "foo" will
have after execution of the instruction.

Now, in reality the expression represented by "bar" must evaluate
to the same value as "baz", even if it has a different looking
RTL structure.


> This also clarifies the expected behaviour when "baz" references "foo".
> The contains of the REQ_EQUAL note are not available after the
> assignment if any component is clobbered by its SET.
I don't think this was ever specified in enough detail.  I believe
the docs say something like "at the end of the insn, but not
anywhere else".  A more precise definition is that the contents of
the REG_EQUAL note are available after the RHS of the insn is
evaluated, but not after assignments to the LHS occur.

Whatever we do, we ought to update the docs to clarify this subtle
detail.

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]