[Bug ada/66162] Bug box compiling Ada.Finalization with -gnatc

simon at pushface dot org gcc-bugzilla@gcc.gnu.org
Sun May 17 14:37:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66162

--- Comment #4 from simon at pushface dot org ---
(In reply to Eric Botcazou from comment #3)
> > People who want to write Ada for MCUs aren’t necessarily in the
> > high-integrity world; some would want to cram as much of the language as
> > possible into the RTS.
> 
> That's not the problem., just avoid using -gnatc on the runtime.

I see, sorry for the misunderstanding. That was the workround I had thought of.
The reason I used -gnatc is that the latest Emacs ada-mode doesn’t have a
compile-current-file, just check-current-file; and it’s worked for the rest of
the runtime!

That said, I get a very similar error compiling something that _uses_ the
runtime:

--  Copyright (C) Simon Wright <simon@pushface.org>

--  This unit is free software; you can redistribute it and/or modify it
--  as you wish. This unit is distributed in the hope that it will be
--  useful, but WITHOUT ANY WARRANTY; without even the implied warranty
--  of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

with Ada.Finalization;
package Finalizing is

   type F is new Ada.Finalization.Controlled with record
      V : Integer;
   end record;

   overriding
   procedure Adjust (Obj : in out F);

   overriding
   procedure Finalize (Obj : in out F);

end Finalizing;

results in

$ PATH=/opt/gcc-5.1.0/bin:$PATH gprbuild -P testbed -c -u -f -gnatc
finalizing.adb
arm-eabi-gcc -c -g -Og -gnatqQafoy -gnatwaL.X -gnatc finalizing.adb
+===========================GNAT BUG DETECTED==============================+
| 5.1.0 (arm-eabi) Constraint_Error erroneous memory access                |
| Error detected at finalizing.ads:19:4                                    |
| 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 command that you entered.                              |
| Also include sources listed below.                                       |
+==========================================================================+

where line 19 is the declaration of procedure Finalize.

Your suggested workround is OK for this too.


More information about the Gcc-bugs mailing list