From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7926 invoked by alias); 27 Feb 2013 17:41:58 -0000 Received: (qmail 5953 invoked by uid 48); 27 Feb 2013 17:41:07 -0000 From: "pavel at zhukoff dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/56474] New: GNAT computes size of the object to be allocated incorrectly Date: Wed, 27 Feb 2013 17:41:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ada X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: pavel at zhukoff dot net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2013-02/txt/msg02607.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56474 Bug #: 56474 Summary: GNAT computes size of the object to be allocated incorrectly Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: critical Priority: P3 Component: ada AssignedTo: unassigned@gcc.gnu.org ReportedBy: pavel@zhukoff.net 100% reproducible Smaller reproducer: with Ada.Streams; package Pkg is use type Ada.Streams.Stream_Element_Offset; type Vector (Size : Ada.Streams.Stream_Element_Offset) is record Value : Ada.Streams.Stream_Element_Array (0 .. Size); end record; Empty_Vector : Vector (-1); end Pkg; with Pkg; procedure Bbb is begin null; end Bbb; $ gnatmake bbb gcc -c bbb.adb gcc -c pkg.ads pkg.ads:10:04: warning: "Storage_Error" will be raised at run time gnatbind -x bbb.ali gnatlink bbb.ali $ ./bbb raised STORAGE_ERROR : object too large