public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/64548] New: Lost visibility of package System after raise
@ 2015-01-09  7:24 simon at pushface dot org
  2015-01-10 20:44 ` [Bug ada/64548] " simon at pushface dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: simon at pushface dot org @ 2015-01-09  7:24 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64548
           Summary: Lost visibility of package System after raise
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: simon at pushface dot org

Created attachment 34410
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34410&action=edit
Reproducer (to be gnatchopped)

In the attached, a raise statement with a string expression causes the compiler
to lose visibility of package System.

In this cut-down reproducer, removing the string expression makes the problem
go away; however this workround doesn’t work in the full code.

Same problem in GCC 4.8, 4.9 & GNAT GPL 2013, 2014.

I found the problem while compiling for arm-eabi but this also happens for
x86_64-apple-darwin13 and with the Linux GNAT GPL 2013.

     4.    function Create_Task
     5.      (Code        : Task_Code;
     6.       Name        : String;
     7.       Stack_Depth : Natural;
     8.       Parameters  : System.Address;
     9.       Priority    : System.Any_Priority)
    10.      return Task_Handle is
    11.    begin
    12.       raise Program_Error with "couldn't create task";
    13.
    14.       return Null_Task_Handle;
    15.    end Create_Task;
    16.
    17.    function Get_Application_Parameter return System.Address is
                    1                                3
        >>> not type conformant with declaration at buggy_freertos.ads:19
        >>> return type does not match
        >>> "System" is not visible (more references follow)
        >>> non-visible declaration at system.ads:55

Using -gnatdg shows
      $ada__exceptions__raise_exception (ada__exceptions__null_id,
        "couldn't create task");
>From gcc-bugs-return-472557-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jan 09 08:18:19 2015
Return-Path: <gcc-bugs-return-472557-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 21433 invoked by alias); 9 Jan 2015 08:18:18 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 21380 invoked by uid 48); 9 Jan 2015 08:18:08 -0000
From: "bruck.michael at googlemail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/56126] -fno-exceptions should activate -fcheck-new or issue diagnostic for all new operators without throw()
Date: Fri, 09 Jan 2015 08:18:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.6.3
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: bruck.michael at googlemail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-56126-4-iMynXc9ih8@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-56126-4@http.gcc.gnu.org/bugzilla/>
References: <bug-56126-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-01/txt/msg00551.txt.bz2
Content-length: 685

https://gcc.gnu.org/bugzilla/show_bug.cgi?idV126

--- Comment #14 from Michael Bruck <bruck.michael at googlemail dot com> ---
(In reply to Olaf van der Spek from comment #12)
> > Allocation failure is a
> > simple error and should not kill your program.
>
> It's far from simple to handle properly and to do better then abort.

In systems that use different types of allocators for different purposes it can
be a fairly common case.

> >> BTW, what's your use case? Do you really want to check NULL on every
> >> call to new?
> >
> > With -fno-exceptions you have to check all functions for errors, including
> > allocation.
>
> What's your use case?

Memory constrained systems


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

end of thread, other threads:[~2015-02-16 17:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-09  7:24 [Bug ada/64548] New: Lost visibility of package System after raise simon at pushface dot org
2015-01-10 20:44 ` [Bug ada/64548] " simon at pushface dot org
2015-02-15 16:39 ` simon at pushface dot org
2015-02-16 17:47 ` demoonlit at panathenaia dot halfmoon.jp

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).