The example below raises an UNRECOVERABLE_ERROR when compiled with
optimization:

gcc -c -O adr.adb

This seems to be a regression in snapshot 4.3.0-20080201. It is working in
4.3.0-20080111 and older releases like 4.2.3.

adr.adb
================================================
pragma Extend_System(AUX_DEC);
with SYSTEM;

procedure ADR is

   function Y(E : in INTEGER) return STRING is
   begin
      return "";
   end Y;

   function X(C : in SYSTEM.ADDRESS) return STRING is
      D : INTEGER;
      for D use at C;
   begin
      return Y(D);
   end X;

   A : SYSTEM.ADDRESS;
   B : STRING := "";

begin
   for I in 0..1 loop
      B := X(SYSTEM."+"(A, I));
   end loop;
end ADR;
================================================


-- 
           Summary: [Ada] ICE caused by address calculation with loop
                    variable when optimization is on
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: markus dot heichel at comsoft dot de
 GCC build triplet: i686-pc-linux
  GCC host triplet: i686-pc-linux
GCC target triplet: i686-pc-linux


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

Reply via email to