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]
Other format: [Raw text]

Re: DSE calls to builtins (memset, etc)


On Wed, 20 Aug 2014, Marc Glisse wrote:

On Wed, 20 Aug 2014, Richard Biener wrote:

On Wed, Aug 20, 2014 at 9:14 AM, Marc Glisse <marc.glisse@inria.fr> wrote:
Hello,

here is a new version of the patch which passed bootstrap+testsuite. I am
still removing the ref_maybe_used_by_stmt_p test, see the previous message
for a discussion.

Looks good to me.  I'm still nervous about removing that check (though
the description looks odd - if the stmt kills the lhs and it also uses
it then if this is not an exact overlap it's undefined

I hadn't realized that. Note that this looks true if the reference is the lhs of an assignment, but it can be wrong if the reference was computed from a call:

memset(p,x,5);
memmove(p+2,p,42);

Obviously I swapped p and p+2...

memmove would kill memset, except that...

and if it is then the stmt is still dead...).

use_stmt would be dead in that case, not stmt.

stmt:		a = 42;
use_stmt:	a = a;

So - ok if it bootstraps/tests ok.

--
Marc Glisse


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