public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/4648: gcc generates bad code at -O2 for SPEC crafty pgm on HPPA 32 HP-UX
@ 2002-03-30 17:36 Richard Henderson
0 siblings, 0 replies; 6+ messages in thread
From: Richard Henderson @ 2002-03-30 17:36 UTC (permalink / raw)
To: rth; +Cc: gcc-prs
The following reply was made to PR c/4648; it has been noted by GNATS.
From: Richard Henderson <rth@redhat.com>
To: rth@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
nobody@gcc.gnu.org, reva@cup.hp.com, rodrigc@gcc.gnu.org, sje@cup.hp.com,
gcc-gnats@gcc.gnu.org
Cc:
Subject: Re: c/4648: gcc generates bad code at -O2 for SPEC crafty pgm on HPPA 32 HP-UX
Date: Sat, 30 Mar 2002 17:25:45 -0800
Irritatingly, this is currently "fixed" by CPROP-INSN undoing
the work performed by PRE earlier. Almost certainly by
Thu Jan 10 22:35:54 CET 2002 Jan Hubicka <jh@suse.cz>
* gcse.c (hash_scan_set): Use CONSTANT_INSN_P.
(cprop_insn): Likewise.
We really need to run a register coelescing pass between the two.
That's not going to happen for gcc 3.1 though. In the mean time
do you mind if I downgrade this to medium priority, since the
test no longer fails?
r~
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: c/4648: gcc generates bad code at -O2 for SPEC crafty pgm on HPPA 32 HP-UX
@ 2002-03-30 17:01 rth
0 siblings, 0 replies; 6+ messages in thread
From: rth @ 2002-03-30 17:01 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, reva, rodrigc, rth, sje
Synopsis: gcc generates bad code at -O2 for SPEC crafty pgm on HPPA 32 HP-UX
Responsible-Changed-From-To: unassigned->rth
Responsible-Changed-By: rth
Responsible-Changed-When: Sat Mar 30 17:01:31 2002
Responsible-Changed-Why:
.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4648
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: c/4648: gcc generates bad code at -O2 for SPEC crafty pgm on HPPA 32 HP-UX
@ 2002-02-17 18:33 rodrigc
0 siblings, 0 replies; 6+ messages in thread
From: rodrigc @ 2002-02-17 18:33 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, reva, rodrigc, sje
Synopsis: gcc generates bad code at -O2 for SPEC crafty pgm on HPPA 32 HP-UX
State-Changed-From-To: feedback->analyzed
State-Changed-By: rodrigc
State-Changed-When: Sun Feb 17 18:33:48 2002
State-Changed-Why:
Submitter reports that it is still a problem with gcc 3.1
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4648
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: c/4648: gcc generates bad code at -O2 for SPEC crafty pgm on HPPA 32 HP-UX
@ 2002-01-07 8:56 Steve Ellcey
0 siblings, 0 replies; 6+ messages in thread
From: Steve Ellcey @ 2002-01-07 8:56 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c/4648; it has been noted by GNATS.
From: Steve Ellcey <sje@cup.hp.com>
To: rodrigc@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
nobody@gcc.gnu.org, reva@cup.hp.com, rodrigc@gcc.gnu.org,
sje@cup.hp.com, gcc-gnats@gcc.gnu.org
Cc:
Subject: Re: c/4648: gcc generates bad code at -O2 for SPEC crafty pgm on HPPA 32 HP-UX
Date: Mon, 7 Jan 2002 08:50:01 -0800 (PST)
> Synopsis: gcc generates bad code at -O2 for SPEC crafty pgm on HPPA 32 HP-UX
>
> State-Changed-From-To: open->feedback
> State-Changed-By: rodrigc
> State-Changed-When: Fri Jan 4 21:33:38 2002
> State-Changed-Why:
> Is this fixed in the gcc 3.1 tree?
>
> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4648
No, it is not fixed in the 3.1 tree. We have a hacked gcc locally that
turns off if-conversion and thus avoids the bug but we have no real fix
for it.
Steve Ellcey
sje@cup.hp.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: c/4648: gcc generates bad code at -O2 for SPEC crafty pgm on HPPA 32 HP-UX
@ 2002-01-04 21:33 rodrigc
0 siblings, 0 replies; 6+ messages in thread
From: rodrigc @ 2002-01-04 21:33 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, reva, rodrigc, sje
Synopsis: gcc generates bad code at -O2 for SPEC crafty pgm on HPPA 32 HP-UX
State-Changed-From-To: open->feedback
State-Changed-By: rodrigc
State-Changed-When: Fri Jan 4 21:33:38 2002
State-Changed-Why:
Is this fixed in the gcc 3.1 tree?
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4648
^ permalink raw reply [flat|nested] 6+ messages in thread
* c/4648: gcc generates bad code at -O2 for SPEC crafty pgm on HPPA 32 HP-UX
@ 2001-10-22 17:36 sje
0 siblings, 0 replies; 6+ messages in thread
From: sje @ 2001-10-22 17:36 UTC (permalink / raw)
To: gcc-gnats; +Cc: reva
>Number: 4648
>Category: c
>Synopsis: gcc generates bad code at -O2 for SPEC crafty pgm on HPPA 32 HP-UX
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Oct 22 17:36:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: reva@cup.hp.com
>Release: 3.0
>Organization:
>Environment:
HP-UX B.11.00 on HPPA (32 bits)
>Description:
GCC generates bad code for the SPEC crafty program at -O2.
The problem goes away with -fno-schedule-insns or with
-fno-gcse. It seems to be related to the if-conversion
optimization but it may be a scheduler bug that is exposed
by if-conversion. A test program (bug.c) is attached, and
here is the bad assembly language that gets generated along
with some comments on what is wrong with it.
L$0044
ldi 9,%r20
copy %r20,%r19
ldil LR'L$C0002,%r23
ldo RR'L$C0002(%r23),%r26
ldw RR'lastx-$global$(%r1),%r22
addil LR'rootx_beta-$global$,%r27
ldw RR'rootx_beta-$global$(%r1),%r21
addil LR'rootx_value-$global$,%r27 ==> updates r1 for rootx_value
copy %r1,%r23
comclr,> %r21,%r19,%r0
copy %r22,%r19
stw %r20,RR'rootx_value-$global$(%r23) ==> stores 9 into rootx_value
stw %r19,RR'lastx-$global$(%r1) ==> tries to store 9 into lastx, but
we have the wrong location since
r1 has not been updated for lastx.
The next addil instruction has to
come before the stw into lastx.
addil LR'lastx-$global$,%r27
.CALL ARGW0=GR,ARGW1=GR
bl printf,%r2
>How-To-Repeat:
Compile bug.c with -O0 and you will get two prints saying
"lastx = 9". If you compile with -O2 you get two prints
saying "lastx = 3", which is incorrect.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="bug.c"
Content-Disposition: inline; filename="bug.c"
char auto_kibitz_list[100][20];
int root_alpha;
int root_beta;
int root_value;
int iteration_depth;
int search_failed_high;
int search_failed_low;
int easy_move;
int time_abort;
unsigned int nodes_searched;
int trace_level;
signed char abort_search;
signed char searched_this_root_move[256];
int *last[65];
unsigned int noise_level;
unsigned int root_nodes[256];
int lastx;
int rootx_beta;
int rootx_value;
main()
{
Iterate(5,6,9);
}
int Iterate(int wtm, int search_type, int root_list_done)
{
int *mvp;
char buffer[500], *buffp, *bufftemp;
int i, value=0, time_used;
int twtm, used_w, used_b;
int cpu_start, cpu_end;
int correct, correct_count, material=0, sorted, temp;
lastx = 3;
rootx_beta = 32768;
rootx_value = 1;
for (i=0;i<256;i++) root_nodes[i]=0;
for (;iteration_depth<=60;iteration_depth++) {
if (trace_level) {
printf("==================================\n");
printf("= search iteration %2d =\n",iteration_depth);
printf("==================================\n");
}
search_failed_high=0;
search_failed_low=0;
while (!time_abort && !abort_search) {
if (value >= root_beta) {
search_failed_high=1;
root_alpha=root_beta-1;
root_value=root_alpha;
root_beta=32768 +1;
searched_this_root_move[0]=0;
}
else if (value <= root_alpha) {
if (!search_failed_high) {
for (mvp=last[0];mvp<last[1];mvp++)
searched_this_root_move[mvp-last[0]]=0;
search_failed_low=1;
root_alpha=-32768 -1;
root_value=root_alpha;
easy_move=0;
if (nodes_searched>noise_level && !time_abort && !abort_search) {
}
}
else break;
}
else
break;
}
rootx_value = 9;
if (rootx_value<rootx_beta)
lastx=rootx_value;
printf("lastx = %d\n",lastx);
if (correct) correct_count++;
else correct_count=0;
printf("lastx = %d\n",lastx);
if (value != -(32768 -1))
return;
}
}
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-03-31 1:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-30 17:36 c/4648: gcc generates bad code at -O2 for SPEC crafty pgm on HPPA 32 HP-UX Richard Henderson
-- strict thread matches above, loose matches on Subject: below --
2002-03-30 17:01 rth
2002-02-17 18:33 rodrigc
2002-01-07 8:56 Steve Ellcey
2002-01-04 21:33 rodrigc
2001-10-22 17:36 sje
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).