public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jason at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/13944] [3.3 Regression] exception in constructor of a class to be thrown is not caught
Date: Tue, 02 Mar 2004 20:54:00 -0000	[thread overview]
Message-ID: <20040302205452.8096.qmail@sources.redhat.com> (raw)
In-Reply-To: <20040131120212.13944.debian-gcc@lists.debian.org>


------- Additional Comments From jason at redhat dot com  2004-03-02 20:54 -------
Subject: Re:  [3.3 Regression] exception in constructor of a
 class to be thrown is not caught

On 2 Mar 2004 20:44:22 -0000, "gdr at integrable-solutions dot net" <gcc-bugzilla@gcc.gnu.org> wrote:

>   Do you think, the patch can be backported to gcc-3_3-branch?  It
> seems to be a  patch chasing party...  

Here's the backport; I'm testing it now.

*** except.c.~1~	2004-03-01 16:25:03.000000000 -0500
--- except.c	2004-03-02 14:57:22.000000000 -0500
*************** do_allocate_exception (type)
*** 511,519 ****
  					     NULL_TREE));
  }
  
! #if 0
! /* Call __cxa_free_exception from a cleanup.  This is never invoked
!    directly, but see the comment for stabilize_throw_expr.  */
  
  static tree
  do_free_exception (ptr)
--- 511,517 ----
  					     NULL_TREE));
  }
  
! /* Call __cxa_free_exception from a cleanup.  */
  
  static tree
  do_free_exception (ptr)
*************** do_free_exception (ptr)
*** 533,539 ****
  
    return build_function_call (fn, tree_cons (NULL_TREE, ptr, NULL_TREE));
  }
- #endif
  
  /* Wrap all cleanups for TARGET_EXPRs in MUST_NOT_THROW_EXPR.
     Called from build_throw via walk_tree_without_duplicates.  */
--- 531,536 ----
*************** build_throw (exp)
*** 669,674 ****
--- 666,672 ----
        tree object, ptr;
        tree tmp;
        tree temp_expr, allocate_expr;
+       bool elided;
  
        fn = get_identifier ("__cxa_throw");
        if (IDENTIFIER_GLOBAL_VALUE (fn))
*************** build_throw (exp)
*** 723,728 ****
--- 721,728 ----
        object = build1 (NOP_EXPR, build_pointer_type (TREE_TYPE (exp)), ptr);
        object = build_indirect_ref (object, NULL);
  
+       elided = (TREE_CODE (exp) == TARGET_EXPR);
+ 
        /* And initialize the exception object.  */
        exp = build_init (object, exp, LOOKUP_ONLYCONVERTING);
        if (exp == error_mark_node)
*************** build_throw (exp)
*** 731,737 ****
  	  return error_mark_node;
  	}
  
!       exp = build1 (MUST_NOT_THROW_EXPR, TREE_TYPE (exp), exp);
        /* Prepend the allocation.  */
        exp = build (COMPOUND_EXPR, TREE_TYPE (exp), allocate_expr, exp);
        if (temp_expr != void_zero_node)
--- 731,741 ----
  	  return error_mark_node;
  	}
  
!       if (elided)
! 	exp = build (TRY_CATCH_EXPR, void_type_node, exp,
! 		     do_free_exception (ptr));
!       else
! 	exp = build1 (MUST_NOT_THROW_EXPR, void_type_node, exp);
        /* Prepend the allocation.  */
        exp = build (COMPOUND_EXPR, TREE_TYPE (exp), allocate_expr, exp);
        if (temp_expr != void_zero_node)


-- 


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


  parent reply	other threads:[~2004-03-02 20:54 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-31 12:02 [Bug c++/13944] New: " debian-gcc at lists dot debian dot org
2004-02-02  2:10 ` [Bug c++/13944] [3.3/3.4/3.5] " giovannibajo at libero dot it
2004-02-02  7:43 ` pinskia at gcc dot gnu dot org
2004-02-02 23:18 ` bangerth at dealii dot org
2004-02-15 12:43 ` gdr at gcc dot gnu dot org
2004-02-16  3:07 ` mmitchel at gcc dot gnu dot org
2004-02-16  4:09 ` [Bug c++/13944] [3.3/3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
2004-02-16 18:22 ` jason at redhat dot com
2004-02-16 18:27 ` jason at redhat dot com
2004-02-24 18:30 ` cvs-commit at gcc dot gnu dot org
2004-02-24 18:30 ` cvs-commit at gcc dot gnu dot org
2004-02-24 19:57 ` gdr at integrable-solutions dot net
2004-03-02 11:10 ` [Bug c++/13944] [3.3/3.4 " steven at gcc dot gnu dot org
2004-03-02 17:17 ` jason at redhat dot com
2004-03-02 19:57 ` cvs-commit at gcc dot gnu dot org
2004-03-02 20:30 ` [Bug c++/13944] [3.3 " pinskia at gcc dot gnu dot org
2004-03-02 20:44 ` gdr at integrable-solutions dot net
2004-03-02 20:54 ` jason at redhat dot com [this message]
2004-03-02 21:06 ` gdr at integrable-solutions dot net
2004-03-03  7:40 ` cvs-commit at gcc dot gnu dot org
2004-03-03 16:28 ` pinskia at gcc dot gnu dot 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=20040302205452.8096.qmail@sources.redhat.com \
    --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).