]> git.ipfire.org Git - thirdparty/gcc.git/commit
expr: Unbreak build of mesa [PR96194]
authorJakub Jelinek <jakub@redhat.com>
Tue, 14 Jul 2020 14:01:11 +0000 (16:01 +0200)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 16:17:40 +0000 (13:17 -0300)
commitd461329292f5cc9adcc5e3804016389452dbc21b
tree0ef853894d0ba2b963646802fd1dc331f5dd2756
parentecf0acc9ab98bd25fa1aec5634b6deab71d6cafd
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  <jakub@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.
gcc/expr.c
gcc/testsuite/g++.dg/opt/pr96194.C [new file with mode: 0644]