From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26617 invoked by alias); 4 Jan 2010 23:33:17 -0000 Received: (qmail 26593 invoked by uid 48); 4 Jan 2010 23:33:07 -0000 Date: Mon, 04 Jan 2010 23:33:00 -0000 Subject: [Bug ada/42618] New: Problem reading discriminated values from streams X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "simon at pushface dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-01/txt/msg00468.txt.bz2 The test program writes 3 values of a discriminated record to a stream ('Output) and then reads them back ('Input). It then uses 'Write and 'Read for a single value. No problem arises with 32-bit compilations, or with 64-bit compilations with -O0. With -O1 or -O2, the values read back are incorrect (in some cases). Same behaviour reported on Debian: gnat-4.4_4.4.2-5_amd64.deb: -O0 OK -O1 bug -O2 bug gnat-4.4_4.4.2-5_i386.deb: -O0 OK -O1 OK -O2 OK That version of GNAT was taken from the FSF's gcc-4_4-branch on 2009-12-28 so is very recent. The correct output is 1234 'z' 4.32100E-01 4.32100E-01 The incorrect output is 1234 NUL 0.00000E+00 0.00000E+00 -- Summary: Problem reading discriminated values from streams Product: gcc Version: 4.4.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: simon at pushface dot org GCC host triplet: x86_64-apple-darwin10 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42618