Re: [PATCH][RFC] Fix PR61473, inline small memcpy/memmove during tree opts

2014-07-14 Thread Richard Biener
On Mon, 14 Jul 2014, Richard Biener wrote: > On Fri, 11 Jul 2014, Jakub Jelinek wrote: > > > On Fri, Jul 11, 2014 at 03:36:15PM +0200, Richard Biener wrote: > > > *** c_strlen (tree src, int only_value) > > > *** 606,612 > > > > > > /* If the offset is known to be out of b

Re: [PATCH][RFC] Fix PR61473, inline small memcpy/memmove during tree opts

2014-07-14 Thread Richard Biener
On Fri, 11 Jul 2014, Jakub Jelinek wrote: > On Fri, Jul 11, 2014 at 03:36:15PM +0200, Richard Biener wrote: > > *** c_strlen (tree src, int only_value) > > *** 606,612 > > > > /* If the offset is known to be out of bounds, warn, and call strlen at > >runtime. */ >

Re: [PATCH][RFC] Fix PR61473, inline small memcpy/memmove during tree opts

2014-07-11 Thread Jakub Jelinek
On Fri, Jul 11, 2014 at 03:36:15PM +0200, Richard Biener wrote: > *** c_strlen (tree src, int only_value) > *** 606,612 > > /* If the offset is known to be out of bounds, warn, and call strlen at >runtime. */ > ! if (offset < 0 || offset > max) > { >

Re: [PATCH][RFC] Fix PR61473, inline small memcpy/memmove during tree opts

2014-07-11 Thread Richard Biener
On Fri, 11 Jul 2014, Richard Biener wrote: > On Thu, 10 Jul 2014, Jakub Jelinek wrote: > > > On Thu, Jul 10, 2014 at 04:30:13PM +0200, Richard Biener wrote: > > > Compromise "hack" below. It simply avoids the transform for > > > sources that c_strlen can compute a length of. That "fixes" all >

Re: [PATCH][RFC] Fix PR61473, inline small memcpy/memmove during tree opts

2014-07-11 Thread Richard Biener
On Thu, 10 Jul 2014, Jakub Jelinek wrote: > On Thu, Jul 10, 2014 at 04:30:13PM +0200, Richard Biener wrote: > > Compromise "hack" below. It simply avoids the transform for > > sources that c_strlen can compute a length of. That "fixes" all > > strlenopt testcase apart from strlenopt-8.c which do

Re: [PATCH][RFC] Fix PR61473, inline small memcpy/memmove during tree opts

2014-07-10 Thread Jakub Jelinek
On Thu, Jul 10, 2014 at 04:30:13PM +0200, Richard Biener wrote: > Compromise "hack" below. It simply avoids the transform for > sources that c_strlen can compute a length of. That "fixes" all > strlenopt testcase apart from strlenopt-8.c which does > memcpy (, flag ? "a" : "b"); which then still

Re: [PATCH][RFC] Fix PR61473, inline small memcpy/memmove during tree opts

2014-07-10 Thread Richard Biener
On Fri, 27 Jun 2014, Richard Biener wrote: > On Fri, 27 Jun 2014, Jakub Jelinek wrote: > > > On Fri, Jun 27, 2014 at 01:49:38PM +0200, Richard Biener wrote: > > > I'm going to go for a single load/store and MOVE_MAX for now - I > > > have quite some fallout to deal with anyway (analyzed strlenopt

Re: [PATCH][RFC] Fix PR61473, inline small memcpy/memmove during tree opts

2014-06-27 Thread Jeff Law
On 06/27/14 05:56, Jakub Jelinek wrote: On Fri, Jun 27, 2014 at 01:49:38PM +0200, Richard Biener wrote: I'm going to go for a single load/store and MOVE_MAX for now - I have quite some fallout to deal with anyway (analyzed strlenopt-1.c FAIL only, the other strlenopt cases are probably similar)

Re: [PATCH][RFC] Fix PR61473, inline small memcpy/memmove during tree opts

2014-06-27 Thread Richard Biener
On Fri, 27 Jun 2014, Jakub Jelinek wrote: > On Fri, Jun 27, 2014 at 01:49:38PM +0200, Richard Biener wrote: > > I'm going to go for a single load/store and MOVE_MAX for now - I > > have quite some fallout to deal with anyway (analyzed strlenopt-1.c > > FAIL only, the other strlenopt cases are prob

Re: [PATCH][RFC] Fix PR61473, inline small memcpy/memmove during tree opts

2014-06-27 Thread Jakub Jelinek
On Fri, Jun 27, 2014 at 01:49:38PM +0200, Richard Biener wrote: > I'm going to go for a single load/store and MOVE_MAX for now - I > have quite some fallout to deal with anyway (analyzed strlenopt-1.c > FAIL only, the other strlenopt cases are probably similar) > > FAIL: gcc.dg/strlenopt-1.c scan-

Re: [PATCH][RFC] Fix PR61473, inline small memcpy/memmove during tree opts

2014-06-27 Thread Richard Biener
On Thu, 12 Jun 2014, Jeff Law wrote: > On 06/12/14 04:12, Richard Biener wrote: > > > > This implements the requested inlining of memmove for possibly > > overlapping arguments by doing first all loads and then all stores. > > The easiest place is to do this in memory op folding where we already

Re: [PATCH][RFC] Fix PR61473, inline small memcpy/memmove during tree opts

2014-06-12 Thread Jeff Law
On 06/12/14 04:12, Richard Biener wrote: This implements the requested inlining of memmove for possibly overlapping arguments by doing first all loads and then all stores. The easiest place is to do this in memory op folding where we already perform inlining of some memcpy cases (but fail to do

[PATCH][RFC] Fix PR61473, inline small memcpy/memmove during tree opts

2014-06-12 Thread Richard Biener
This implements the requested inlining of memmove for possibly overlapping arguments by doing first all loads and then all stores. The easiest place is to do this in memory op folding where we already perform inlining of some memcpy cases (but fail to do the equivalent memcpy optimization - though