[Bug ada/26306] New: Use of volatile array with bounds determined at run time.
I have included the configure, and build command below. This seems really easy to reproduce, create and array of integer values (I am unsure if integer is significant) the upper bound of which is determined by a function call declare the array as volatile +===GNAT BUG DETECTED==+ | 4.0.2 (i686-pc-cygwin) in tree_low_cst, at tree.c:3850 | | Error detected at mfd_transmitter.2.ada:540:9| | Please submit a bug report; see http://gcc.gnu.org/bugs.html.| | Include the entire contents of this bug box in the report. | | Include the exact gcc or gnatmake command that you entered. | | Also include sources listed below in gnatchop format | | (concatenated together with no headers between files). | +==+ This error can be avoided by using a fixed size array or removing the volatile from the array. gcc -c -g -fstack-check -gnata -gnato -gnatE -gnatf -I- -gnatA -x ada project_top.adb $ gcc -v Using built-in specs. Target: i686-pc-cygwin Configured with: ../gcc-4.0.2/configure --enable-languages=ada --disable-win32-registry Thread model: single gcc version 4.0.2 -- Summary: Use of volatile array with bounds determined at run time. Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ben dot midgley at ultra-datel dot com GCC build triplet: included in description GCC host triplet: included in description GCC target triplet: included in description http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26306
[Bug ada/26306] Use of volatile array with bounds determined at run time.
--- Comment #2 from ben dot midgley at ultra-datel dot com 2006-02-15 17:56 --- (In reply to comment #1) > Could you please send full sources to reproduce this problem ? thanks. > Arno Arno, what follows is a simple bit of code which causes the assertion failure described in tree.c, In constructing this it became apparent that the bug report should read use of volatile array, within a record, with bounds determined at run time. I hope this clarifies the issue. ---scratch.ada with system; with Interfaces.c; procedure scratch is -- to get a value for the upper bound of the array type my_Integer is range -2147483648 .. 2147483647; for my_Integer'Size use 32; function GetArrayUpperBound return my_integer is begin return 2; end GetArrayUpperBound; some_value : my_integer := GetArrayUpperBound; type Gp_Element_Type is record Element : Interfaces.C.Unsigned; end record; type some_type is array (1 .. some_value ) of Gp_Element_Type; type Aligned_Some_Type is record Value : aliased some_type; end record; for Aligned_Some_Type'Alignment use 8; an_aligned_type : aligned_Some_Type; my_address : system.address; -- remember volatile too pragma Volatile (an_aligned_type); begin my_address := an_aligned_type.value( 1 )'address; end scratch; -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26306
[Bug ada/26317] New: Accessing array embedded in a record with representation clause
Bellow is the source code, command line and error report which I have come accross. Tester is a nonsense package to demonstrate the problem, it appears only to fail when reading the array value but when assigning to the array it works fine. I have also seen this failure in version 3.4.2 (GNAT release) which is considerably older. -- command line instructions and error report $ gcc -c tester.adb +===GNAT BUG DETECTED==+ | 4.0.2 (i686-pc-cygwin) in expand_expr_addr_expr_1, at expr.c:6222| | Error detected at tester.adb:17:21 | | Please submit a bug report; see http://gcc.gnu.org/bugs.html.| | Include the entire contents of this bug box in the report. | | Include the exact gcc or gnatmake command that you entered. | | Also include sources listed below in gnatchop format | | (concatenated together with no headers between files). | +==+ Please include these source files with error report Note that list may not be accurate in some cases, so please double check that the problem can still be reproduced with the set of files listed. tester.adb tester.ads compilation abandoned -- tester.ads package tester is -- declare a small array subtype small_string_type is String (1 .. 3); -- which becomes the componenet of a record type some_string is record Trigram : small_string_type; end record; -- add representation clause for some_string use record Trigram at 0 range 20 .. 43; end record; -- and define a constant Null_Trigram : constant small_string_type := " "; -- obviously this code is a nonesense procedure scratch( some_string_instance : some_string ); end tester; -- tester.adb package body tester is -- obviously this code is a nones procedure scratch( some_string_instance : some_string ) is Valid : Boolean ; begin if some_string_instance.Trigram /= Null_Trigram then -- " " Valid := true; end if ; end scratch; end tester; -- gcc version information Using built-in specs. Target: i686-pc-cygwin Configured with: ../gcc-4.0.2/configure --enable-languages=ada --disable-win32-registry Thread model: single gcc version 4.0.2 -- Summary: Accessing array embedded in a record with representation clause Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ben dot midgley at ultra-datel dot com GCC host triplet: i686-pc-cygwin http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26317
[Bug ada/26318] New: Accessing array embedded in a record with representation clause
Bellow is the source code, command line and error report which I have come accross. Tester is a nonsense package to demonstrate the problem, it appears only to fail when reading the array value but when assigning to the array it works fine. I have also seen this failure in version 3.4.2 (GNAT release) which is considerably older. -- command line instructions and error report $ gcc -c tester.adb +===GNAT BUG DETECTED==+ | 4.0.2 (i686-pc-cygwin) in expand_expr_addr_expr_1, at expr.c:6222| | Error detected at tester.adb:17:21 | | Please submit a bug report; see http://gcc.gnu.org/bugs.html.| | Include the entire contents of this bug box in the report. | | Include the exact gcc or gnatmake command that you entered. | | Also include sources listed below in gnatchop format | | (concatenated together with no headers between files). | +==+ Please include these source files with error report Note that list may not be accurate in some cases, so please double check that the problem can still be reproduced with the set of files listed. tester.adb tester.ads compilation abandoned -- tester.ads package tester is -- declare a small array subtype small_string_type is String (1 .. 3); -- which becomes the componenet of a record type some_string is record Trigram : small_string_type; end record; -- add representation clause for some_string use record Trigram at 0 range 20 .. 43; end record; -- and define a constant Null_Trigram : constant small_string_type := " "; -- obviously this code is a nonesense procedure scratch( some_string_instance : some_string ); end tester; -- tester.adb package body tester is -- obviously this code is a nones procedure scratch( some_string_instance : some_string ) is Valid : Boolean ; begin if some_string_instance.Trigram /= Null_Trigram then -- " " Valid := true; end if ; end scratch; end tester; -- gcc version information Using built-in specs. Target: i686-pc-cygwin Configured with: ../gcc-4.0.2/configure --enable-languages=ada --disable-win32-registry Thread model: single gcc version 4.0.2 -- Summary: Accessing array embedded in a record with representation clause Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ben dot midgley at ultra-datel dot com GCC host triplet: i686-pc-cygwin http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26318
[Bug ada/26317] Accessing array embedded in a record with representation clause
--- Comment #3 from ben dot midgley at ultra-datel dot com 2006-02-16 13:13 --- Subject: RE: Accessing array embedded in a record with representation clause Hello Pinskia, I have raised this report this morning against gcc-4.2.0 which your response seems to indicate should not manifest the problem. Please can you clarify. Regards, Ben -Original Message- From: pinskia at gcc dot gnu dot org [mailto:[EMAIL PROTECTED] Sent: 16 February 2006 12:44 To: Ben Midgley Subject: [Bug ada/26317] Accessing array embedded in a record with representation clause ATTENTION This message has originated from outside the Ultra Electronics Datel network. Please ensure that any relevant QA activities are performed on the information included in this message and all interested recipients are informed of the information herein. Ultra Electronics Datel has the right lawfully to record, monitor and inspect messages between its employees and third parties. Your message shall be subject to such lawful supervision as Ultra Electronics Datel deems to be necessary in order to protect its information, its interests and reputation. --- Comment #2 from pinskia at gcc dot gnu dot org 2006-02-16 12:43 --- Fixed in 4.1.0 and above. -- pinskia at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||FIXED Target Milestone|--- |4.1.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26317 --- You are receiving this mail because: --- You reported the bug, or are watching the reporter. This e-mail from Ultra Electronics and any attachments to it are confidential to the intended recipient and may also be privileged. If you have received it in error please notify the sender and delete it from your system. If you are not the intended recipient you must not copy it or use it for any purpose nor disclose or distribute its contents to any other person. All communications may be subject to interception or monitoring for operational and/or security purposes. Please rely on your own virus checking as the sender cannot accept any liability for any damage arising from any bug or virus infection. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26317
[Bug ada/26317] Accessing array embedded in a record with representation clause
--- Comment #4 from ben dot midgley at ultra-datel dot com 2006-02-16 13:41 --- Subject: RE: Accessing array embedded in a record with representation clause Appologies just re-read, paying attention this time. -Original Message- From: pinskia at gcc dot gnu dot org [mailto:[EMAIL PROTECTED] Sent: 16 February 2006 12:44 To: Ben Midgley Subject: [Bug ada/26317] Accessing array embedded in a record with representation clause ATTENTION This message has originated from outside the Ultra Electronics Datel network. Please ensure that any relevant QA activities are performed on the information included in this message and all interested recipients are informed of the information herein. Ultra Electronics Datel has the right lawfully to record, monitor and inspect messages between its employees and third parties. Your message shall be subject to such lawful supervision as Ultra Electronics Datel deems to be necessary in order to protect its information, its interests and reputation. --- Comment #2 from pinskia at gcc dot gnu dot org 2006-02-16 12:43 --- Fixed in 4.1.0 and above. -- pinskia at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||FIXED Target Milestone|--- |4.1.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26317 --- You are receiving this mail because: --- You reported the bug, or are watching the reporter. This e-mail from Ultra Electronics and any attachments to it are confidential to the intended recipient and may also be privileged. If you have received it in error please notify the sender and delete it from your system. If you are not the intended recipient you must not copy it or use it for any purpose nor disclose or distribute its contents to any other person. All communications may be subject to interception or monitoring for operational and/or security purposes. Please rely on your own virus checking as the sender cannot accept any liability for any damage arising from any bug or virus infection. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26317
[Bug ada/26317] Accessing array embedded in a record with representation clause
--- Comment #5 from ben dot midgley at ultra-datel dot com 2006-02-20 14:21 --- I believe this is the same problem, if not it is a very similar and likely related problem. I have nested the data types from the first code into an array and have a similar message. $ gcc -v Using built-in specs. Target: i686-pc-cygwin Configured with: ../gcc-4.1-20060210/configure --disable-win32-registry --enable-languages=ada Thread model: single gcc version 4.1.0 20060210 (prerelease) $ gcc -c scratch.adb +===GNAT BUG DETECTED==+ | 4.1.0 20060210 (prerelease) (i686-pc-cygwin) GCC error: | | in expand_expr_addr_expr_1, at expr.c:6376 | | Error detected at scratch.adb:15:9 | | Please submit a bug report; see http://gcc.gnu.org/bugs.html.| | Use a subject line meaningful to you and us to track the bug.| | Include the entire contents of this bug box in the report. | | Include the exact gcc or gnatmake command that you entered. | | Also include sources listed below in gnatchop format | | (concatenated together with no headers between files). | +==+ Please include these source files with error report Note that list may not be accurate in some cases, so please double check that the problem can still be reproduced with the set of files listed. scratch.adb scratch.ads compilation abandoned - -- Begin scratch.ads package Scratch is subtype Trigram_Type is String (1 .. 3); type MyInteger is new Integer range 1..99; type MyRecordType is record Trigram : Trigram_Type; end record; for MyRecordType use record Trigram at 0 range 20 .. 43; end record; for MyRecordType'Size use 44; type MyTableType is array (MyInteger) of MyRecordType; pragma Pack (MyTableType); type MyDataType is record StudTable : MyTableType; end record; procedure Set ( Trigram : in Trigram_Type; NestedData : in out MyDataType ); end Scratch; -- end scratch.ads - -- begin scratch.adb package body Scratch is procedure Set ( Trigram : in Trigram_Type ; NestedData : in out MyDataType ) is Index : MyInteger := 1; begin if NestedData.StudTable(Index).Trigram = Trigram then Index:=2; end if; end Set; end Scratch; -- end scratch.adb -- ben dot midgley at ultra-datel dot com changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|FIXED | Version|4.2.0 |4.1.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26317