summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ada/libgnat/a-cobove.adb10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ada/libgnat/a-cobove.adb b/gcc/ada/libgnat/a-cobove.adb
index 3b5b4a61bf5..6371fb57d28 100644
--- a/gcc/ada/libgnat/a-cobove.adb
+++ b/gcc/ada/libgnat/a-cobove.adb
@@ -363,7 +363,15 @@ package body Ada.Containers.Bounded_Vectors is
New_Item : Element_Type)
is
begin
- Insert (Container, Last_Index (Container) + 1, New_Item, 1);
+ if T_Check then
+ -- handle the general case
+ Insert (Container, Last_Index (Container) + 1, New_Item, 1);
+ else
+ -- The fast path.
+ -- The first (but not the second) statement may fail a check.
+ Container.Elements (To_Array_Index (Container.Last) + 1) := New_Item;
+ Container.Last := Container.Last + 1;
+ end if;
end Append;
--------------