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

            Bug ID: 60703
           Summary: System.Address not preelaborable on MIPS
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jnrhp24 at jorisvr dot nl

Created attachment 32483
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32483&action=edit
demonstrate bug (fails compilation on MIPS)

== Summary ==

The type System.Address does not support preelaborable initialization on the
MIPS architecture. As a result, compilation of a preelaborated package fails if
it contains a variable of type System.Address.

On other architectures (i386, amd64), the same source code compiles
succesfully.

I know very little about Ada, but I believe that the language specifies that
System.Address must have pragma Preelaborable_Initialization in Ada2005.
http://www.adaic.org/resources/add_content/standards/05rat/html/Rat-7-7.html

== Command and error message ==

joris@qmips:~/q gnatmake -gnat05 a.ads
gcc-4.8 -c -gnat05 a.ads
a.ads:7:05: private object not allowed in preelaborated unit
a.ads:7:05: would be legal if pragma Preelaborable_Initialization given for
"Address" at system.ads:64
gnatmake: "a.ads" compilation error

Source file a.ads attached.
Contents of line 7: "hello: System.Address"

== Possible cause ==

Looking at the GCC source gcc-4.8.2/gcc/ada/system-linux-mips.ads I notice that
it does not contain a pragma Preelaborable_Initialization while, for example,
system-linux-x86.ads does contain that pragma.

Although I only tested with GCC 4.8.2, a casual look in GCC SVN suggests that
this problem still exists in the latest version.

== Version ==

joris@qmips:~ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/mips-linux-gnu/4.8/lto-wrapper
Target: mips-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.8.2-16'
--with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs
--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.8 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls
--with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap
--disable-libitm --disable-libsanitizer --disable-libquadmath --enable-plugin
--with-system-zlib --disable-browser-plugin --enable-java-awt=gtk
--enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-mips/jre
--enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-mips
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-mips
--with-arch-directory=mips --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-multiarch --with-arch-32=mips2 --with-tune-32=mips32
--enable-targets=all --with-arch-64=mips3 --with-tune-64=mips64
--enable-checking=release --build=mips-linux-gnu --host=mips-linux-gnu
--target=mips-linux-gnu
Thread model: posix
gcc version 4.8.2 (Debian 4.8.2-16)

Reply via email to