public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/17307] New: Bug box in Gigi, code=116, 'Unrestricted_Access of a protected subprogram
@ 2004-09-03 16:49 ludovic dot brenta at insalien dot org
  2004-10-12 21:59 ` [Bug ada/17307] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: ludovic dot brenta at insalien dot org @ 2004-09-03 16:49 UTC (permalink / raw)
  To: gcc-bugs

Reported to Debian (#269775) by Daniel Simon; I edited the test case slightly.

with Ada.Interrupts.Names;
procedure Test_269775 is
   pragma Unreserve_All_Interrupts;
   protected type Bla is
      procedure Sigint;
   end Bla;

   protected body Bla is
      procedure Sigint is
      begin
         null;
      end Sigint;
   end Bla;

   X : Bla;
begin
   Ada.Interrupts.Attach_Handler
     (New_Handler => X.Sigint'Unrestricted_Access,
      Interrupt => Ada.Interrupts.Names.SIGINT);
end Test_269775;

$ gcc -c test_269775.ads
+===========================GNAT BUG DETECTED==============================+
| 3.15p  (20020523) (i686-pc-linux-gnu) Gigi abort, Code=116               |
| Error detected at test_269775.adb:18:22                                  |
| Please submit bug report by email to report@gnat.com.                    |
| Use a subject line meaningful to you and us to track the bug.            |
| (include your customer number #nnn in the subject line).                 |
| 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).                   |
| (use plain ASCII or MIME attachment, or FTP to your customer directory). |
| See README.GNATPRO for full info on procedure for submitting bugs.       |
+==========================================================================+

Please include these source files with error report

test_269775.adb

compilation abandoned
gnatmake: "test_269775.adb" compilation error


I have confirmed this bug in Debian 3.15p-11, 3.4.0-1 and the binary
distribution of 3.15p from Ada Core.  The bug box is always the same.

I also tried to replace 'Unrestricted_Access with 'Unchecked_Access
and 'Access.

With 'Access, the program compiles but raises Program_Error with the
message "Trying to overwrite a static Interrupt Handler with a dynamic
Handler".  I think this is due to Linux; on a bare-board or real-time
kernel, this probably works.

With 'Unchecked_Access, the compiler says "attribute
"Unchecked_Access" cannot be applied to protected operation".  This is
correct as per RM 13.10(2, 5).

-- 
Ludovic Brenta.

-- 
           Summary: Bug box in Gigi, code=116, 'Unrestricted_Access of a
                    protected subprogram
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ludovic dot brenta at insalien dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug ada/17307] Bug box in Gigi, code=116, 'Unrestricted_Access of a protected subprogram
  2004-09-03 16:49 [Bug ada/17307] New: Bug box in Gigi, code=116, 'Unrestricted_Access of a protected subprogram ludovic dot brenta at insalien dot org
@ 2004-10-12 21:59 ` pinskia at gcc dot gnu dot org
  2005-01-11  2:47 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-12 21:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-12 21:59 -------
Confirmed on the mainline:
+===========================GNAT BUG 
DETECTED==============================+
| 4.0.0 20041012 (experimental) (powerpc-apple-darwin7.4.1) GCC error:     |
| in gnat_to_gnu_entity, at /ada/decl.c:286                                |
| Error detected at test_269775.adb:18:22                                  |
| Please submit a bug report; see http://gcc.gnu.org/bugs.html.            |
| 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).                   |
+==============================================================
============+

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|0000-00-00 00:00:00         |2004-10-12 21:59:06
               date|                            |


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug ada/17307] Bug box in Gigi, code=116, 'Unrestricted_Access of a protected subprogram
  2004-09-03 16:49 [Bug ada/17307] New: Bug box in Gigi, code=116, 'Unrestricted_Access of a protected subprogram ludovic dot brenta at insalien dot org
  2004-10-12 21:59 ` [Bug ada/17307] " pinskia at gcc dot gnu dot org
@ 2005-01-11  2:47 ` pinskia at gcc dot gnu dot org
  2005-01-12 10:41 ` charlet at adacore dot com
  2005-01-17 13:54 ` charlet at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-11  2:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-11 02:47 -------
Hmm, now I get on the mainline:
test_269775.adb:18:23: non-local pointer cannot point to local object
So this rejects valid now?

-- 


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug ada/17307] Bug box in Gigi, code=116, 'Unrestricted_Access of a protected subprogram
  2004-09-03 16:49 [Bug ada/17307] New: Bug box in Gigi, code=116, 'Unrestricted_Access of a protected subprogram ludovic dot brenta at insalien dot org
  2004-10-12 21:59 ` [Bug ada/17307] " pinskia at gcc dot gnu dot org
  2005-01-11  2:47 ` pinskia at gcc dot gnu dot org
@ 2005-01-12 10:41 ` charlet at adacore dot com
  2005-01-17 13:54 ` charlet at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: charlet at adacore dot com @ 2005-01-12 10:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From charlet at adacore dot com  2005-01-12 10:41 -------
Subject: Re:  Bug box in Gigi, code=116, 'Unrestricted_Access of a protected subprogram

> Hmm, now I get on the mainline:
> test_269775.adb:18:23: non-local pointer cannot point to local object
> So this rejects valid now?

Not really, since 'Unrestricted_Access is a GNAT specific attribute,
we can give it any semantic we like.

In this particular case, I do not think we want nor claim to support
access to nested protected procedure.

Instead, the code should be fixed to be valid Ada 95 and use 'Access
on a protected object declared at library level (= in a package).

Arno


-- 


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug ada/17307] Bug box in Gigi, code=116, 'Unrestricted_Access of a protected subprogram
  2004-09-03 16:49 [Bug ada/17307] New: Bug box in Gigi, code=116, 'Unrestricted_Access of a protected subprogram ludovic dot brenta at insalien dot org
                   ` (2 preceding siblings ...)
  2005-01-12 10:41 ` charlet at adacore dot com
@ 2005-01-17 13:54 ` charlet at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: charlet at gcc dot gnu dot org @ 2005-01-17 13:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From charlet at gcc dot gnu dot org  2005-01-17 13:54 -------
Bug box fixed on mainline, so closing.

Arno

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.0


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-01-17 13:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-03 16:49 [Bug ada/17307] New: Bug box in Gigi, code=116, 'Unrestricted_Access of a protected subprogram ludovic dot brenta at insalien dot org
2004-10-12 21:59 ` [Bug ada/17307] " pinskia at gcc dot gnu dot org
2005-01-11  2:47 ` pinskia at gcc dot gnu dot org
2005-01-12 10:41 ` charlet at adacore dot com
2005-01-17 13:54 ` charlet at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).