From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20285 invoked by alias); 19 May 2009 06:30:53 -0000 Received: (qmail 20237 invoked by uid 48); 19 May 2009 06:30:38 -0000 Date: Tue, 19 May 2009 06:30:00 -0000 Message-ID: <20090519063038.20236.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug ada/40185] Segmentation fault on legal program In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "ludovic at ludovic-brenta 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: 2009-05/txt/msg01604.txt.bz2 ------- Comment #1 from ludovic at ludovic-brenta dot org 2009-05-19 06:30 ------- There was a typo in the original program that I mistakenly corrected. This typo is the trigger for the bug: with Ada.Unchecked_Conversion; package Essai is type Attributed_Chararcter is record -- line 3 I : Integer; end record; type Video_Array is array (Integer range 0 .. 1) of Attributed_Character; type Video_Access is access Video_Array; function To_VA is new Ada.Unchecked_Conversion (Integer, Video_Access); Video : Video_Access := To_VA (0); -- line 9 end Essai; So, either correcting the typo at line 3 or removing line 9 prevents the segmentation fault: gnatmake essai.ads gcc-4.3 -c essai.ads gcc-4.3: Internal error: Segmentation fault (program gnat1) Please submit a full bug report. See for instructions. gnatmake: "essai.ads" compilation error Now comment out line 9: gnatmake essai.ads gcc-4.3 -c essai.ads essai.ads:6:56: "Attributed_Character" is undefined essai.ads:6:56: possible misspelling of "Attributed_Chararcter" gnatmake: "essai.ads" compilation error Now restore line 9 and correct the typo at line 3: gcc-4.3 -c essai.ads essai.ads:8:04: warning: types for unchecked conversion have different sizes -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40185