public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/26317]  New: Accessing array embedded in a record with representation clause
@ 2006-02-16 12:29 ben dot midgley at ultra-datel dot com
  2006-02-16 12:41 ` [Bug ada/26317] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: ben dot midgley at ultra-datel dot com @ 2006-02-16 12:29 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-11-01 20:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-16 12:29 [Bug ada/26317] New: Accessing array embedded in a record with representation clause ben dot midgley at ultra-datel dot com
2006-02-16 12:41 ` [Bug ada/26317] " pinskia at gcc dot gnu dot org
2006-02-16 12:43 ` pinskia at gcc dot gnu dot org
2006-02-16 13:13 ` ben dot midgley at ultra-datel dot com
2006-02-16 13:41 ` ben dot midgley at ultra-datel dot com
2006-02-20 14:22 ` ben dot midgley at ultra-datel dot com
2006-02-21  2:16 ` pinskia at gcc dot gnu dot org
2006-11-01 20:20 ` charlet at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).