This is the mail archive of the gcc-patches@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]

Re: cselib: Handle COND_EXEC


> On Wed, 8 Aug 2001, Richard Earnshaw wrote:
> >
> > I'm not convinced by this.  What if the cond-exec has side-effects?
> 
> What do you mean?  The COND_EXEC_TEST?
> 
> 
> Bernd
> 

No, you appear to have turned

	(cond_exec (cond) (something that might have side-effects))

into an if_then_else expression.  These are significantly different if the 
body part really does have side effects -- cond_exec does not perform the 
side effects if the condition fails, but if_then_else does.

Consider

	(cond_exec (cond) (set (reg1) (mem (post_inc (reg2)))))

This is not the same as

	(set (reg1) (if_then_else (cond)
				  (mem (post_inc (reg2)))
				  (reg))

since the latter always performs the post-increment action (it just 
doesn't update reg1).



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