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

--- Comment #6 from rguenther at suse dot de <rguenther at suse dot de> ---
On Tue, 30 May 2023, pinskia at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110035
> 
> Andrew Pinski <pinskia at gcc dot gnu.org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>            Keywords|                            |missed-optimization
>      Ever confirmed|0                           |1
>            Severity|normal                      |enhancement
>    Last reconfirmed|                            |2023-05-30
>              Status|UNCONFIRMED                 |NEW
> 
> --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
> More obvious Reduced testcase:
> ```
> struct MyClass
> {
>     unsigned long long arr[128];
> };
> 
> [[gnu::noipa]]
> void sink(void *m){}
> void gg(MyClass &a)
> {
>   MyClass c = a;
>   MyClass *b = new MyClass;
>   *b = c;
>   sink(b);
> }
> ```
> 
> There might be a dup of this issue too.

But we cannot move the load of 'a' across the call to operator new
since that can possibly clobber 'a' (you can overwrite 'new' with
something having observable side-effects)

Reply via email to