diff options
author | Bob Duff <duff@adacore.com> | 2023-07-03 12:01:01 -0400 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-07-11 11:24:29 +0200 |
commit | 6be7d5e91e47c5432391b03de9f89e7ec6072eda (patch) | |
tree | 17ffc8cd2fa67677efc6a3bcfb8354922a5bc4f1 /libgcc/floatunsixf.c | |
parent | 8957121b8bf4be7eb7f9de31b810ea01594a670e (diff) | |
download | gcc-6be7d5e91e47c5432391b03de9f89e7ec6072eda.zip gcc-6be7d5e91e47c5432391b03de9f89e7ec6072eda.tar.gz gcc-6be7d5e91e47c5432391b03de9f89e7ec6072eda.tar.bz2 |
ada: Avoid renaming_decl in case of constrained array
This patch avoids rewriting "X: S := F(...);" as "X: S renames F(...);".
That rewrite is incorrect if S is a constrained array subtype,
because it changes the semantics. In the original, the
bounds of X are that of S. But constraints are ignored in
renamings, so the bounds of X would come from F'Result.
This can cause spurious Constraint_Errors in some obscure
cases. It causes unnecessary checks to be inserted, and even
when such checks pass (more common case), they might be less
efficient.
gcc/ada/
* exp_ch3.adb (Expand_N_Object_Declaration): Avoid transforming to
a renaming in case of constrained array that comes from source.
Diffstat (limited to 'libgcc/floatunsixf.c')
0 files changed, 0 insertions, 0 deletions