public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/9448: [mainline] Wrong code with -O2 -fprefetch-loop-arrays
@ 2003-02-18  9:57 zlomek
  0 siblings, 0 replies; 7+ messages in thread
From: zlomek @ 2003-02-18  9:57 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, zlomekj

Synopsis: [mainline] Wrong code with -O2 -fprefetch-loop-arrays

State-Changed-From-To: feedback->closed
State-Changed-By: zlomek
State-Changed-When: Tue Feb 18 09:57:38 2003
State-Changed-Why:
    It seems to be fixed, probably by Honza Hubicka's patch:
    * loop.c (emit_prefetch_instructions):  Do conversion at right place in RTL chain.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9448


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: optimization/9448: [mainline] Wrong code with -O2 -fprefetch-loop-arrays
@ 2003-02-18  8:22 ebotcazou
  0 siblings, 0 replies; 7+ messages in thread
From: ebotcazou @ 2003-02-18  8:22 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, zlomekj

Synopsis: [mainline] Wrong code with -O2 -fprefetch-loop-arrays

State-Changed-From-To: open->feedback
State-Changed-By: ebotcazou
State-Changed-When: Tue Feb 18 08:18:55 2003
State-Changed-Why:
    Josef, is this a regression on mainline? If so, you ought to clearly indicate it in the synopsis and raise its priority.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9448


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: optimization/9448: [mainline] Wrong code with -O2 -fprefetch-loop-arrays
@ 2003-01-27 13:46 Josef Zlomek
  0 siblings, 0 replies; 7+ messages in thread
From: Josef Zlomek @ 2003-01-27 13:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR optimization/9448; it has been noted by GNATS.

From: Josef Zlomek <zlomekj@suse.cz>
To: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: optimization/9448: [mainline] Wrong code with -O2 -fprefetch-loop-arrays
Date: Mon, 27 Jan 2003 14:36:38 +0100

 > > In loop.c in function emit_prefetch_instructions on line 4200
 > > there is the following command:
 > > init_val = convert_to_mode (Pmode, init_val, 0);
 > > 
 > > It finally generates instructions to convert from SImode to DImode
 > > which are placed to the end of instruction stream and not to the
 > > place before loop.
 > 
 > I'm not quite sure what your actual problem is. That prefetches are
 > placed at nonsensical places? That's not nice, but also not really
 > wrong-code. Also, your example contains an infinite loop, and I don't
 > think we should be especially concerned about optimizing that. Perhaps
 > you could provide a smaller example with the assembly you get, and the
 > assembly you'd rather like to see?
 
 I have updated the testcase and attached also RTL dump after loop.
 
 Josef


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: optimization/9448: [mainline] Wrong code with -O2 -fprefetch-loop-arrays
@ 2003-01-27 13:36 Josef Zlomek
  0 siblings, 0 replies; 7+ messages in thread
From: Josef Zlomek @ 2003-01-27 13:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR optimization/9448; it has been noted by GNATS.

From: Josef Zlomek <zlomekj@suse.cz>
To: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: optimization/9448: [mainline] Wrong code with -O2 -fprefetch-loop-arrays
Date: Mon, 27 Jan 2003 14:32:32 +0100

 > > > In loop.c in function emit_prefetch_instructions on line 4200
 > > > there is the following command:
 > > > init_val = convert_to_mode (Pmode, init_val, 0);
 > > > 
 > > > It finally generates instructions to convert from SImode to DImode
 > > > which are placed to the end of instruction stream and not to the
 > > > place before loop.
 > > 
 > > Also, your example contains an infinite loop, and I don't
 > > think we should be especially concerned about optimizing that.
 > 
 > It does not matter that the loop is infinite, if there was
 > while (i < n)
 >   i++;
 > the code would be also wrong.
 > The testcase was minimized by deleting many lines from gzip's unlzh.c
 
 Actually it was minimal for the gcse bug I have fixed, I have removed
 some more lines.
 
 Josef


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: optimization/9448: [mainline] Wrong code with -O2 -fprefetch-loop-arrays
@ 2003-01-27 13:36 Josef Zlomek
  0 siblings, 0 replies; 7+ messages in thread
From: Josef Zlomek @ 2003-01-27 13:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR optimization/9448; it has been noted by GNATS.

From: Josef Zlomek <zlomekj@suse.cz>
To: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: optimization/9448: [mainline] Wrong code with -O2 -fprefetch-loop-arrays
Date: Mon, 27 Jan 2003 14:28:40 +0100

 > > In loop.c in function emit_prefetch_instructions on line 4200
 > > there is the following command:
 > > init_val = convert_to_mode (Pmode, init_val, 0);
 > > 
 > > It finally generates instructions to convert from SImode to DImode
 > > which are placed to the end of instruction stream and not to the
 > > place before loop.
 > 
 > Also, your example contains an infinite loop, and I don't
 > think we should be especially concerned about optimizing that.
 
 It does not matter that the loop is infinite, if there was
 while (i < n)
   i++;
 the code would be also wrong.
 The testcase was minimized by deleting many lines from gzip's unlzh.c
 
 What I'm concerned is that the instructions are placed on the wrong
 place, no matter what they do.
 This can be problem with some real sources.
 
 > Perhaps
 > you could provide a smaller example with the assembly you get, and the
 > assembly you'd rather like to see?
 
 I'll attach the RTL after loop to bug report if it is possible.
 
 Josef


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: optimization/9448: [mainline] Wrong code with -O2 -fprefetch-loop-arrays
@ 2003-01-27 12:56 Falk Hueffner
  0 siblings, 0 replies; 7+ messages in thread
