aboutsummaryrefslogtreecommitdiff
path: root/gcc/memory-block.cc
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2019-08-13 08:08:22 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-08-13 08:08:22 +0000
commit5efb7125030aab3e2622be6de7fbbb18ddfadc8f (patch)
treec2d08692c744bd2726cb6c50d40e0988ce4c5e50 /gcc/memory-block.cc
parent5b3b4d60896349500c8e338445570a1a6a7fcf61 (diff)
downloadgcc-5efb7125030aab3e2622be6de7fbbb18ddfadc8f.zip
gcc-5efb7125030aab3e2622be6de7fbbb18ddfadc8f.tar.gz
gcc-5efb7125030aab3e2622be6de7fbbb18ddfadc8f.tar.bz2
[Ada] Do not remove side-effects in an others_clause with function calls
An aggregate can be handled by the backend if it consists of static constants of an elementary type, or null. If a component is a type conversion we must preanalyze and resolve it to determine whether the ultimate value is in one of these categories. Previously we did a full analysis and resolution of the expression for the component, which could lead to a removal of side-effects, which is semantically incorrect if the expression includes functions with side-effects (e.g. a call to a random generator). 2019-08-13 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Preanalyze expression, rather do a full analysis, to prevent unwanted removal of side effects which mask the intent of the expression. gcc/testsuite/ * gnat.dg/aggr27.adb: New testcase. From-SVN: r274355
Diffstat (limited to 'gcc/memory-block.cc')
0 files changed, 0 insertions, 0 deletions