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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:de70758207a6b2d8d3d6bbd3fc564ca736ed094f

commit r10-8493-gde70758207a6b2d8d3d6bbd3fc564ca736ed094f
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Tue Jul 14 16:01:11 2020 +0200

    expr: Unbreak build of mesa [PR96194]

    > > The store to the whole of each volatile object was picked apart
    > > like there had been an individual assignment to each of the
    > > fields.  Reads were added as part of that; see PR for details.
    > > The reads from volatile memory were a clear bug; individual
    > > stores questionable.  A separate patch clarifies the docs.

    This breaks building of mesa on both the trunk and 10 branch.

    The problem is that the middle-end may never create temporaries of non-POD
    (TREE_ADDRESSABLE) types, those can be only created when the language says
    so and thus only the FE is allowed to create those.

    This patch just reverts the behavior to what we used to do before for the
    stores to volatile non-PODs.  Perhaps we want to do something else, but
    definitely we can't create temporaries of the non-POD type.  It is up to
    discussions on what should happen in those cases.

    2020-07-14  Jakub Jelinek  <ja...@redhat.com>

            PR middle-end/96194
            * expr.c (expand_constructor): Don't create temporary for store to
            volatile MEM if exp has an addressable type.

            * g++.dg/opt/pr96194.C: New test.

    (cherry picked from commit b1d389d60d1929c7528ef984925ea010e3bf2c1a)

Reply via email to