Re: [PATCH] Fix PR 54494, removal of volatile store in strlen optimization because of the inlininer

2012-09-06 Thread Jakub Jelinek
On Wed, Sep 05, 2012 at 09:10:53PM -0700, Andrew Pinski wrote: The inlininer likes to recreate some MEM_REF, it copies most of the bits (TREE_THIS_NOTRAP, TREE_THIS_VOLATILE, etc.) but forgets about TREE_SIDE_EFFECTS. This causes the strlen optimization to think the memory store does not

Re: [PATCH] Fix PR 54494, removal of volatile store in strlen optimization because of the inlininer

2012-09-06 Thread Andrew Pinski
On Thu, Sep 6, 2012 at 12:07 AM, Jakub Jelinek ja...@redhat.com wrote: On Wed, Sep 05, 2012 at 09:10:53PM -0700, Andrew Pinski wrote: The inlininer likes to recreate some MEM_REF, it copies most of the bits (TREE_THIS_NOTRAP, TREE_THIS_VOLATILE, etc.) but forgets about TREE_SIDE_EFFECTS.

Re: [PATCH] Fix PR 54494, removal of volatile store in strlen optimization because of the inlininer

2012-09-06 Thread Jakub Jelinek
On Thu, Sep 06, 2012 at 12:50:44AM -0700, Andrew Pinski wrote: Patch preapproved, but you've attached a different patch. Sorry about that. Here is the correct one. Also is this ok for the 4.7 branch? Yes, thanks. --- tree-inline.c (revision 191004) +++ tree-inline.c (working

[PATCH] Fix PR 54494, removal of volatile store in strlen optimization

2012-09-05 Thread Andrew Pinski
Hi, The problem here is the strlen optimization tries to remove a null character store as we already have done it but it does it for a volatile store which is not a valid thing to do. This patch fixes the problem by ignoring statements which have volatile operands. OK? Bootstrapped and tested

Re: [PATCH] Fix PR 54494, removal of volatile store in strlen optimization

2012-09-05 Thread Jakub Jelinek
On Wed, Sep 05, 2012 at 02:10:03PM -0700, Andrew Pinski wrote: The problem here is the strlen optimization tries to remove a null character store as we already have done it but it does it for a volatile store which is not a valid thing to do. This patch fixes the problem by ignoring

Re: [PATCH] Fix PR 54494, removal of volatile store in strlen optimization

2012-09-05 Thread Andrew Pinski
On Wed, Sep 5, 2012 at 2:36 PM, Jakub Jelinek ja...@redhat.com wrote: On Wed, Sep 05, 2012 at 02:10:03PM -0700, Andrew Pinski wrote: The problem here is the strlen optimization tries to remove a null character store as we already have done it but it does it for a volatile store which is not

[PATCH] Fix PR 54494, removal of volatile store in strlen optimization because of the inlininer

2012-09-05 Thread Andrew Pinski
Hi, The inlininer likes to recreate some MEM_REF, it copies most of the bits (TREE_THIS_NOTRAP, TREE_THIS_VOLATILE, etc.) but forgets about TREE_SIDE_EFFECTS. This causes the strlen optimization to think the memory store does not have a side effects. OK? Bootstrapped and tested on