From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3027 invoked by alias); 23 Oct 2014 13:16:14 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 2961 invoked by uid 55); 23 Oct 2014 13:16:10 -0000 From: "rguenther at suse dot de" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: marxin at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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: 2014-10/txt/msg01765.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D63587 --- Comment #7 from 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=3D63587 >=20 > --- 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: > >=20 > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D63587 > > >=20 > > > --- Comment #2 from Martin Li=C5=A1ka --- > > > Following two functions are merged: > > > static boost::log::make_output_actor, RightT, Value= T>::type > > > boost::log::make_output_actor, RightT, > > > ValueT>::make(ActorT, RightT&) [with ActorT =3D boost::act= or; > > > LeftExprT =3D int; RightT =3D boost::log::attribute_actor > > boost::log::value_extractor, void, boost::actor>; ValueT =3D int; > > > boost::log::make_output_actor, RightT, ValueT>::typ= e =3D > > > boost::actor, > > > boost::log::to_log_fun> >] (struct actor left, struct attribute_actor= & right) > > >=20 > > >=20 > > > static boost::log::make_output_actor, RightT, Value= T>::type > > > boost::log::make_output_actor, RightT, > > > ValueT>::make(ActorT, RightT&) [with ActorT =3D boost::act= or; > > > LeftExprT =3D int; RightT =3D boost::log::attribute_actor<{anonymous}= ::my_class, > > > boost::log::value_extractor, void, boost::actor>; ValueT =3D int; > > > boost::log::make_output_actor, RightT, ValueT>::typ= e =3D > > > boost::actor, > > > boost::log::to_log_fun> >] (struct actor left, struct attribute_actor= & right) > > >=20 > > > with following body: > > > { > > > struct type D.3826; > > > struct to_log_fun D.3825; > > > struct attribute_name D.3824; > > > int SR.9; > > > struct actor left; > > >=20 > > > : > > > left =3D left; > > > SR.9_4 =3D MEM[(struct attribute_terminal *)right_2(D)]; > > > MEM[(struct attribute_name *)&D.3824] =3D SR.9_4; > > > boost::log::attribute_output_terminal, > > > boost::log::to_log_fun>::attribute_output_terminal (&D.3826, lef= t, D.3824, > > > D.3825, 0); > > > D.3826 =3D{v} {CLOBBER}; > > > return; > > >=20 > > > } > > >=20 > > >=20 > > >=20 > > > As I was debugging ao_ref_alias_sets, there's MEM_REF where we have d= ifferent > > > template arguments: attribute_actor vs. > > > attribute_actor<{anonymous}::my_class,...>. > > > What do you think Richard about these record_types from alias set per= spective: > > >=20 > > > (gdb) p debug_tree(t1) > > > > > type > > size > > > unit size > > > align 32 symtab 0 alias set 4 canonical type 0x7ffff6c33690 p= recision > > > 32 min max > > 2147483647> > > > pointer_to_this > > > >=20 > > > arg 0 > > type > > attribute_actor> > > > unsigned DI > > > size > > > unit size > > > align 64 symtab 0 alias set 7 canonical type 0x7ffff6e20d= 20> > > > visited var def_stmt GIMPLE_N= OP > > >=20 > > > version 2 > > > ptr-info 0x7ffff6a7e3d8> > > > arg 1 > > > constant 0>> > > > $1 =3D void > > > (gdb) p debug_tree(t2) > > > > > type > > size > > > unit size > > > align 32 symtab 0 alias set 4 canonical type 0x7ffff6c33690 p= recision > > > 32 min max > > 2147483647> > > > pointer_to_this > > > >=20 > > > arg 0 > > type > > attribute_actor> > > > unsigned DI > > > size > > > unit size > > > align 64 symtab 0 alias set 7 canonical type 0x7ffff6e205= 40> > > > visited var def_stmt GIMPLE_N= OP > > >=20 > > > version 2 > > > ptr-info 0x7ffff6a7e300> > > > arg 1 > > > constant 0>> > > >=20 > > > these types are called for alias_set comparison, with following recor= d_types: > > > (gdb) p debug_tree((tree_node*)0x7ffff6de7dc8) > > > > > SI > > > size > > bitsizetype> constant 32> > > > unit size > > sizetype> constant 4> > > > align 32 symtab 0 alias set 17 canonical type 0x7ffff6de7dc8 > > > fields > > type > > SI size unit size > > 4> > > > align 32 symtab 0 alias set 15 canonical type 0x7ffff6ddd= b28 fields > > > context > > boost> > > > full-name "struct boost::actor" > > > needs-constructor X() X(constX&) this=3D(X&) n_parents=3D0 > > > use_template=3D1 interface-unknown > > > pointer_to_this reference_t= o_this > > > chain > > > > ignored decl_6 SI file ../../PR33754.c line 167 col 7 size > > 0x7ffff6c51048 32> unit size > > > align 32 offset_align 128 > > > offset > > > bit offset context > > 0x7ffff6de7dc8 attribute_actor> > > > chain > > 0x7ffff6de80a8 attribute_actor> > > > external nonlocal suppress-debug decl_4 VOID file ../../P= R33754.c > > > line 168 col 1 > > > align 8 context result > > > > > > chain >> context > > > > > > full-name "class boost::log::attribute_actor > > boost::log::value_extractor, void, boost::actor>" > > > needs-constructor X() X(constX&) this=3D(X&) n_parents=3D1 use_te= mplate=3D1 > > > interface-unknown > > > pointer_to_this reference_to_this > > > chain > > attribute_actor>> > > > $3 =3D void > > > (gdb) p debug_tree((tree_node*)0x7ffff6ddd888) > > > > > SI > > > size > > bitsizetype> constant 32> > > > unit size > > sizetype> constant 4> > > > align 32 symtab 0 alias set 14 canonical type 0x7ffff6ddd888 > > > fields > > type > > SI size unit size > > 4> > > > align 32 symtab 0 alias set 15 canonical type 0x7ffff6ddd= b28 fields > > > context > > boost> > > > full-name "struct boost::actor" > > > needs-constructor X() X(constX&) this=3D(X&) n_parents=3D0 > > > use_template=3D1 interface-unknown > > > pointer_to_this reference_t= o_this > > > chain > > > > ignored decl_6 SI file ../../PR33754.c line 167 col 7 size > > 0x7ffff6c51048 32> unit size > > > align 32 offset_align 128 > > > offset > > > bit offset context > > 0x7ffff6ddd888 attribute_actor> > > > chain > > 0x7ffff6de12a0 attribute_actor> > > > external nonlocal suppress-debug decl_4 VOID file ../../P= R33754.c > > > line 168 col 1 > > > align 8 context result > > > > > > chain >> context > > > > > > full-name "class boost::log::attribute_actor<{anonymous}::my_clas= s, > > > boost::log::value_extractor, void, boost::actor>" > > > needs-constructor X() X(constX&) this=3D(X&) n_parents=3D1 use_te= mplate=3D1 > > > interface-unknown > > > pointer_to_this reference_to_this > > > chain > > attribute_actor>> > > >=20 > > > If the alias sets can be considered to be equal, we must face some la= tent bug > > > in inliner? > >=20 > > Maybe. Btw, I see some issues in func_checker::compare_operand with > > regard to it doing redundant checks: > >=20 > > if (!func_checker::compatible_types_p (TREE_TYPE (x1), TREE_TYP= E=20 > > (x2))) > > return return_false (); > >=20 > > Redundant with the following > >=20 > > if (!compare_operand (x1, x2)) > > return return_false_with_msg (""); > >=20 > > ... > >=20 > > if (get_alias_set (TREE_TYPE (y1)) !=3D get_alias_set (TREE_TYP= E=20 > > (y2))) > > return return_false_with_msg ("alias set for MEM_REF offsets = are=20 > > different"); > >=20 > > Redundant with the following > >=20 > > ao_ref r1, r2; > > ao_ref_init (&r1, t1); > > ao_ref_init (&r2, t2); > > if (ao_ref_alias_set (&r1) !=3D ao_ref_alias_set (&r2) > > || ao_ref_base_alias_set (&r1) !=3D ao_ref_base_alias_set (= &r2)) > > return return_false_with_msg ("ao alias sets are different"); > >=20 > >=20 > > /* Type of the offset on MEM_REF does not matter. */ > > return wi::to_offset (y1) =3D=3D wi::to_offset (y2); > >=20 > > Use tree_int_cst_equal (y1, y2). > >=20 > > case COMPONENT_REF: > > { > > x1 =3D TREE_OPERAND (t1, 0); > > x2 =3D TREE_OPERAND (t2, 0); > > y1 =3D TREE_OPERAND (t1, 1); > > y2 =3D TREE_OPERAND (t2, 1); > >=20 > > ret =3D compare_operand (x1, x2) > > && compare_operand (y1, y2); > >=20 > > 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). > >=20 > > IMHO folding memory access comparison and general operand comparison > > into one function makes it very much less clear what is going on... > >=20 > > So - can you please split this into the general compare_operand > > and a compare_memory_access function? >=20 > Hello Richard. >=20 > 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: >=20 > static boost::log::make_output_actor, RightT, ValueT>::= type > boost::log::make_output_actor, RightT, > ValueT>::make(ActorT, RightT&) [with ActorT =3D boost::actor; > LeftExprT =3D int; RightT =3D boost::log::attribute_actor<{anonymous}::my= _class, > boost::log::value_extractor, void, boost::actor>; ValueT =3D int; > boost::log::make_output_actor, RightT, ValueT>::type =3D > boost::actor, > boost::log::to_log_fun> >] (struct actor left, struct attribute_actor & r= ight) > { > struct type ; >=20 > : > =3D boost::log::make_output_actor, > boost::log::attribute_actor boost::actor>, int>::make (left, right_2(D)); [tail call] > return ; >=20 > } >=20 > At cgraphunit.c:1547 (expand_thunk) we add result_decl to local_decl: > add_local_decl (cfun, restmp); >=20 > Remapping code in add_local_variable contains predicate DECL_HAS_DEBUG_EX= PR_P > (var), where TREE_CODE(var) =3D=3D RESULT_DECL. > Question is if either local_decl should never contain RESULT_DECL or just > addition of TREE_CODE(var) =3D=3D VAR_DECL to the problematic condition w= ould 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: 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: List-Archive: List-Post: List-Help: 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" 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: In-Reply-To: References: 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=12742 Marek Polacek changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |mpolacek at gcc dot gnu.org Resolution|--- |FIXED --- Comment #5 from Marek Polacek --- This has been fixed a long time ago.