From: Falk Hueffner @ 2003-01-27 12:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR optimization/9448; it has been noted by GNATS.

From: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
To: zlomekj@suse.cz
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: optimization/9448: [mainline] Wrong code with -O2 -fprefetch-loop-arrays
Date: 27 Jan 2003 13:48:27 +0100

 zlomekj@suse.cz writes:
 
 > In loop.c in function emit_prefetch_instructions on line 4200
 > there is the following command:
 > init_val = convert_to_mode (Pmode, init_val, 0);
 > 
 > It finally generates instructions to convert from SImode to DImode
 > which are placed to the end of instruction stream and not to the
 > place before loop.
 
 I'm not quite sure what your actual problem is. That prefetches are
 placed at nonsensical places? That's not nice, but also not really
 wrong-code. Also, your example contains an infinite loop, and I don't
 think we should be especially concerned about optimizing that. Perhaps
 you could provide a smaller example with the assembly you get, and the
 assembly you'd rather like to see?
 
 -- 
 	Falk


^ permalink raw reply	[flat|nested] 7+ messages in thread

* optimization/9448: [mainline] Wrong code with -O2 -fprefetch-loop-arrays
@ 2003-01-27 11:46 zlomekj
  0 siblings, 0 replies; 7+ messages in thread
From: zlomekj @ 2003-01-27 11:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9448
>Category:       optimization
>Synopsis:       [mainline] Wrong code with -O2 -fprefetch-loop-arrays
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 27 11:46:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Josef Zlomek
>Release:        mainline
>Organization:
>Environment:
x86-64 but probably other 64-bit machines too
>Description:
In loop.c in function emit_prefetch_instructions on line 4200
there is the following command:
init_val = convert_to_mode (Pmode, init_val, 0);

It finally generates instructions to convert from SImode to DImode which are placed to the end of instruction stream and not to the place before loop.

Here is the backtrace:
#0  add_insn (insn=0x2a9589e120) at ../../gcc/emit-rtl.c:3613
#1  0x400a9441 in emit_insn (x=0x2a958a0240) at ../../gcc/emit-rtl.c:4671
#2  0x40148e17 in gen_extendsidi2 (operand0=0x2a958a0220, operand1=0x2a9589e120) at insn-emit.c:9318
#3  0x401ce83d in emit_unop_insn (icode=-1786126048, target=0x7fbfffc570, op0=0x2a956558c0, code=132) at ../../gcc/optabs.c:3029
#4  0x400bb3dd in convert_modes (mode=DImode, oldmode=2508849696, x=0x2a956558c0, unsignedp=0) at ../../gcc/expr.c:1435
#5  0x401bbaca in emit_prefetch_instructions (loop=0x405e7d00) at ../../gcc/loop.c:4200
#6  0x401bd47d in strength_reduce (loop=0x405e7d00, flags=6) at ../../gcc/loop.c:5112
#7  0x401b4b81 in scan_loop (loop=0x405e7d00, flags=6) at ../../gcc/loop.c:1166
#8  0x401b274b in loop_optimize (f=0x2a9565f120, dumpfile=0x0, flags=6) at ../../gcc/loop.c:552
#9  0x4023cf2b in rest_of_compilation (decl=0x2a95653540) at ../../gcc/toplev.c:2961
#10 0x4001af11 in c_expand_body (fndecl=0x2a9589e120, nested_p=1077278688, can_defer_p=1) at ../../gcc/c-decl.c:6541
#11 0x4001ab8d in finish_function (nested=0, can_defer_p=1) at ../../gcc/c-decl.c:6412
#12 0x40002830 in yyparse () at c-parse.y:406
#13 0x4000bdf7 in c_common_parse_file (set_yydebug=-1786126048) at ../../gcc/c-lex.c:165
>How-To-Repeat:
Compile attached testcase with -O2 -fprefetch-loop-arrays
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="u.i"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="u.i"

c3RhdGljIHZvaWQgbWFrZV90YWJsZShuY2hhcikKICAgIGludCBuY2hhcjsKewp9CmV4dGVybiB1
bnNpZ25lZCBjaGFyIG91dGJ1ZltdOwpzdGF0aWMgdm9pZCByZWFkX2NfbGVuKCkKewogICAgaW50
IGksIG47CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgZm9yIChpID0gMDsgaSA8ICgyNTUgKyAy
NTYgKyAyIC0gMyk7IGkrKykgb3V0YnVmW2ldID0gMDsKICAgIH0gZWxzZSB7CiAgICAgICAgaSA9
IDA7CiAgICAgICAgd2hpbGUgKGkgPCBuKSB7CiAgICAgICAgfQogICAgICAgIHdoaWxlIChpIDwg
KDI1NSArIDI1NiArIDIgLSAzKSkgb3V0YnVmW2krK10gPSAwOwogICAgICAgIG1ha2VfdGFibGUo
KDI1NSArIDI1NiArIDIgLSAzKSk7CiAgICB9Cn0K


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-02-18  9:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-18  9:57 optimization/9448: [mainline] Wrong code with -O2 -fprefetch-loop-arrays zlomek
  -- strict thread matches above, loose matches on Subject: below --
2003-02-18  8:22 ebotcazou
2003-01-27 13:46 Josef Zlomek
2003-01-27 13:36 Josef Zlomek
2003-01-27 13:36 Josef Zlomek
2003-01-27 12:56 Falk Hueffner
2003-01-27 11:46 zlomekj

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).