This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: cselib: Handle COND_EXEC
- To: Bernd Schmidt <bernds at redhat dot com>
- Subject: Re: cselib: Handle COND_EXEC
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Wed, 08 Aug 2001 11:23:38 +0100
- cc: Richard dot Earnshaw at arm dot com, gcc-patches at gcc dot gnu dot org
- Organization: ARM Ltd.
- Reply-To: Richard dot Earnshaw at arm dot com
> 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).