[Bug ada/53766] New: ICE in build_binary_op when using pragma Suppress (All_Checks)

baldrick at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jun 25 10:36:00 GMT 2012


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

             Bug #: 53766
           Summary: ICE in build_binary_op when using pragma Suppress
                    (All_Checks)
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: baldrick@gcc.gnu.org


At a guess, the code that inserts runtime checks adds a need type conversion
that is forgotten when checks are suppressed.  I see this with gcc-4.7 and
with mainline.

$ gcc-4.8 -c p.adb
+===========================GNAT BUG DETECTED==============================+
| 4.8.0 20120624 (experimental) (x86_64-unknown-linux-gnu) GCC error:      |
| in build_binary_op, at ada/gcc-interface/utils2.c:1134                   |
| Error detected at p.adb:7:57                                             |
| 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.
Consider also -gnatd.n switch (see debug.adb).

p.adb
p.ads

compilation abandoned

-- chop here --

with System.Storage_Elements;
package P is
   procedure A (Offset : System.Storage_Elements.Storage_Offset);
end;

with Ada.Strings.Unbounded;
package body P is
   use System.Storage_Elements;
   procedure A (Offset : Storage_Offset) is
      pragma Suppress (All_Checks);
   begin
      if Offset +
Ada.Strings.Unbounded.Unbounded_String'Max_Size_In_Storage_Elements >= 123 then
         raise Program_Error;
      end if;
   end;
end;



More information about the Gcc-bugs mailing list