+2008-11-12 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.c-torture/execute/20081112-1.c: New test.
+ * gnat.dg/concat1.adb: Likewise.
+ * gnat.dg/concat1_pkg.ad[sb]: New helper.
+
2008-11-12 Jason Merrill <jason@redhat.com>
PR c++/38007
--- /dev/null
+#include <limits.h>
+
+extern void abort (void);
+
+static __attribute__((noinline)) void foo (int a)
+{
+ int b = (a - 1) + INT_MIN;
+
+ if (b != INT_MIN)
+ abort ();
+}
+
+int main (void)
+{
+ foo (1);
+ return 0;
+}
--- /dev/null
+-- { dg-do run }
+-- { dg-options "-O2" }
+
+with Concat1_Pkg; use Concat1_Pkg;
+
+procedure Concat1 is
+
+ Ident_1 : Integer := Ident (1);
+ Ident_2 : Integer := Ident (2);
+ Ident_5 : Integer := Ident (5);
+
+ type Arr is array (Integer range <>) of Integer;
+ A : Arr (1..10);
+
+begin
+ A := (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+ A := 0 & A(Ident_1..Ident_2) & A(Ident_1..Ident_2) & A(Ident_1..Ident_5);
+ if A /= (0, 1, 2, 1, 2, 1, 2, 3, 4, 5) then
+ raise Program_Error;
+ end if;
+end;