aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2021-01-27 10:08:46 +0100
committerJakub Jelinek <jakub@redhat.com>2021-01-27 10:08:46 +0100
commitefc9ccbfd0ca4da6bf0aba913df6f77f56044dc2 (patch)
treec146b34a47d8ca6cb39ee98c939acb426514a8cd /gcc/fortran/trans-expr.c
parente62bb7f083470ccdadbd83ef885c6fe1e5cb9e67 (diff)
downloadgcc-efc9ccbfd0ca4da6bf0aba913df6f77f56044dc2.zip
gcc-efc9ccbfd0ca4da6bf0aba913df6f77f56044dc2.tar.gz
gcc-efc9ccbfd0ca4da6bf0aba913df6f77f56044dc2.tar.bz2
varpool: Restore GENERIC TREE_READONLY automatic var optimization [PR7260]
In 4.8 and earlier we used to fold the following to 0 during GENERIC folding, but we don't do that anymore because ctor_for_folding etc. has been turned into a GIMPLE centric API, but as the testcase shows, it is invoked even during GENERIC folding and there the automatic vars still should have meaningful initializers. I've verified that the C++ FE drops TREE_READONLY on automatic vars with const qualified types if they require non-constant (runtime) initialization. 2021-01-27 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/97260 * varpool.c: Include tree-pass.h. (ctor_for_folding): In GENERIC return DECL_INITIAL for TREE_READONLY non-TREE_SIDE_EFFECTS automatic variables. * gcc.dg/tree-ssa/pr97260.c: New test.
Diffstat (limited to 'gcc/fortran/trans-expr.c')
0 files changed, 0 insertions, 0 deletions