From f8125f0c9ce43aac6d7a96753e4617af68ee0009 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 30 Nov 2015 11:34:31 +0000 Subject: * gcc-interface/utils2.c (gnat_invariant_expr): Add type conversions. From-SVN: r231063 --- gcc/testsuite/gnat.dg/loop_optimization22.adb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 gcc/testsuite/gnat.dg/loop_optimization22.adb (limited to 'gcc/testsuite/gnat.dg/loop_optimization22.adb') diff --git a/gcc/testsuite/gnat.dg/loop_optimization22.adb b/gcc/testsuite/gnat.dg/loop_optimization22.adb new file mode 100644 index 0000000..7fb307b --- /dev/null +++ b/gcc/testsuite/gnat.dg/loop_optimization22.adb @@ -0,0 +1,16 @@ +-- { dg-do compile } +-- { dg-options "-O" } + +pragma Overflow_Mode (Minimized); + +package body Loop_Optimization22 is + + procedure Foo (X : Discrim_Type) is + H : array (1 .. Integer (X.Count) + 1) of Float; + begin + for I in 1 .. X.Count loop + H (Integer(I) + 1):= 0.0; + end loop; + end; + +end Loop_Optimization22; -- cgit v1.1