This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/10024 [3.3 regression] [HP-PA] inline optimization ICE
- From: Jan Hubicka <jh at suse dot cz>
- To: hubicka at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 6 Apr 2003 12:06:00 -0000
- Subject: Re: optimization/10024 [3.3 regression] [HP-PA] inline optimization ICE
- Reply-to: Jan Hubicka <jh at suse dot cz>
The following reply was made to PR optimization/10024; it has been noted by GNATS.
From: Jan Hubicka <jh at suse dot cz>
To: Richard Henderson <rth at redhat dot com>,
Zack Weinberg <zack at codesourcery dot com>, gcc-patches at gcc dot gnu dot org,
gcc-gnats at gcc dot gnu dot org, tausq at debian dot 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 at suse dot cz Tue Apr 1 19:16:18 2003
Return-Path: <jh at suse dot cz>
Delivered-To: hubicka at kam dot mff dot cuni dot 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 <hubicka at kam dot mff dot cuni dot cz>; 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 <hubicka at kam dot mff dot cuni dot cz>; Tue, 1 Apr 2003 19:11:36 +0200 (MEST)
Delivered-To: jh at localhost dot suse dot de
Delivered-To: jh at suse dot cz
Received: from chimera.suse.cz [10.20.0.2]
by localhost with POP3 (fetchmail-5.9.13)
for jh at 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 <jh at suse dot cz>; 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 <jh at suse dot cz>; 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 <jh at suse dot cz>
To: Mark Mitchell <mark at codesourcery dot com>
Cc: jh at suse dot cz, gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org,
rth at redhat dot com
Subject: Re: 3.3 PRs
Message-ID: <20030401170544 dot GK904 at kam dot mff dot cuni dot cz>
References: <200303311835 dot h2VIZvYF011397 at sirius dot codesourcery dot com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200303311835 dot h2VIZvYF011397 at sirius dot codesourcery dot com>
User-Agent: Mutt/1.3.28i
X-UIDL: k<g"!<nM"!n7K!!/Un"!
X-Spam-Status: No, hits=-4.4 required=5.0 tests=IN_REP_TO version=2.20
X-Spam-Level:
Status: RO
Content-Length: 3742
Lines: 108
>
> 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 <jh at suse dot cz>
>
> 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 <jh at suse dot cz>
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;