aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-parloops.c
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2019-09-18 08:31:37 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-09-18 08:31:37 +0000
commit5ce1c7733b720d583eb46910e738adc932ecf7ce (patch)
treed58bde07e155171f6e90491b6562ad3421b4c2af /gcc/tree-parloops.c
parent2b6cd962513387303661614b292397cb6432590c (diff)
downloadgcc-5ce1c7733b720d583eb46910e738adc932ecf7ce.zip
gcc-5ce1c7733b720d583eb46910e738adc932ecf7ce.tar.gz
gcc-5ce1c7733b720d583eb46910e738adc932ecf7ce.tar.bz2
[Ada] Avoid uninitialized variable in bounded containers
In function Copy in Ada.Containers.Bounded_Ordered_Sets and other bounded containers packages, remove a possible use of an uninitialized variable. This was not a bug, because the uninitialized variable could be used only if checks are suppressed, and the checks would have failed, leading to erroneous execution. However, it seems more robust this way, and is probably equally efficient, and avoids a warning that is given if checks are suppressed, and the -Wall switch is given, and optimization is turned on. 2019-09-18 Bob Duff <duff@adacore.com> gcc/ada/ * libgnat/a-cbhama.adb, libgnat/a-cbhase.adb, libgnat/a-cbmutr.adb, libgnat/a-cborma.adb, libgnat/a-cborse.adb, libgnat/a-cobove.adb (Copy): Avoid reading the uninitialized variable C in the Checks = False case. Change variable to be a constant. gcc/testsuite/ * gnat.dg/containers1.adb, gnat.dg/containers1.ads: New testcase. From-SVN: r275839
Diffstat (limited to 'gcc/tree-parloops.c')
0 files changed, 0 insertions, 0 deletions