Re: [PATCH] avoid assuming gimple_call_alloc_size argument is a call (PR 99489)

2021-03-13 Thread Martin Sebor via Gcc-patches
On 3/12/21 6:52 AM, Jakub Jelinek wrote: On Tue, Mar 09, 2021 at 03:07:38PM -0700, Martin Sebor via Gcc-patches wrote: The gimple_call_alloc_size() function is documented to "return null when STMT is not a call to a valid allocation function" but the code assumes STMT is a call statement, causin

Re: [PATCH] avoid assuming gimple_call_alloc_size argument is a call (PR 99489)

2021-03-12 Thread Jakub Jelinek via Gcc-patches
On Fri, Mar 12, 2021 at 09:04:33AM -0500, David Malcolm wrote: > > from the start of the function and add is_gimple_call (stmt) && > > in tree-ssa-strlen.c. > > Maybe even make it convert it to taking a "const gcall *", so those > > if (is_gimple_call (stmt)) > { >... >if (g

Re: [PATCH] avoid assuming gimple_call_alloc_size argument is a call (PR 99489)

2021-03-12 Thread David Malcolm via Gcc-patches
On Fri, 2021-03-12 at 14:52 +0100, Jakub Jelinek via Gcc-patches wrote: > On Tue, Mar 09, 2021 at 03:07:38PM -0700, Martin Sebor via Gcc- > patches wrote: > > The gimple_call_alloc_size() function is documented to "return null > > when STMT is not a call to a valid allocation function" but the > >

Re: [PATCH] avoid assuming gimple_call_alloc_size argument is a call (PR 99489)

2021-03-12 Thread Jakub Jelinek via Gcc-patches
On Tue, Mar 09, 2021 at 03:07:38PM -0700, Martin Sebor via Gcc-patches wrote: > The gimple_call_alloc_size() function is documented to "return null > when STMT is not a call to a valid allocation function" but the code > assumes STMT is a call statement, causing the function to ICE when > it isn't.

[PATCH] avoid assuming gimple_call_alloc_size argument is a call (PR 99489)

2021-03-09 Thread Martin Sebor via Gcc-patches
The gimple_call_alloc_size() function is documented to "return null when STMT is not a call to a valid allocation function" but the code assumes STMT is a call statement, causing the function to ICE when it isn't. The attached patch changes the function to fulfill its contract and return null als