public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/63587] [5 Regression] ICE : tree check: expected var_decl, have result_decl in add_local_variables, at tree-inline.c:4112 Date: Thu, 23 Oct 2014 13:22:00 -0000 [thread overview] Message-ID: <bug-63587-4-Vz21Wvqvb3@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-63587-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63587 --- Comment #7 from rguenther at suse dot de <rguenther at suse dot de> --- On Thu, 23 Oct 2014, marxin at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63587 > > --- Comment #5 from marxin at gcc dot gnu.org --- > (In reply to rguenther@suse.de from comment #4) > > On Sun, 19 Oct 2014, mliska at suse dot cz wrote: > > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63587 > > > > > > --- Comment #2 from Martin Liška <mliska at suse dot cz> --- > > > Following two functions are merged: > > > static boost::log::make_output_actor<ActorT<LeftExprT>, RightT, ValueT>::type > > > boost::log::make_output_actor<ActorT<LeftExprT>, RightT, > > > ValueT>::make(ActorT<LeftExprT>, RightT&) [with ActorT = boost::actor; > > > LeftExprT = int; RightT = boost::log::attribute_actor<int, > > > boost::log::value_extractor, void, boost::actor>; ValueT = int; > > > boost::log::make_output_actor<ActorT<LeftExprT>, RightT, ValueT>::type = > > > boost::actor<boost::log::attribute_output_terminal<boost::actor<int>, > > > boost::log::to_log_fun> >] (struct actor left, struct attribute_actor & right) > > > > > > > > > static boost::log::make_output_actor<ActorT<LeftExprT>, RightT, ValueT>::type > > > boost::log::make_output_actor<ActorT<LeftExprT>, RightT, > > > ValueT>::make(ActorT<LeftExprT>, RightT&) [with ActorT = boost::actor; > > > LeftExprT = int; RightT = boost::log::attribute_actor<{anonymous}::my_class, > > > boost::log::value_extractor, void, boost::actor>; ValueT = int; > > > boost::log::make_output_actor<ActorT<LeftExprT>, RightT, ValueT>::type = > > > boost::actor<boost::log::attribute_output_terminal<boost::actor<int>, > > > boost::log::to_log_fun> >] (struct actor left, struct attribute_actor & right) > > > > > > with following body: > > > { > > > struct type D.3826; > > > struct to_log_fun D.3825; > > > struct attribute_name D.3824; > > > int SR.9; > > > struct actor left; > > > > > > <bb 2>: > > > left = left; > > > SR.9_4 = MEM[(struct attribute_terminal *)right_2(D)]; > > > MEM[(struct attribute_name *)&D.3824] = SR.9_4; > > > boost::log::attribute_output_terminal<boost::actor<int>, > > > boost::log::to_log_fun>::attribute_output_terminal<int> (&D.3826, left, D.3824, > > > D.3825, 0); > > > D.3826 ={v} {CLOBBER}; > > > return; > > > > > > } > > > > > > > > > > > > As I was debugging ao_ref_alias_sets, there's MEM_REF where we have different > > > template arguments: attribute_actor<int,...> vs. > > > attribute_actor<{anonymous}::my_class,...>. > > > What do you think Richard about these record_types from alias set perspective: > > > > > > (gdb) p debug_tree(t1) > > > <mem_ref 0x7ffff6ab4000 > > > type <integer_type 0x7ffff6c33690 int public type_6 SI > > > size <integer_cst 0x7ffff6c51048 constant 32> > > > unit size <integer_cst 0x7ffff6c51060 constant 4> > > > align 32 symtab 0 alias set 4 canonical type 0x7ffff6c33690 precision > > > 32 min <integer_cst 0x7ffff6c51000 -2147483648> max <integer_cst 0x7ffff6c51018 > > > 2147483647> > > > pointer_to_this <pointer_type 0x7ffff6c55738>> > > > > > > arg 0 <ssa_name 0x7ffff6aae678 > > > type <reference_type 0x7ffff6e20d20 type <record_type 0x7ffff6de7dc8 > > > attribute_actor> > > > unsigned DI > > > size <integer_cst 0x7ffff6c2fdf8 constant 64> > > > unit size <integer_cst 0x7ffff6c2fe10 constant 8> > > > align 64 symtab 0 alias set 7 canonical type 0x7ffff6e20d20> > > > visited var <parm_decl 0x7ffff6e1eb00 right>def_stmt GIMPLE_NOP > > > > > > version 2 > > > ptr-info 0x7ffff6a7e3d8> > > > arg 1 <integer_cst 0x7ffff6a4ee28 type <pointer_type 0x7ffff6dbfa80> > > > constant 0>> > > > $1 = void > > > (gdb) p debug_tree(t2) > > > <mem_ref 0x7ffff6aa1ac8 > > > type <integer_type 0x7ffff6c33690 int public type_6 SI > > > size <integer_cst 0x7ffff6c51048 constant 32> > > > unit size <integer_cst 0x7ffff6c51060 constant 4> > > > align 32 symtab 0 alias set 4 canonical type 0x7ffff6c33690 precision > > > 32 min <integer_cst 0x7ffff6c51000 -2147483648> max <integer_cst 0x7ffff6c51018 > > > 2147483647> > > > pointer_to_this <pointer_type 0x7ffff6c55738>> > > > > > > arg 0 <ssa_name 0x7ffff6a77dc8 > > > type <reference_type 0x7ffff6e20540 type <record_type 0x7ffff6ddd888 > > > attribute_actor> > > > unsigned DI > > > size <integer_cst 0x7ffff6c2fdf8 constant 64> > > > unit size <integer_cst 0x7ffff6c2fe10 constant 8> > > > align 64 symtab 0 alias set 7 canonical type 0x7ffff6e20540> > > > visited var <parm_decl 0x7ffff6e1ea00 right>def_stmt GIMPLE_NOP > > > > > > version 2 > > > ptr-info 0x7ffff6a7e300> > > > arg 1 <integer_cst 0x7ffff6a4ee28 type <pointer_type 0x7ffff6dbfa80> > > > constant 0>> > > > > > > these types are called for alias_set comparison, with following record_types: > > > (gdb) p debug_tree((tree_node*)0x7ffff6de7dc8) > > > <record_type 0x7ffff6de7dc8 attribute_actor needs-constructing type_5 type_6 > > > SI > > > size <integer_cst 0x7ffff6c51048 type <integer_type 0x7ffff6c33150 > > > bitsizetype> constant 32> > > > unit size <integer_cst 0x7ffff6c51060 type <integer_type 0x7ffff6c330a8 > > > sizetype> constant 4> > > > align 32 symtab 0 alias set 17 canonical type 0x7ffff6de7dc8 > > > fields <field_decl 0x7ffff6de4ed8 D.2798 > > > type <record_type 0x7ffff6dddb28 actor needs-constructing type_5 type_6 > > > SI size <integer_cst 0x7ffff6c51048 32> unit size <integer_cst 0x7ffff6c51060 > > > 4> > > > align 32 symtab 0 alias set 15 canonical type 0x7ffff6dddb28 fields > > > <field_decl 0x7ffff6de01c8 proto_expr_> context <namespace_decl 0x7ffff6d8d2f8 > > > boost> > > > full-name "struct boost::actor<boost::log::attribute_terminal>" > > > needs-constructor X() X(constX&) this=(X&) n_parents=0 > > > use_template=1 interface-unknown > > > pointer_to_this <pointer_type 0x7ffff6e03930> reference_to_this > > > <reference_type 0x7ffff6dff0a8> chain <type_decl 0x7ffff6de0098 actor>> > > > ignored decl_6 SI file ../../PR33754.c line 167 col 7 size <integer_cst > > > 0x7ffff6c51048 32> unit size <integer_cst 0x7ffff6c51060 4> > > > align 32 offset_align 128 > > > offset <integer_cst 0x7ffff6c2fe28 constant 0> > > > bit offset <integer_cst 0x7ffff6c2fe70 constant 0> context <record_type > > > 0x7ffff6de7dc8 attribute_actor> > > > chain <type_decl 0x7ffff6de4da8 attribute_actor type <record_type > > > 0x7ffff6de80a8 attribute_actor> > > > external nonlocal suppress-debug decl_4 VOID file ../../PR33754.c > > > line 168 col 1 > > > align 8 context <record_type 0x7ffff6de7dc8 attribute_actor> result > > > <record_type 0x7ffff6de7dc8 attribute_actor> > > > chain <type_decl 0x7ffff6de4e40 value_type>>> context > > > <namespace_decl 0x7ffff6dbec78 log> > > > full-name "class boost::log::attribute_actor<int, > > > boost::log::value_extractor, void, boost::actor>" > > > needs-constructor X() X(constX&) this=(X&) n_parents=1 use_template=1 > > > interface-unknown > > > pointer_to_this <pointer_type 0x7ffff6de81f8> reference_to_this > > > <reference_type 0x7ffff6e20d20> chain <type_decl 0x7ffff6de4d10 > > > attribute_actor>> > > > $3 = void > > > (gdb) p debug_tree((tree_node*)0x7ffff6ddd888) > > > <record_type 0x7ffff6ddd888 attribute_actor needs-constructing type_5 type_6 > > > SI > > > size <integer_cst 0x7ffff6c51048 type <integer_type 0x7ffff6c33150 > > > bitsizetype> constant 32> > > > unit size <integer_cst 0x7ffff6c51060 type <integer_type 0x7ffff6c330a8 > > > sizetype> constant 4> > > > align 32 symtab 0 alias set 14 canonical type 0x7ffff6ddd888 > > > fields <field_decl 0x7ffff6de0b48 D.2756 > > > type <record_type 0x7ffff6dddb28 actor needs-constructing type_5 type_6 > > > SI size <integer_cst 0x7ffff6c51048 32> unit size <integer_cst 0x7ffff6c51060 > > > 4> > > > align 32 symtab 0 alias set 15 canonical type 0x7ffff6dddb28 fields > > > <field_decl 0x7ffff6de01c8 proto_expr_> context <namespace_decl 0x7ffff6d8d2f8 > > > boost> > > > full-name "struct boost::actor<boost::log::attribute_terminal>" > > > needs-constructor X() X(constX&) this=(X&) n_parents=0 > > > use_template=1 interface-unknown > > > pointer_to_this <pointer_type 0x7ffff6e03930> reference_to_this > > > <reference_type 0x7ffff6dff0a8> chain <type_decl 0x7ffff6de0098 actor>> > > > ignored decl_6 SI file ../../PR33754.c line 167 col 7 size <integer_cst > > > 0x7ffff6c51048 32> unit size <integer_cst 0x7ffff6c51060 4> > > > align 32 offset_align 128 > > > offset <integer_cst 0x7ffff6c2fe28 constant 0> > > > bit offset <integer_cst 0x7ffff6c2fe70 constant 0> context <record_type > > > 0x7ffff6ddd888 attribute_actor> > > > chain <type_decl 0x7ffff6de0a18 attribute_actor type <record_type > > > 0x7ffff6de12a0 attribute_actor> > > > external nonlocal suppress-debug decl_4 VOID file ../../PR33754.c > > > line 168 col 1 > > > align 8 context <record_type 0x7ffff6ddd888 attribute_actor> result > > > <record_type 0x7ffff6ddd888 attribute_actor> > > > chain <type_decl 0x7ffff6de0ab0 value_type>>> context > > > <namespace_decl 0x7ffff6dbec78 log> > > > full-name "class boost::log::attribute_actor<{anonymous}::my_class, > > > boost::log::value_extractor, void, boost::actor>" > > > needs-constructor X() X(constX&) this=(X&) n_parents=1 use_template=1 > > > interface-unknown > > > pointer_to_this <pointer_type 0x7ffff6de13f0> reference_to_this > > > <reference_type 0x7ffff6e20540> chain <type_decl 0x7ffff6dd2ed8 > > > attribute_actor>> > > > > > > If the alias sets can be considered to be equal, we must face some latent bug > > > in inliner? > > > > Maybe. Btw, I see some issues in func_checker::compare_operand with > > regard to it doing redundant checks: > > > > if (!func_checker::compatible_types_p (TREE_TYPE (x1), TREE_TYPE > > (x2))) > > return return_false (); > > > > Redundant with the following > > > > if (!compare_operand (x1, x2)) > > return return_false_with_msg (""); > > > > ... > > > > if (get_alias_set (TREE_TYPE (y1)) != get_alias_set (TREE_TYPE > > (y2))) > > return return_false_with_msg ("alias set for MEM_REF offsets are > > different"); > > > > Redundant with the following > > > > ao_ref r1, r2; > > ao_ref_init (&r1, t1); > > ao_ref_init (&r2, t2); > > if (ao_ref_alias_set (&r1) != ao_ref_alias_set (&r2) > > || ao_ref_base_alias_set (&r1) != ao_ref_base_alias_set (&r2)) > > return return_false_with_msg ("ao alias sets are different"); > > > > > > /* Type of the offset on MEM_REF does not matter. */ > > return wi::to_offset (y1) == wi::to_offset (y2); > > > > Use tree_int_cst_equal (y1, y2). > > > > case COMPONENT_REF: > > { > > x1 = TREE_OPERAND (t1, 0); > > x2 = TREE_OPERAND (t2, 0); > > y1 = TREE_OPERAND (t1, 1); > > y2 = TREE_OPERAND (t2, 1); > > > > ret = compare_operand (x1, x2) > > && compare_operand (y1, y2); > > > > comparing FIELD_DECLs like you do looks dangerous to me (and it looks > > redundant with the get_addr_base_and_unit_offset you do - which btw > > also defeats the ao_ref alias checks as you effectively drop the > > get_alias_set () compare). > > > > IMHO folding memory access comparison and general operand comparison > > into one function makes it very much less clear what is going on... > > > > So - can you please split this into the general compare_operand > > and a compare_memory_access function? > > Hello Richard. > > I agree with suggested refactoring, I've got almost working version that I need > to regtest. > Anyway, the problem of the issue is that the pass creates a thunk: > > static boost::log::make_output_actor<ActorT<LeftExprT>, RightT, ValueT>::type > boost::log::make_output_actor<ActorT<LeftExprT>, RightT, > ValueT>::make(ActorT<LeftExprT>, RightT&) [with ActorT = boost::actor; > LeftExprT = int; RightT = boost::log::attribute_actor<{anonymous}::my_class, > boost::log::value_extractor, void, boost::actor>; ValueT = int; > boost::log::make_output_actor<ActorT<LeftExprT>, RightT, ValueT>::type = > boost::actor<boost::log::attribute_output_terminal<boost::actor<int>, > boost::log::to_log_fun> >] (struct actor left, struct attribute_actor & right) > { > struct type <retval>; > > <bb 2>: > <retval> = boost::log::make_output_actor<boost::actor<int>, > boost::log::attribute_actor<int, boost::log::value_extractor, void, > boost::actor>, int>::make (left, right_2(D)); [tail call] > return <retval>; > > } > > At cgraphunit.c:1547 (expand_thunk) we add result_decl to local_decl: > add_local_decl (cfun, restmp); > > Remapping code in add_local_variable contains predicate DECL_HAS_DEBUG_EXPR_P > (var), where TREE_CODE(var) == RESULT_DECL. > Question is if either local_decl should never contain RESULT_DECL or just > addition of TREE_CODE(var) == VAR_DECL to the problematic condition would be > enough? local_decl should never contain RESULT_DECL. Richard. >From gcc-bugs-return-464746-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Oct 23 13:22:49 2014 Return-Path: <gcc-bugs-return-464746-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org> Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 9884 invoked by alias); 23 Oct 2014 13:22:49 -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 9849 invoked by uid 48); 23 Oct 2014 13:22:45 -0000 From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/12742] Type alignment is lost if const is added to typedef Date: Thu, 23 Oct 2014 13:23: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: 3.2.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cc resolution Message-ID: <bug-12742-4-WyJ2C1lGmu@http.gcc.gnu.org/bugzilla/> In-Reply-To: <bug-12742-4@http.gcc.gnu.org/bugzilla/> References: <bug-12742-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: 2014-10/txt/msg01767.txt.bz2 Content-length: 535 https://gcc.gnu.org/bugzilla/show_bug.cgi?id\x12742 Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |mpolacek at gcc dot gnu.org Resolution|--- |FIXED --- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> --- This has been fixed a long time ago.
next prev parent reply other threads:[~2014-10-23 13:16 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-10-18 11:44 [Bug ipa/63587] New: " trippels at gcc dot gnu.org 2014-10-19 21:31 ` [Bug ipa/63587] " mliska at suse dot cz 2014-10-20 6:49 ` trippels at gcc dot gnu.org 2014-10-20 7:54 ` rguenther at suse dot de 2014-10-20 12:53 ` rguenth at gcc dot gnu.org 2014-10-23 13:14 ` marxin at gcc dot gnu.org 2014-10-23 13:22 ` rguenther at suse dot de [this message] 2014-10-23 17:17 ` marxin at gcc dot gnu.org 2014-10-23 21:09 ` mliska at suse dot cz 2014-10-24 8:50 ` rguenther at suse dot de 2014-10-24 10:38 ` mliska at suse dot cz 2015-03-23 10:05 ` yroux 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-63587-4-Vz21Wvqvb3@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).