re PR c++/80129 (wrong code with ternary struct assignment to const)
authorJakub Jelinek <jakub@redhat.com>
Wed, 22 Mar 2017 18:45:48 +0000 (19:45 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 22 Mar 2017 18:45:48 +0000 (19:45 +0100)
commit68ed2ba0a7d60275ac044a4cb50b33eb33fbb813
tree1e4f17b8856d8dc6d804ba411cf9c40568e61ca9
parent0e2468e0ca0ad2e7adc0098f6a4061be7475fdc1
re PR c++/80129 (wrong code with ternary struct assignment to const)

PR c++/80129
* gimplify.c (gimplify_modify_expr_rhs) <case COND_EXPR>: Clear
TREE_READONLY on result if writing it more than once.

* g++.dg/torture/pr80129.C: New test.

From-SVN: r246401
gcc/ChangeLog
gcc/gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr80129.C [new file with mode: 0644]