From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21209 invoked by alias); 6 Apr 2003 12:06:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 21196 invoked by uid 71); 6 Apr 2003 12:06:00 -0000 Date: Sun, 06 Apr 2003 12:06:00 -0000 Message-ID: <20030406120600.21195.qmail@sources.redhat.com> To: hubicka@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Jan Hubicka Subject: Re: optimization/10024 [3.3 regression] [HP-PA] inline optimization ICE Reply-To: Jan Hubicka X-SW-Source: 2003-04/txt/msg00186.txt.bz2 List-Id: The following reply was made to PR optimization/10024; it has been noted by GNATS. From: Jan Hubicka To: Richard Henderson , Zack Weinberg , gcc-patches@gcc.gnu.org, gcc-gnats@gcc.gnu.org, tausq@debian.org Cc: Subject: Re: optimization/10024 [3.3 regression] [HP-PA] inline optimization ICE Date: Sun, 6 Apr 2003 14:01:39 +0200 > On Wed, Mar 26, 2003 at 10:27:54AM -0800, Zack Weinberg wrote: > > * cfgrtl.c (force_nonfallthru_and_redirect): If e is the edge > > we want, use it. > > Yes, this is ok for 3.3. I am attaching the fix I sent some time ago. It fixes the checking failure as well and fixes force_nonfallthru_and_redirect slightly differently - it just bypass the code when redirection is noop. I beleive it is slightly more safe as still we may have instruction with multiple outgoing edges where Zacks code would result in misscompilation (mine would die, not much better) From jh@suse.cz Tue Apr 1 19:16:18 2003 Return-Path: Delivered-To: hubicka@kam.mff.cuni.cz Received: from Cantor.suse.de (ns.suse.de [213.95.15.193]) by nikam.ms.mff.cuni.cz (Postfix) with ESMTP id C23DF4DE86 for ; Tue, 1 Apr 2003 19:16:18 +0200 (CEST) Received: from Hermes.suse.de (Hermes.suse.de [213.95.15.136]) by Cantor.suse.de (Postfix) with ESMTP id D7082151F7 for ; Tue, 1 Apr 2003 19:11:36 +0200 (MEST) Delivered-To: jh@localhost.suse.de Delivered-To: jh@suse.cz Received: from chimera.suse.cz [10.20.0.2] by localhost with POP3 (fetchmail-5.9.13) for jh@localhost (single-drop); Tue, 01 Apr 2003 19:08:43 +0200 (CEST) Received: from kerberos.suse.cz (kerberos.suse.cz [10.20.16.1]) by chimera.suse.cz (Postfix) with ESMTP id 74C0F3F96 for ; Tue, 1 Apr 2003 19:05:41 +0200 (CEST) Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.18.106]) by kerberos.suse.cz (SuSE SMTP server) with ESMTP id 4FB5459D368 for ; Tue, 1 Apr 2003 19:05:41 +0200 (CEST) Received: from camelot.ms.mff.cuni.cz (kampanus.ms.mff.cuni.cz [195.113.18.107]) by nikam.ms.mff.cuni.cz (Postfix) with SMTP id 97D0D4DE86; Tue, 1 Apr 2003 19:05:42 +0200 (CEST) Received: by camelot.ms.mff.cuni.cz (sSMTP sendmail emulation); Tue, 1 Apr 2003 19:05:44 +0200 Date: Tue, 1 Apr 2003 19:05:44 +0200 From: Jan Hubicka To: Mark Mitchell Cc: jh@suse.cz, gcc@gcc.gnu.org, gcc-patches@gcc.gnu.org, rth@redhat.com Subject: Re: 3.3 PRs Message-ID: <20030401170544.GK904@kam.mff.cuni.cz> References: <200303311835.h2VIZvYF011397@sirius.codesourcery.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200303311835.h2VIZvYF011397@sirius.codesourcery.com> User-Agent: Mutt/1.3.28i X-UIDL: k > Jan -- > > There are a bunch of 3.3 PRs with your name on them. Let's get these > resolved ASAP. > > target/9929 ice-on-legal-code: > > Janis tracked this problem to one of your changes. > > You proposed a patch for this, and the discussion ends here: > > http://gcc.gnu.org/ml/gcc-patches/2003-03/msg02281.html > > RTH suggested an alternative way of fixing the problem; please > prepare a patch and submit it. > > optimization/8634 wrong-code: > > Janis tracked this problem to one of your changes. > > optimization/10056 ice-on-legal-code: > > You checked in a patch for this on March 25: > > Tue Mar 25 20:48:05 CET 2003 Jan Hubicka > > PR opt/10056 > > but the PR is still open. If you fixed it, would you close the PR? > > If not, what's up? > > optimization/10024 ice-on-legal-code: > > This seems like the same issue as 10056. Actually it is not. The attached patch should fix it OK for mainline/branch? I will install the testcase into compile of gcc-torture extern int * allegro_errno; typedef long fixed; extern inline int fixfloor (fixed x) { if (x >= 0) return (x >> 16); else return ~((~x) >> 16); } extern inline int fixtoi (fixed x) { return fixfloor(x) + ((x & 0x8000) >> 15); } extern inline fixed ftofix (double x) { if (x > 32767.0) { *allegro_errno = 34; return 0x7FFFFFFF; } if (x < -32767.0) { *allegro_errno = 34; return -0x7FFFFFFF; } return (long)(x * 65536.0 + (x < 0 ? -0.5 : 0.5)); } extern inline double fixtof (fixed x) { return (double)x / 65536.0; } extern inline fixed fixdiv (fixed x, fixed y) { if (y == 0) { *allegro_errno = 34; return (x < 0) ? -0x7FFFFFFF : 0x7FFFFFFF; } else return ftofix(fixtof(x) / fixtof(y)); } extern inline fixed itofix (int x) { return x << 16; } int foo(int n) { return fixtoi(fixdiv(itofix(512), itofix(n))); } Tue Apr 1 19:02:47 CEST 2003 Jan Hubicka PR opt/10024 * cfglayout.c (cfg_layout_redirect_edge): Update the jump. * cfgrtl.c (force_nonfallthru_and_redirect): Do not special case the fallthru edges when called via cfglayout.c Index: cfglayout.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/cfglayout.c,v retrieving revision 1.30 diff -c -3 -p -r1.30 cfglayout.c *** cfglayout.c 30 Mar 2003 20:46:56 -0000 1.30 --- cfglayout.c 1 Apr 2003 17:02:13 -0000 *************** cfg_layout_redirect_edge (e, dest) *** 904,909 **** --- 902,914 ---- src->next_bb = NULL; if (e->flags & EDGE_FALLTHRU) { + /* Redirect also the branch edges unified with the fallthru one. */ + if (GET_CODE (src->end) == JUMP_INSN + && JUMP_LABEL (src->end) == e->dest->head) + { + if (!redirect_jump (src->end, block_label (dest), 0)) + abort (); + } /* In case we are redirecting fallthru edge to the branch edge of conditional jump, remove it. */ if (src->succ->succ_next Index: cfgrtl.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/cfgrtl.c,v retrieving revision 1.70 diff -c -3 -p -r1.70 cfgrtl.c *** cfgrtl.c 30 Mar 2003 20:46:56 -0000 1.70 --- cfgrtl.c 1 Apr 2003 17:02:14 -0000 *************** force_nonfallthru_and_redirect (e, targe *** 926,931 **** --- 926,934 ---- by creating an basic block afterwards to redirect fallthru edge. */ if (e->src != ENTRY_BLOCK_PTR && e->dest != EXIT_BLOCK_PTR && any_condjump_p (e->src->end) + /* We may be called from cfglayout when the fallthru edges can go + arbitarily. */ + && e->src->next_bb == e->dest && JUMP_LABEL (e->src->end) == e->dest->head) { rtx note;