This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix PR testsuite/64712


It's an uninitialized variable in a testcase I added back in 2008 that had 
been silent until we started to generate overflow checks by default.

Tested on x86_64-suse-linux, applied on the mainline and 4.9 branch.


2015-01-26  Eric Botcazou  <ebotcazou@adacore.com>

	PR testsuite/64712
	* gnat.dg/unchecked_convert1.adb (Unchecked_Convert1): Initialize A.


-- 
Eric Botcazou
Index: gnat.dg/unchecked_convert1.adb
===================================================================
--- gnat.dg/unchecked_convert1.adb	(revision 220008)
+++ gnat.dg/unchecked_convert1.adb	(working copy)
@@ -4,6 +4,7 @@
 with Ada.Unchecked_Conversion;
 
 procedure Unchecked_Convert1 is
+
   type Byte is mod 2**8;
 
   type Stream is array (Natural range <>) of Byte;
@@ -24,9 +25,10 @@ procedure Unchecked_Convert1 is
     return Do_Sum (To_Chunk (S(S'First ..  S'First + Rec'Size / 8 - 1)));
   end;
 
-  A : Stream (1..9);
+  A : Stream (1..9) := (others => 0);
   I : Integer;
 
 begin
+  A (9) := 1;
   I := Sum (A(1..8));
 end;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]