public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Steven Bosscher <s.bosscher@student.tudelft.nl> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: c++/9712: [3.4 regression][New parser] __PRETTY_FUNCTION__ in function try block causes ICE Date: Tue, 18 Feb 2003 23:56:00 -0000 [thread overview] Message-ID: <20030218235600.9730.qmail@sources.redhat.com> (raw) The following reply was made to PR c++/9712; it has been noted by GNATS. From: Steven Bosscher <s.bosscher@student.tudelft.nl> To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-prs@gcc.gnu.org, vlukas@gmx.de Cc: jason@redhat.com Subject: Re: c++/9712: [3.4 regression][New parser] __PRETTY_FUNCTION__ in function try block causes ICE Date: 19 Feb 2003 00:46:41 +0100 --=-e7At5mt/gRPQ//Vd9jC3 Content-Type: text/plain Content-Transfer-Encoding: 7bit http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9712 This bug is apparently not a "New parser" bug. It disappears if I revert the following hunks from a series of patches applied by Jason in early January: 2003-01-02 Jason Merrill <jason@redhat.com> * c-common.c (finish_fname_decls): Put the DECL_STMTs inside the outermost scope. * c-decl.c (c_make_fname_decl): Push the decls there, too. * cp/decl.c (cp_make_fname_decl): Push the decls inside the outermost scope. The segfault happens in finish_fname_decls when it's looking for a COMPOUND_STMT that isn't there. Greetz Steven --=-e7At5mt/gRPQ//Vd9jC3 Content-Disposition: attachment; filename=regression.patch Content-Transfer-Encoding: quoted-printable Content-Type: text/x-patch; name=regression.patch; charset=ISO-8859-15 Index: c-common.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/gcc/gcc/gcc/c-common.c,v retrieving revision 1.394 retrieving revision 1.395 diff -c -3 -p -r1.394 -r1.395 *** c-common.c 16 Dec 2002 18:19:00 -0000 1.394 --- c-common.c 3 Jan 2003 19:29:47 -0000 1.395 *************** finish_fname_decls () *** 1050,1062 **** =20 if (body) { ! /* They were called into existence, so add to statement tree. */ ! body =3D chainon (body, ! TREE_CHAIN (DECL_SAVED_TREE (current_function_decl))); ! body =3D build_stmt (COMPOUND_STMT, body); ! =20 ! COMPOUND_STMT_NO_SCOPE (body) =3D 1; ! TREE_CHAIN (DECL_SAVED_TREE (current_function_decl)) =3D body; } =20 for (ix =3D 0; fname_vars[ix].decl; ix++) --- 1050,1067 ---- =20 if (body) { ! /* They were called into existence, so add to statement tree. Add ! the DECL_STMTs inside the outermost scope. */ ! tree *p =3D &DECL_SAVED_TREE (current_function_decl); ! /* Skip the dummy EXPR_STMT and any EH_SPEC_BLOCK. */ ! while (TREE_CODE (*p) !=3D COMPOUND_STMT) ! p =3D &TREE_CHAIN (*p); ! p =3D &COMPOUND_BODY (*p); ! if (TREE_CODE (*p) =3D=3D SCOPE_STMT) ! p =3D &TREE_CHAIN (*p); !=20 ! body =3D chainon (body, *p); ! *p =3D body; } =20 for (ix =3D 0; fname_vars[ix].decl; ix++) Index: decl.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/gcc/gcc/gcc/cp/decl.c,v retrieving revision 1.978 retrieving revision 1.980 diff -c -3 -p -r1.978 -r1.980 *** cp/decl.c 1 Jan 2003 03:16:14 -0000 1.978 --- cp/decl.c 3 Jan 2003 19:48:53 -0000 1.980 *************** cp_make_fname_decl (id, type_dep) *** 6656,6662 **** tree init =3D cp_fname_init (name); tree decl =3D build_decl (VAR_DECL, id, TREE_TYPE (init)); =20 ! /* As we don't push the decl here, we must set the context. */ DECL_CONTEXT (decl) =3D current_function_decl; DECL_PRETTY_FUNCTION_P (decl) =3D type_dep; =20 --- 6656,6662 ---- tree init =3D cp_fname_init (name); tree decl =3D build_decl (VAR_DECL, id, TREE_TYPE (init)); =20 ! /* As we're using pushdecl_with_scope, we must set the context. */ DECL_CONTEXT (decl) =3D current_function_decl; DECL_PRETTY_FUNCTION_P (decl) =3D type_dep; =20 *************** cp_make_fname_decl (id, type_dep) *** 6667,6672 **** --- 6667,6680 ---- =20 TREE_USED (decl) =3D 1; =20 + if (current_function_decl) + { + struct cp_binding_level *b =3D current_binding_level; + while (b->level_chain->parm_flag =3D=3D 0) + b =3D b->level_chain; + pushdecl_with_scope (decl, b); + }=09 +=20 cp_finish_decl (decl, init, NULL_TREE, LOOKUP_ONLYCONVERTING); =20 return decl; --=-e7At5mt/gRPQ//Vd9jC3--
next reply other threads:[~2003-02-18 23:56 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-02-18 23:56 Steven Bosscher [this message] -- strict thread matches above, loose matches on Subject: below -- 2003-02-17 23:48 bangerth
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=20030218235600.9730.qmail@sources.redhat.com \ --to=s.bosscher@student.tudelft.nl \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@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: linkBe 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).