summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2006-06-21 15:09:36 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2006-06-21 15:09:36 +0000
commit8ee578c81f0240a72ab314c0bfb3021ca8a2043f (patch)
treee69f3c4f2aa88e84c047225360cea409efb14f51 /gcc/testsuite
parentb1ef404ea216e235be327738d7b6bdccf9788d73 (diff)
downloadgcc-8ee578c81f0240a72ab314c0bfb3021ca8a2043f.tar.gz
* tree-ssa-loop-ivopts.c (may_be_nonaddressable_p): New function.
(find_interesting_uses_address): Punt if above function returns true. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114851 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gnat.dg/loop_unchecked_conversion.adb33
-rw-r--r--gcc/testsuite/gnat.dg/loop_unchecked_conversion.ads5
3 files changed, 42 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 93cb39ebb46..3e9165c4afd 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2006-06-21 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/loop_unchecked_conversion.ad[bs]: New test.
+
2006-06-21 Joseph Myers <joseph@codesourcery.com>
* gcc.c-torture/execute/complex-7.c: New.
diff --git a/gcc/testsuite/gnat.dg/loop_unchecked_conversion.adb b/gcc/testsuite/gnat.dg/loop_unchecked_conversion.adb
new file mode 100644
index 00000000000..e87c415c548
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/loop_unchecked_conversion.adb
@@ -0,0 +1,33 @@
+-- { dg-do compile }
+-- { dg-options "-gnatws -O" }
+
+with Unchecked_Conversion;
+
+package body loop_unchecked_conversion is
+
+ type Byte is mod 2**8;
+
+ type List is array (Natural range <>) of Byte;
+
+ subtype Integer_List is List (1 .. 4);
+
+ function Integer_Down is new
+ Unchecked_Conversion (Source => Integer, Target => Integer_List);
+
+ type Storage (Size : Integer) is
+ record
+ Data : List (1 .. Size);
+ end record;
+
+ type Storage_Pointer is access Storage;
+
+ The_Data_Storage : Storage_Pointer;
+
+ procedure slice is
+ begin
+ for I in 0 .. 1 loop
+ The_Data_Storage.Data (I+1 .. I+4) := Integer_Down (I);
+ end loop;
+ end;
+
+end loop_unchecked_conversion;
diff --git a/gcc/testsuite/gnat.dg/loop_unchecked_conversion.ads b/gcc/testsuite/gnat.dg/loop_unchecked_conversion.ads
new file mode 100644
index 00000000000..5ce43e5524e
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/loop_unchecked_conversion.ads
@@ -0,0 +1,5 @@
+package loop_unchecked_conversion is
+
+ procedure slice;
+
+end loop_unchecked_conversion;