public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/56868] Constexpr example in 7.1.5/5 fails to compile correctly
Date: Sun, 07 Apr 2013 21:32:00 -0000	[thread overview]
Message-ID: <bug-56868-4-yp7NRmuOfA@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-56868-4@http.gcc.gnu.org/bugzilla/>


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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #6 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2013-04-07 21:32:46 UTC ---
IMO this behaviour should be considered in the light of

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#903

Assuming the P/R of this issue becomes accepted, both

static_assert(g2(0) == 1, "g2 failed");
static_assert(g3(0) == 1, "g3 failed");

should fail.
>From gcc-bugs-return-419438-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Apr 07 21:55:37 2013
Return-Path: <gcc-bugs-return-419438-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 20861 invoked by alias); 7 Apr 2013 21:55:37 -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 20343 invoked by uid 48); 7 Apr 2013 21:55:30 -0000
From: "js-gcc at webkeks dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug objc/56870] New: @catch handler broken with SEH
Date: Sun, 07 Apr 2013 21:55:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: objc
X-Bugzilla-Keywords:
X-Bugzilla-Severity: blocker
X-Bugzilla-Who: js-gcc at webkeks dot org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Changed-Fields:
Message-ID: <bug-56870-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
MIME-Version: 1.0
X-SW-Source: 2013-04/txt/msg00583.txt.bz2
Content-length: 1568


http://gcc.gnu.org/bugzilla/show_bug.cgi?idV870

             Bug #: 56870
           Summary: @catch handler broken with SEH
    Classification: Unclassified
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: objc
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: js-gcc@webkeks.org


When trying to use ObjC exceptions with the new SEH support, the caught object
is not the ObjC object, but the _Unwind_Exception instead. Example:

@try {
    id e = [Object new];
    printf("@throw %p\n", e);
    @throw e;
} @catch (id e) {
    printf("@catch %p\n", e);
    @throw e;
}

Expected behaviour: Both are the same pointer.
Observed behaviour: They differ.

Looking further into it, the second pointer is the pointer to the
_Unwind_Exception (I added debug code in objc_exception_throw that outputs the
pointer after the malloc. It is always the same that's received in the catch).

So it seems the generated landing pad for ObjC code is wrong when using SEH. I
think it is correct that the landing pad receives the _Unwind_Exception and not
the ObjC object. But the landing pad needs to get the ObjC exception out of the
_Unwind_Exception and give that back to the user instead of the
_Unwind_Exception, which the user should never see.

This seems to happen not only with 4.8, but also with 4.9.

I marked this bug as blocker, as 4.8 made SEH the default, effectively breaking
ObjC execptions on Windows.


  parent reply	other threads:[~2013-04-07 21:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-07 18:36 [Bug c++/56868] New: " g++bug at oxyware dot com
2013-04-07 18:39 ` [Bug c++/56868] " g++bug at oxyware dot com
2013-04-07 18:42 ` redi at gcc dot gnu.org
2013-04-07 18:51 ` pinskia at gcc dot gnu.org
2013-04-07 19:41 ` paolo.carlini at oracle dot com
2013-04-07 20:57 ` pinskia at gcc dot gnu.org
2013-04-07 21:10 ` paolo.carlini at oracle dot com
2013-04-07 21:32 ` daniel.kruegler at googlemail dot com [this message]
2015-04-27 17:48 ` ktietz at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-56868-4-yp7NRmuOfA@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).