Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-07-10 Thread Martin Sebor
On 7/2/19 2:59 PM, Jeff Law wrote: On 6/30/19 3:50 PM, Martin Sebor wrote: On 6/26/19 6:11 PM, Jeff Law wrote: [ Another big snip ] Is there a strong need for an overloaded operator?  Our guidelines generally discourage operator overloads.  This one seems on the border to me.  Others may hav

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-07-02 Thread Jeff Law
On 6/30/19 3:50 PM, Martin Sebor wrote: > On 6/26/19 6:11 PM, Jeff Law wrote: [ Another big snip ] > >> Is there a strong need for an overloaded operator?  Our guidelines >> generally discourage operator overloads.  This one seems on the border >> to me.  Others may have different ideas where the 

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-06-30 Thread Martin Sebor
On 6/26/19 6:11 PM, Jeff Law wrote: On 6/18/19 9:19 PM, Martin Sebor wrote: On 6/14/19 2:59 PM, Jeff Law wrote: [ big snip ] A COND_EXPR on the RHS of an assignment is valid gimple.  That's what we need to consider here -- what is and what is not valid gimple.  And its more likely that PHIs wi

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-06-26 Thread Jeff Law
On 6/18/19 9:19 PM, Martin Sebor wrote: > On 6/14/19 2:59 PM, Jeff Law wrote: [ big snip ] >> A COND_EXPR on the RHS of an assignment is valid gimple.  That's what we >> need to consider here -- what is and what is not valid gimple.  And its >> more likely that PHIs will be transformed into RHS CON

