From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19979 invoked by alias); 25 Nov 2014 17:18:37 -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 19942 invoked by uid 48); 25 Nov 2014 17:18:34 -0000 From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/63851] [5 Regression] ipa-icf miscompiles gfortran.dg/assumed_rank_(8|9|10).f90 at -O2 and above Date: Tue, 25 Nov 2014 17:18: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: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 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-11/txt/msg03020.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D63851 --- Comment #2 from Martin Li=C5=A1ka --- OK, I can reproduce the problem on x86_64 with following simple patch appli= ed: diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c index 4875dec..c985052 100644 --- a/gcc/ipa-icf.c +++ b/gcc/ipa-icf.c @@ -606,6 +606,12 @@ sem_function::merge (sem_item *alias_item) create_thunk =3D true; } + if (create_alias ) + { + create_thunk =3D true; + create_alias =3D false; + } + There's a pair of functions 'g' and 'h' that are proved by IPA ICF to be eq= ual and thunk is created (darwin does not have alias support). Semantic equality hit:g->h Assembler symbol names:g.3324->h.3321 where 'h' looks is created as tail-call: h (struct array7_integer(kind=3D4) & restrict x) { : g (x_2(D)); [tail call] return; } and MAIN__: : # kk_1 =3D PHI *kk_1 =3D 489; desc.6.dtype =3D 264; desc.6.data =3D kk_1; h (&desc.6); [static-chain: &FRAME.15] desc.6 =3D{v} {CLOBBER}; j.8_45 =3D FRAME.15.j; if (j.8_45 !=3D 1) goto ; else goto ; It looks fine, but after inlining is done, we are given: assumed_rank_8.f90.063t.copyrename2: MAIN__: ... : # kk_11 =3D PHI *kk_11 =3D 489; desc.6.dtype =3D 264; desc.6.data =3D kk_11; g (&desc.6); desc.6 =3D{v} {CLOBBER}; j.8_12 =3D FRAME.15.j; if (j.8_12 !=3D 1) goto ; else goto ; Is missing [static-chain: &FRAME.15] in 'g (&desc.6);' problematic in this context? Thanks, Martin >>From gcc-bugs-return-468550-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Nov 25 17:37:52 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 6458 invoked by alias); 25 Nov 2014 17:37:52 -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 6209 invoked by uid 48); 25 Nov 2014 17:37:48 -0000 From: "jamborm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/63551] [4.9/5 Regression] wrong code (segfaults) at -Os on x86_64-linux-gnu Date: Tue, 25 Nov 2014 17:37: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: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jamborm at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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-11/txt/msg03022.txt.bz2 Content-length: 182 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63551 --- Comment #7 from Martin Jambor --- *** Bug 64041 has been marked as a duplicate of this bug. ***