public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/65625] [5 Regression] ICE in make_typename_type, at cp/decl.c:3499 Date: Mon, 30 Mar 2015 09:58:00 -0000 [thread overview] Message-ID: <bug-65625-4-oJtecok4Nq@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-65625-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65625 --- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> --- (In reply to Richard Biener from comment #1) > Can you make the testcase valid and still ICE? The issue is caused just in case of invalid code. Martin >From gcc-bugs-return-482233-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Mar 30 09:22:11 2015 Return-Path: <gcc-bugs-return-482233-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org> Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 5137 invoked by alias); 30 Mar 2015 09:22:11 -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 5104 invoked by uid 48); 30 Mar 2015 09:22:08 -0000 From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/65625] [5 Regression] ICE in make_typename_type, at cp/decl.c:3499 Date: Mon, 30 Mar 2015 10:04: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: 5.0 X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: <bug-65625-4-c1LJyzyDbZ@http.gcc.gnu.org/bugzilla/> In-Reply-To: <bug-65625-4@http.gcc.gnu.org/bugzilla/> References: <bug-65625-4@http.gcc.gnu.org/bugzilla/> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-03/txt/msg03377.txt.bz2 Content-length: 643 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65625 --- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> --- g++ 4.8.3 output: /home/marxin/Programming/seastar/1.ii:3:26: error: template declaration of ‘int std::declval’ template <typename> int declval; ^ /home/marxin/Programming/seastar/1.ii:5:16: error: ‘declval’ in namespace ‘std’ does not name a type typename std::declval<int> a; ^ /home/marxin/Programming/seastar/1.ii:5:23: error: expected unqualified-id before ‘<’ token typename std::declval<int> a; >From gcc-bugs-return-482234-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Mar 30 09:33:51 2015 Return-Path: <gcc-bugs-return-482234-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org> Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 83933 invoked by alias); 30 Mar 2015 09:33:51 -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 83864 invoked by uid 48); 30 Mar 2015 09:33:47 -0000 From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/65610] [5 Regression] Compare debug failure with -g3 -fsanitize=undefined -fno-sanitize=vptr -O3 Date: Mon, 30 Mar 2015 10:12:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: <bug-65610-4-OA2kS6oK8c@http.gcc.gnu.org/bugzilla/> In-Reply-To: <bug-65610-4@http.gcc.gnu.org/bugzilla/> References: <bug-65610-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-03/txt/msg03378.txt.bz2 Content-length: 4200 https://gcc.gnu.org/bugzilla/show_bug.cgi?ide610 --- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I've tried: --- gcc/ipa-polymorphic-call.c.jj 2015-03-09 08:05:06.000000000 +0100 +++ gcc/ipa-polymorphic-call.c 2015-03-30 11:24:48.280199943 +0200 @@ -513,6 +513,38 @@ contains_type_p (tree outer_type, HOST_W } +/* Return a FUNCTION_DECL if BLOCK represents a constructor or destructor. + If CHECK_CLONES is true, also check for clones of ctor/dtors. */ + +tree +ctor_dtor_block_p (tree block, bool check_clones) +{ + tree fn = BLOCK_ABSTRACT_ORIGIN (block); + if (fn == NULL || TREE_CODE (fn) != FUNCTION_DECL) + return NULL_TREE; + + if (TREE_CODE (TREE_TYPE (fn)) != METHOD_TYPE + || (!DECL_CXX_CONSTRUCTOR_P (fn) && !DECL_CXX_DESTRUCTOR_P (fn))) + { + if (!check_clones) + return NULL_TREE; + + /* Watch for clones where we constant propagated the first + argument (pointer to the instance). */ + fn = DECL_ABSTRACT_ORIGIN (fn); + if (!fn + || TREE_CODE (TREE_TYPE (fn)) != METHOD_TYPE + || (!DECL_CXX_CONSTRUCTOR_P (fn) && !DECL_CXX_DESTRUCTOR_P (fn))) + return NULL_TREE; + } + + if (flags_from_decl_or_type (fn) & (ECF_PURE | ECF_CONST)) + return NULL_TREE; + + return fn; +} + + /* We know that the instance is stored in variable or parameter (not dynamically allocated) and we want to disprove the fact that it may be in construction at invocation of CALL. @@ -552,28 +584,8 @@ decl_maybe_in_construction_p (tree base, for (tree block = gimple_block (call); block && TREE_CODE (block) == BLOCK; block = BLOCK_SUPERCONTEXT (block)) - if (BLOCK_ABSTRACT_ORIGIN (block) - && TREE_CODE (BLOCK_ABSTRACT_ORIGIN (block)) == FUNCTION_DECL) + if (tree fn = ctor_dtor_block_p (block, !base || is_global_var (base))) { - tree fn = BLOCK_ABSTRACT_ORIGIN (block); - - if (TREE_CODE (TREE_TYPE (fn)) != METHOD_TYPE - || (!DECL_CXX_CONSTRUCTOR_P (fn) - && !DECL_CXX_DESTRUCTOR_P (fn))) - { - /* Watch for clones where we constant propagated the first - argument (pointer to the instance). */ - fn = DECL_ABSTRACT_ORIGIN (fn); - if (!fn - || (base && !is_global_var (base)) - || TREE_CODE (TREE_TYPE (fn)) != METHOD_TYPE - || (!DECL_CXX_CONSTRUCTOR_P (fn) - && !DECL_CXX_DESTRUCTOR_P (fn))) - continue; - } - if (flags_from_decl_or_type (fn) & (ECF_PURE | ECF_CONST)) - continue; - tree type = TYPE_MAIN_VARIANT (method_class_type (TREE_TYPE (fn))); if (!outer_type || !types_odr_comparable (type, outer_type)) @@ -1163,15 +1175,7 @@ noncall_stmt_may_be_vtbl_ptr_store (gimp block = BLOCK_SUPERCONTEXT (block)) if (BLOCK_ABSTRACT_ORIGIN (block) && TREE_CODE (BLOCK_ABSTRACT_ORIGIN (block)) == FUNCTION_DECL) - { - tree fn = BLOCK_ABSTRACT_ORIGIN (block); - - if (flags_from_decl_or_type (fn) & (ECF_PURE | ECF_CONST)) - return false; - return (TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE - && (DECL_CXX_CONSTRUCTOR_P (fn) - || DECL_CXX_DESTRUCTOR_P (fn))); - } + return ctor_dtor_block_p (block, false); return (TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE && (DECL_CXX_CONSTRUCTOR_P (current_function_decl) || DECL_CXX_DESTRUCTOR_P (current_function_decl))); which I hope doesn't change ipa-polymorphic-call.c behavior, but before adjusting remove_unused_scope_block_p to also do else if (!cfun->after_inlining && ctor_dtor_block_p (scope, true)) unused = false; I've noticed that the noncall_stmt_may_be_vtbl_ptr_store call unfortunately doesn't care just about the cdtor blocks, but about all blocks where BLOCK_ABSTRACT_ORIGIN is a FUNCTION_DECL. Preserving all such blocks would be too costly for -g0 I guess; wonder if we e.g. could preserve in tree-ssa-live.c (!cfun->after_inlining ?) the ctor_dtor_block_p (scope, true) and also pass a bool with the return of that function down to the recursive remove_unused_scope_block_p calls and if that flag is true, preserve the outermost scope with FUNCTION_DECL block_abstract_origin there too.
next prev parent reply other threads:[~2015-03-30 9:21 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-03-30 9:11 [Bug c++/65625] New: " marxin at gcc dot gnu.org 2015-03-30 9:58 ` marxin at gcc dot gnu.org [this message] 2015-03-30 9:58 ` [Bug c++/65625] " rguenth at gcc dot gnu.org 2015-03-30 17:30 ` mpolacek at gcc dot gnu.org 2015-03-31 13:20 ` rguenth at gcc dot gnu.org 2015-04-01 22:59 ` jason at gcc dot gnu.org 2015-04-01 23:00 ` jason at gcc dot gnu.org 2015-04-02 16:43 ` jason at gcc dot gnu.org 2015-04-02 16:44 ` jason 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-65625-4-oJtecok4Nq@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: 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).