https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99117
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|needs-reduction |
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
So the issue is definitely the __restrict__ qualification of the
valarray::__M_data member. As you noted __valarray_copy is where
points-to analysis sees the restrict qualification when accessing
_Array<_Tp>::_M_data and that causes it to disambiguate against
the accesses via __e.
So I see nothing wrong with points-to analysis handling the
__restrict qualification. Whether there's a bug in std::valarray
(or in std::accumulate) or whether the testcase is invalid remains
your choice. I'm keeping it wrong-code classified for now.