Re: [PATCH] teach compute_objsize about placement new (PR 100876)

2021-06-15 Thread Martin Sebor via Gcc-patches
On 6/15/21 4:58 AM, Christophe Lyon wrote: Hi, On Tue, 15 Jun 2021 at 00:58, Martin Sebor via Gcc-patches wrote: On 6/2/21 3:46 PM, Marek Polacek wrote: On Wed, Jun 02, 2021 at 03:40:49PM -0600, Martin Sebor via Gcc-patches wrote: + if (!gimple_call_builtin_p (stmt, BUILT_IN_NORMAL)) +

Re: [PATCH] teach compute_objsize about placement new (PR 100876)

2021-06-15 Thread Christophe Lyon via Gcc-patches
Hi, On Tue, 15 Jun 2021 at 00:58, Martin Sebor via Gcc-patches wrote: > > On 6/2/21 3:46 PM, Marek Polacek wrote: > > On Wed, Jun 02, 2021 at 03:40:49PM -0600, Martin Sebor via Gcc-patches > > wrote: > >> + if (!gimple_call_builtin_p (stmt, BUILT_IN_NORMAL)) > >> +{ > >> + /* See if th

Re: [PATCH] teach compute_objsize about placement new (PR 100876)

2021-06-14 Thread Martin Sebor via Gcc-patches
On 6/2/21 3:46 PM, Marek Polacek wrote: On Wed, Jun 02, 2021 at 03:40:49PM -0600, Martin Sebor via Gcc-patches wrote: + if (!gimple_call_builtin_p (stmt, BUILT_IN_NORMAL)) +{ + /* See if this is a call to placement new. */ + if (!fn + || !DECL_IS_OPERATOR_NEW_P (fn) +

Re: [PATCH] teach compute_objsize about placement new (PR 100876)

2021-06-14 Thread Martin Sebor via Gcc-patches
On 6/13/21 5:45 PM, Jeff Law wrote: On 6/2/2021 3:40 PM, Martin Sebor via Gcc-patches wrote: The two forms of placement operator new defined in return their pointer argument and may not be displaced by user-defined functions. But because they are ordinary (not built-in) functions this propert

Re: [PATCH] teach compute_objsize about placement new (PR 100876)

2021-06-13 Thread Bernhard Reutner-Fischer via Gcc-patches
On 14 June 2021 07:56:38 CEST, Bernhard Reutner-Fischer wrote: >On 14 June 2021 01:45:36 CEST, Jeff Law via Gcc-patches > wrote: >> >> >>On 6/2/2021 3:40 PM, Martin Sebor via Gcc-patches wrote: >>> The two forms of placement operator new defined in return >their >>> pointer argument and may not

Re: [PATCH] teach compute_objsize about placement new (PR 100876)

2021-06-13 Thread Bernhard Reutner-Fischer via Gcc-patches
On 14 June 2021 01:45:36 CEST, Jeff Law via Gcc-patches wrote: > > >On 6/2/2021 3:40 PM, Martin Sebor via Gcc-patches wrote: >> The two forms of placement operator new defined in return their >> pointer argument and may not be displaced by user-defined functions. >> But because they are ordinary

Re: [PATCH] teach compute_objsize about placement new (PR 100876)

2021-06-13 Thread Jeff Law via Gcc-patches
On 6/2/2021 3:40 PM, Martin Sebor via Gcc-patches wrote: The two forms of placement operator new defined in return their pointer argument and may not be displaced by user-defined functions. But because they are ordinary (not built-in) functions this property isn't reflected in their declarati

PING [PATCH] teach compute_objsize about placement new (PR 100876)

2021-06-09 Thread Martin Sebor via Gcc-patches
Ping: https://gcc.gnu.org/pipermail/gcc-patches/2021-June/571777.html On 6/2/21 3:40 PM, Martin Sebor wrote: The two forms of placement operator new defined in return their pointer argument and may not be displaced by user-defined functions. But because they are ordinary (not built-in) function

Re: [PATCH] teach compute_objsize about placement new (PR 100876)

2021-06-02 Thread Marek Polacek via Gcc-patches
On Wed, Jun 02, 2021 at 03:40:49PM -0600, Martin Sebor via Gcc-patches wrote: > + if (!gimple_call_builtin_p (stmt, BUILT_IN_NORMAL)) > +{ > + /* See if this is a call to placement new. */ > + if (!fn > + || !DECL_IS_OPERATOR_NEW_P (fn) > + || DECL_IS_REPLACEABLE_OPERATO

[PATCH] teach compute_objsize about placement new (PR 100876)

2021-06-02 Thread Martin Sebor via Gcc-patches
The two forms of placement operator new defined in return their pointer argument and may not be displaced by user-defined functions. But because they are ordinary (not built-in) functions this property isn't reflected in their declarations alone, and there's no user- level attribute to annotate t