[PING] [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-06-26 Thread Martin Sebor
Ping: did my reply and updated patch resolve your concerns? https://gcc.gnu.org/ml/gcc-patches/2019-06/msg01106.html On 6/18/19 9:19 PM, Martin Sebor wrote: On 6/14/19 2:59 PM, Jeff Law wrote: On 6/4/19 1:40 PM, Martin Sebor wrote: On 6/3/19 5:24 PM, Martin Sebor wrote: On 5/31/19 2:46 PM,

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-06-18 Thread Martin Sebor
On 6/14/19 2:59 PM, Jeff Law wrote: On 6/4/19 1:40 PM, Martin Sebor wrote: On 6/3/19 5:24 PM, Martin Sebor wrote: On 5/31/19 2:46 PM, Jeff Law wrote: On 5/22/19 3:34 PM, Martin Sebor wrote: -Wreturn-local-addr detects a subset of instances of returning the address of a local object from a fun

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-06-04 Thread Martin Sebor
On 6/3/19 5:24 PM, Martin Sebor wrote: On 5/31/19 2:46 PM, Jeff Law wrote: On 5/22/19 3:34 PM, Martin Sebor wrote: -Wreturn-local-addr detects a subset of instances of returning the address of a local object from a function but the warning doesn't try to handle alloca or VLAs, or some non-trivi

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-06-04 Thread Richard Biener
On Mon, Jun 3, 2019 at 1:27 PM Richard Biener wrote: > > On Mon, Jun 3, 2019 at 11:37 AM Richard Biener > wrote: > > > > On Fri, May 31, 2019 at 5:35 PM Jeff Law wrote:> > > > On 5/30/19 4:56 PM, Martin Sebor wrote: > > > > On 5/30/19 10:15 AM, Jeff Law wrote: > > > >> On 5/30/19 9:34 AM, Martin

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-06-03 Thread Martin Sebor
On 5/31/19 2:46 PM, Jeff Law wrote: On 5/22/19 3:34 PM, Martin Sebor wrote: -Wreturn-local-addr detects a subset of instances of returning the address of a local object from a function but the warning doesn't try to handle alloca or VLAs, or some non-trivial cases of ordinary automatic variables

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-06-03 Thread Jeff Law
On 6/3/19 3:37 AM, Richard Biener wrote: > On Fri, May 31, 2019 at 5:35 PM Jeff Law wrote:> >> On 5/30/19 4:56 PM, Martin Sebor wrote: >>> On 5/30/19 10:15 AM, Jeff Law wrote: On 5/30/19 9:34 AM, Martin Sebor wrote: >>> If the alias oracle can be used to give the same results without

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-06-03 Thread Richard Biener
On Mon, Jun 3, 2019 at 11:37 AM Richard Biener wrote: > > On Fri, May 31, 2019 at 5:35 PM Jeff Law wrote:> > > On 5/30/19 4:56 PM, Martin Sebor wrote: > > > On 5/30/19 10:15 AM, Jeff Law wrote: > > >> On 5/30/19 9:34 AM, Martin Sebor wrote: > > >> > > > If the alias oracle can be used to give

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-06-03 Thread Richard Biener
On Fri, May 31, 2019 at 5:35 PM Jeff Law wrote:> > On 5/30/19 4:56 PM, Martin Sebor wrote: > > On 5/30/19 10:15 AM, Jeff Law wrote: > >> On 5/30/19 9:34 AM, Martin Sebor wrote: > >> > > If the alias oracle can be used to give the same results without > > excessive false positives then I th

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-05-31 Thread Jeff Law
On 5/22/19 3:34 PM, Martin Sebor wrote: > -Wreturn-local-addr detects a subset of instances of returning > the address of a local object from a function but the warning > doesn't try to handle alloca or VLAs, or some non-trivial cases > of ordinary automatic variables[1]. > > The attached patch ex

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-05-31 Thread Jeff Law
On 5/30/19 4:56 PM, Martin Sebor wrote: > On 5/30/19 10:15 AM, Jeff Law wrote: >> On 5/30/19 9:34 AM, Martin Sebor wrote: >> > If the alias oracle can be used to give the same results without > excessive false positives then I think it would be fine to make > use of it.  Is that somethi

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-05-30 Thread Jeff Law
On 5/30/19 11:23 AM, Jason Merrill wrote: > On Thu, May 30, 2019 at 12:16 PM Jeff Law wrote: >> >> On 5/30/19 9:34 AM, Martin Sebor wrote: >> > If the alias oracle can be used to give the same results without > excessive false positives then I think it would be fine to make > use of it

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-05-30 Thread Martin Sebor
On 5/30/19 10:15 AM, Jeff Law wrote: On 5/30/19 9:34 AM, Martin Sebor wrote: If the alias oracle can be used to give the same results without excessive false positives then I think it would be fine to make use of it.  Is that something you consider a prerequisite for this change or should I loo

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-05-30 Thread Jason Merrill
On Thu, May 30, 2019 at 12:16 PM Jeff Law wrote: > > On 5/30/19 9:34 AM, Martin Sebor wrote: > > >>> If the alias oracle can be used to give the same results without > >>> excessive false positives then I think it would be fine to make > >>> use of it. Is that something you consider a prerequisit

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-05-30 Thread Jeff Law
On 5/30/19 9:34 AM, Martin Sebor wrote: >>> If the alias oracle can be used to give the same results without >>> excessive false positives then I think it would be fine to make >>> use of it.  Is that something you consider a prerequisite for >>> this change or should I look into it as a followup?

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-05-30 Thread Martin Sebor
On 5/30/19 9:13 AM, Jeff Law wrote: On 5/30/19 8:52 AM, Martin Sebor wrote: On 5/29/19 11:45 AM, Jeff Law wrote: On 5/22/19 3:34 PM, Martin Sebor wrote: -Wreturn-local-addr detects a subset of instances of returning the address of a local object from a function but the warning doesn't try to h

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-05-30 Thread Jeff Law
On 5/30/19 8:52 AM, Martin Sebor wrote: > On 5/29/19 11:45 AM, Jeff Law wrote: >> On 5/22/19 3:34 PM, Martin Sebor wrote: >>> -Wreturn-local-addr detects a subset of instances of returning >>> the address of a local object from a function but the warning >>> doesn't try to handle alloca or VLAs, or

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-05-30 Thread Martin Sebor
On 5/29/19 11:45 AM, Jeff Law wrote: On 5/22/19 3:34 PM, Martin Sebor wrote: -Wreturn-local-addr detects a subset of instances of returning the address of a local object from a function but the warning doesn't try to handle alloca or VLAs, or some non-trivial cases of ordinary automatic variable

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-05-29 Thread Jeff Law
On 5/22/19 3:34 PM, Martin Sebor wrote: > -Wreturn-local-addr detects a subset of instances of returning > the address of a local object from a function but the warning > doesn't try to handle alloca or VLAs, or some non-trivial cases > of ordinary automatic variables[1]. > > The attached patch ex

[PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-05-22 Thread Martin Sebor
-Wreturn-local-addr detects a subset of instances of returning the address of a local object from a function but the warning doesn't try to handle alloca or VLAs, or some non-trivial cases of ordinary automatic variables[1]. The attached patch extends the implementation of the warning to detect t