[Bug ada/53747] New: Rep clause on index type makes 'access of aliased component an error when renaming

georggcc at googlemail dot com gcc-bugzilla@gcc.gnu.org
Thu Jun 21 20:04:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53747

             Bug #: 53747
           Summary: Rep clause on index type makes 'access of aliased
                    component an error when renaming
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: georggcc@googlemail.com


Given the package spec

package Aliasing is

   type I is ('a', 'b', 'c');
   for I use (11, 22, 33);              --!

   type T is range 1 .. 10;
   type Ary is array (I) of aliased T;
   type Ptr is access constant T;

   Vs : Ary;
   Nm : T renames Vs('b');
   X : Ptr := Nm'Access;

end Aliasing;

then only if the line marked --! is commented, the unit is fine.
Otherwise,

$ gnatmake -gnatwa -gnatv aliasing.ads
gcc -c -gnatwa -gnatv aliasing.ads

GNAT 4.8.0 20120621 (experimental)
Copyright 1992-2012, Free Software Foundation, Inc.

Compiling: aliasing.ads (source file time stamp: 2012-06-21 19:52:03)

==============Error messages for source file: aliasing.ads
--------------Line numbers from file: aliasing.ada (starting at line 1)
    12.    X : Ptr := Nm'Access;
                      |
        >>> prefix of "Access" attribute must be aliased

 15 lines: 1 error

I'd think this is an incorrect diagnosis.

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/Users/bauhaus/mine/libexec/gcc/x86_64-apple-darwin11.4.0/4.8.0/lto-wrapper
Target: x86_64-apple-darwin11.4.0
Configured with: /Users/bauhaus/src/gcc/configure --prefix=/Users/bauhaus/mine
--disable-nls --disable-multilib --disable-libstdcxx-pch
--enable-languages=c,ada,c++
Thread model: posix
gcc version 4.8.0 20120621 (experimental) (GCC) 

$ sw_vers 
ProductName:    Mac OS X
ProductVersion:    10.7.4
BuildVersion:    11E53



More information about the Gcc-bugs mailing list