[Bug c++/101480] [11 Regression] Miscompiled code involving operator new

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Oct 12 06:10:23 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101480

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|11.1.0                      |

--- Comment #22 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to hubicka from comment #21)
> Hi,
> note that also tree-ssa-structalias has:
> /* If the call is to a replaceable operator delete and results            
>    from a delete expression as opposed to a direct call to                
>    such operator, then the effects for PTA (in particular                 
>    the escaping of the pointer) can be ignored.  */                       
> else if (fndecl                                                           
>          && DECL_IS_OPERATOR_DELETE_P (fndecl)                            
>          && gimple_call_from_new_or_delete (t))                           
>   ;                                                                       
> I wonder if this is safe...

I think the reasoning is that for a delete expression the storage passed
is released afterwards and thus the delete call cannot be an escape point
(as opposed to the 'new' call) for this very object.


More information about the Gcc-bugs mailing list