Re: determining aggregate member from MEM_REF

2018-02-27 Thread Richard Biener
On Mon, Feb 26, 2018 at 9:04 PM, Jeff Law wrote: > On 02/26/2018 08:44 AM, Martin Sebor wrote: >> >> Folding things to MEM_REF (or rather, folding them too early) >> makes all kinds of analysis harder: not just warnings but even >> optimization. I've raised a whole slew of bugs for the strlen >>

Re: determining aggregate member from MEM_REF

2018-02-26 Thread Jeff Law
On 02/26/2018 08:44 AM, Martin Sebor wrote: > > Folding things to MEM_REF (or rather, folding them too early) > makes all kinds of analysis harder: not just warnings but even > optimization.  I've raised a whole slew of bugs for the strlen > pass alone where folding string functions to MEM_REF def

Re: determining aggregate member from MEM_REF

2018-02-26 Thread Jeff Law
On 02/26/2018 05:08 AM, Richard Biener wrote: > On Fri, Feb 16, 2018 at 8:07 PM, Martin Sebor wrote: >> Say I have a struct like this: >> >> struct A { >> char a[4], b[5]; >> }; >> >> then in >> >> extern struct A *a; >> >> memset (&a[0].a[0] + 14, 0, 3); // invalid >> >> memset (

Re: determining aggregate member from MEM_REF

2018-02-26 Thread Martin Sebor
On 02/26/2018 05:08 AM, Richard Biener wrote: On Fri, Feb 16, 2018 at 8:07 PM, Martin Sebor wrote: On 02/16/2018 04:22 AM, Richard Biener wrote: On Thu, Feb 15, 2018 at 6:28 PM, Martin Sebor wrote: There are APIs to determine the base object and an offset into it from all sorts of expressi

Re: determining aggregate member from MEM_REF

2018-02-26 Thread Richard Biener
On Fri, Feb 16, 2018 at 8:07 PM, Martin Sebor wrote: > On 02/16/2018 04:22 AM, Richard Biener wrote: >> >> On Thu, Feb 15, 2018 at 6:28 PM, Martin Sebor wrote: >>> >>> There are APIs to determine the base object and an offset >>> into it from all sorts of expressions, including ARRAY_REF, >>> COM

Re: determining aggregate member from MEM_REF

2018-02-16 Thread Martin Sebor
On 02/16/2018 04:22 AM, Richard Biener wrote: On Thu, Feb 15, 2018 at 6:28 PM, Martin Sebor wrote: There are APIs to determine the base object and an offset into it from all sorts of expressions, including ARRAY_REF, COMPONENT_REF, and MEM_REF, but none of those I know about makes it also possi

Re: determining aggregate member from MEM_REF

2018-02-16 Thread Richard Biener
On Thu, Feb 15, 2018 at 6:28 PM, Martin Sebor wrote: > There are APIs to determine the base object and an offset > into it from all sorts of expressions, including ARRAY_REF, > COMPONENT_REF, and MEM_REF, but none of those I know about > makes it also possible to discover the member being referred