This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [egcs-19980531] Optimization bug pe
- To: law at cygnus dot com
- Subject: Re: [egcs-19980531] Optimization bug pe
- From: grahams at rcp dot co dot uk
- Date: Wed, 03 Jun 1998 19:39:10 GMT
- CC: egcs-patches at cygnus dot com
CC: egcs-patches@cygnus.com
Jeff
I've done some investigations.
The problem as I understand is the biv's final exit value is
not always being set correctly when a loop is reversed.
The problem occurs when in biv's initial value is a
CONST_INT but not const_rtx0.
I've included a patch against egcs-19980531 snapshot which
I think corrects the problem.
I've done a "make bootstrap" on ix86-linux without problem.
Changelog Entry
* loop.c (check_dbra_loop): Initialise final_value before
normalizing loop.
Patch
*** loop.c.orig Wed Jun 3 19:05:39 1998
--- loop.c Wed Jun 3 19:10:05 1998
***************
*** 6316,6321 ****
--- 6316,6322 ----
add_val = INTVAL (bl->biv->add_val);
comparison_val = INTVAL (XEXP (comparison, 1));
+ final_value = GEN_INT (comparison_val);
initial_value = bl->initial_value;
/* Normalize the initial value if it is an integer and
***************
*** 6353,6359 ****
jump_label = XEXP (SET_SRC (PATTERN (PREV_INSN (loop_end))), 2);
new_add_val = GEN_INT (- INTVAL (bl->biv->add_val));
- final_value = XEXP (comparison, 1);
start_value = GEN_INT (INTVAL (XEXP (comparison, 1))
- INTVAL (bl->biv->add_val));
--- 6354,6359 ----
Graham
----------
From: law
Sent: Wednesday, June 03, 1998 7:02 AM
To: Hyman Rosen <hymie@prolifics.com>
Cc: egcs-bugs@cygnus.com
Subject: Re: [egcs-19980531] Optimization bug pe
Received: from aluminium ([194.154.18.68]) by iron.rcp.co.uk
(8.6.9/8.6.9)
with SMTP id FAA00094 for <grahams@rcp.co.uk>; Wed, 03 Jun 1998 06:51:21
GMT
Received: from [205.180.230.5] by aluminium (NTMail 3.02.13) with ESMTP
id
na201409 for <grahams@rcp.co.uk>; Wed, 3 Jun 1998 06:50:33 +0100
Received: (from majordom@localhost)
by runyon.cygnus.com (8.8.7-cygnus/8.8.7) id TAA14685;
Tue, 2 Jun 1998 19:54:19 -0700 (PDT)
Received: from cygint.cygnus.com (cygnus.com [205.180.230.20])
by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id TAA14680
for <egcs-bugs@cygnus.com>; Tue, 2 Jun 1998 19:54:16 -0700 (PDT)
Received: from localhost.cygnus.com (hurl.cygnus.com [208.224.120.146])
by cygint.cygnus.com (8.8.7-cygnus/8.8.7-cygnus) with ESMTP id TAA06333;
Tue, 2 Jun 1998 19:54:13 -0700 (PDT)
X-Authentication-Warning: cygnus.com: Processed from queue
/var/spool/mqueue
To: Hyman Rosen <hymie@prolifics.com>
cc: egcs-bugs@cygnus.com
Subject: Re: [egcs-19980531] Optimization bug persists
Reply-To: law@cygnus.com
In-reply-to: Your message of Tue, 02 Jun 1998 18:49:23 MDT.
<199806022249.SAA17536@calumny.jyacc.com>
Date: Tue, 02 Jun 1998 20:53:27 -0600
Message-ID: <7433.896842407@hurl.cygnus.com>
From: Jeffrey A Law <law@cygnus.com>
Sender: owner-egcs-bugs@cygnus.com
Precedence: bulk
In message <199806022249.SAA17536@calumny.jyacc.com>you write:
> Egcs continues to have this optimization bug. It appears in both
places
> I've tried, Linux and Solaris. The following code should print "OK".
> When compiled with -O2 or better, it prints nothing.
Note it works on my hppa boxes.
Regardless, I've added it to the testsuite. Hopefully someone will
have time to look at it soon.
Also note, I've trimmed "egcs" out of the cc list.
jeff