Re: [RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-09-16 Thread Richard Biener
On Mon, Sep 16, 2019 at 11:12 AM Richard Biener wrote: > > On Mon, Sep 9, 2019 at 10:10 PM Jeff Law wrote: > > > > On 8/26/19 3:00 AM, Richard Biener wrote: > > > On Fri, Aug 23, 2019 at 9:19 PM Jeff Law wrote: > > >> > > >> On 8/22/19 4:46 AM, Richard Biener wrote: > > > Also you seem to us

Re: [RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-09-16 Thread Richard Biener
On Mon, Sep 9, 2019 at 10:10 PM Jeff Law wrote: > > On 8/26/19 3:00 AM, Richard Biener wrote: > > On Fri, Aug 23, 2019 at 9:19 PM Jeff Law wrote: > >> > >> On 8/22/19 4:46 AM, Richard Biener wrote: > > Also you seem to use this info to constrain optimization when you > > might remember th

Re: [RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-09-09 Thread Jeff Law
On 8/26/19 3:00 AM, Richard Biener wrote: > On Fri, Aug 23, 2019 at 9:19 PM Jeff Law wrote: >> >> On 8/22/19 4:46 AM, Richard Biener wrote: > Also you seem to use this info to constrain optimization when you > might remember that types of addresses do not carry such information... > Th

Re: [RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-09-03 Thread Jeff Law
On 8/26/19 3:00 AM, Richard Biener wrote: > On Fri, Aug 23, 2019 at 9:19 PM Jeff Law wrote: >> >> On 8/22/19 4:46 AM, Richard Biener wrote: > Also you seem to use this info to constrain optimization when you > might remember that types of addresses do not carry such information... > Th

Re: [RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-08-26 Thread Richard Biener
On Fri, Aug 23, 2019 at 9:19 PM Jeff Law wrote: > > On 8/22/19 4:46 AM, Richard Biener wrote: > >>> Also you seem to use this info to constrain optimization when you > >>> might remember that types of addresses do not carry such information... > >>> Thus it should be "trivially" possible to write

Re: [RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-08-23 Thread Jeff Law
On 8/22/19 4:46 AM, Richard Biener wrote: >>> Also you seem to use this info to constrain optimization when you >>> might remember that types of addresses do not carry such information... >>> Thus it should be "trivially" possible to write a testcase that is >>> miscompiled >>> after your patch.

Re: [RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-08-23 Thread Jeff Law
On 8/22/19 8:40 AM, Martin Sebor wrote: > On 8/21/19 4:47 PM, Jeff Law wrote: >> On 8/19/19 7:57 AM, Richard Biener wrote: >> >>> >>> +static tree >>> +objsize_from_type (tree object) >>> +{ >>> +  if (TREE_CODE (object) != ADDR_EXPR) >>> +    return NULL_TREE; >>> + >>> +  tree type = TREE_TYPE (o

Re: [RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-08-23 Thread Jeff Law
On 8/22/19 10:39 AM, Martin Sebor wrote: > On 8/21/19 4:34 PM, Jeff Law wrote: >> On 8/16/19 4:21 PM, Martin Sebor wrote: >>> On 8/16/19 12:15 PM, Jeff Law wrote: On 8/16/19 12:09 PM, Marc Glisse wrote: > On Fri, 16 Aug 2019, Jeff Law wrote: > >> This patch improves our ability to

Re: [RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-08-22 Thread Martin Sebor
On 8/21/19 4:34 PM, Jeff Law wrote: On 8/16/19 4:21 PM, Martin Sebor wrote: On 8/16/19 12:15 PM, Jeff Law wrote: On 8/16/19 12:09 PM, Marc Glisse wrote: On Fri, 16 Aug 2019, Jeff Law wrote: This patch improves our ability to detect dead stores by handling cases where the size memcpy, memset,

Re: [RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-08-22 Thread Martin Sebor
On 8/21/19 4:47 PM, Jeff Law wrote: On 8/19/19 7:57 AM, Richard Biener wrote: +static tree +objsize_from_type (tree object) +{ + if (TREE_CODE (object) != ADDR_EXPR) +return NULL_TREE; + + tree type = TREE_TYPE (object); + if (POINTER_TYPE_P (type)) that if looks suspicious... I'd say

Re: [RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-08-22 Thread Richard Biener
On Thu, Aug 22, 2019 at 12:48 AM Jeff Law wrote: > > On 8/19/19 7:57 AM, Richard Biener wrote: > > > > > +static tree > > +objsize_from_type (tree object) > > +{ > > + if (TREE_CODE (object) != ADDR_EXPR) > > +return NULL_TREE; > > + > > + tree type = TREE_TYPE (object); > > + if (POINTER_T

Re: [RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-08-21 Thread Jeff Law
On 8/19/19 7:57 AM, Richard Biener wrote: > > +static tree > +objsize_from_type (tree object) > +{ > + if (TREE_CODE (object) != ADDR_EXPR) > +return NULL_TREE; > + > + tree type = TREE_TYPE (object); > + if (POINTER_TYPE_P (type)) > > that if looks suspicious... I'd say > if (!POINTER

Re: [RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-08-21 Thread Jeff Law
On 8/16/19 4:21 PM, Martin Sebor wrote: > On 8/16/19 12:15 PM, Jeff Law wrote: >> On 8/16/19 12:09 PM, Marc Glisse wrote: >>> On Fri, 16 Aug 2019, Jeff Law wrote: >>> This patch improves our ability to detect dead stores by handling cases where the size memcpy, memset, strncpy, etc call i

Re: [RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-08-19 Thread Richard Biener
On Fri, Aug 16, 2019 at 8:15 PM Jeff Law wrote: > > On 8/16/19 12:09 PM, Marc Glisse wrote: > > On Fri, 16 Aug 2019, Jeff Law wrote: > > > >> This patch improves our ability to detect dead stores by handling cases > >> where the size memcpy, memset, strncpy, etc call is not constant. This > >> ad

Re: [RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-08-16 Thread Martin Sebor
On 8/16/19 12:15 PM, Jeff Law wrote: On 8/16/19 12:09 PM, Marc Glisse wrote: On Fri, 16 Aug 2019, Jeff Law wrote: This patch improves our ability to detect dead stores by handling cases where the size memcpy, memset, strncpy, etc call is not constant.  This addresses some, but not all, of the

Re: [RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-08-16 Thread Jeff Law
On 8/16/19 4:06 PM, Marc Glisse wrote: > On Fri, 16 Aug 2019, Jeff Law wrote: > >> On 8/16/19 12:09 PM, Marc Glisse wrote: >>> On Fri, 16 Aug 2019, Jeff Law wrote: >>> This patch improves our ability to detect dead stores by handling cases where the size memcpy, memset, strncpy, etc call

Re: [RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-08-16 Thread Marc Glisse
On Fri, 16 Aug 2019, Jeff Law wrote: On 8/16/19 12:09 PM, Marc Glisse wrote: On Fri, 16 Aug 2019, Jeff Law wrote: This patch improves our ability to detect dead stores by handling cases where the size memcpy, memset, strncpy, etc call is not constant.  This addresses some, but not all, of the

Re: [RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-08-16 Thread Jeff Law
On 8/16/19 12:09 PM, Marc Glisse wrote: > On Fri, 16 Aug 2019, Jeff Law wrote: > >> This patch improves our ability to detect dead stores by handling cases >> where the size memcpy, memset, strncpy, etc call is not constant.  This >> addresses some, but not all, of the issues in 80576. >> >> The k

Re: [RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-08-16 Thread Jeff Law
On 8/16/19 12:09 PM, Marc Glisse wrote: > On Fri, 16 Aug 2019, Jeff Law wrote: > >> This patch improves our ability to detect dead stores by handling cases >> where the size memcpy, memset, strncpy, etc call is not constant.  This >> addresses some, but not all, of the issues in 80576. >> >> The k

Re: [RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-08-16 Thread Marc Glisse
On Fri, 16 Aug 2019, Jeff Law wrote: This patch improves our ability to detect dead stores by handling cases where the size memcpy, memset, strncpy, etc call is not constant. This addresses some, but not all, of the issues in 80576. The key here is when the size is not constant we can make con

[RFA] [tree-optimization/80576] Handle non-constant sizes in DSE

2019-08-16 Thread Jeff Law
This patch improves our ability to detect dead stores by handling cases where the size memcpy, memset, strncpy, etc call is not constant. This addresses some, but not all, of the issues in 80576. The key here is when the size is not constant we can make conservative decisions that still give us