[Bug c++/97474] [8/9/10/11 Regression] produces wrong code with references to another field

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jan 25 16:32:23 GMT 2021


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

--- Comment #12 from Jason Merrill <jason at gcc dot gnu.org> ---
Yeah, adding restrict there is just wrong; the constructor is called outside
the function, and could e.g. stash a pointer to the object in a global
variable.  What we actually want is to treat this reference parameter like a
value parameter.  Is that information actually useful to the optimizers?


More information about the Gcc-bugs mailing list