[Bug fortran/31593] Invariant DO loop variables and subroutines

2020-07-19 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31593 --- Comment #50 from Thomas Koenig --- (In reply to Thomas Koenig from comment #49) > The second loop: > > .L3: > leaq8(%rsp), %rdi > callintent_in_ > movl%ebx, 8(%rsp) > addl$1, %ebx > cmpl$12,

[Bug fortran/31593] Invariant DO loop variables and subroutines

2020-07-19 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31593 --- Comment #49 from Thomas Koenig --- (In reply to Tobias Schlüter from comment #48) > Forgive me, I wasn't aware of this oversight which may have turned away > people who could fix this for the past 6 years. That didn't happen :-) Unfortunate

[Bug fortran/31593] Invariant DO loop variables and subroutines

2020-07-15 Thread tobi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31593 Tobias Schlüter changed: What|Removed |Added Assignee|tobi at gcc dot gnu.org|unassigned at gcc dot gnu.org

[Bug fortran/31593] Invariant DO loop variables and subroutines

2020-07-13 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31593 --- Comment #47 from Dominique d'Humieres --- The assignee is Tobias Schlüter, but the PR is not marked as assigned. Is Tobias still interested? If no, the PR should be unassigned.

[Bug fortran/31593] Invariant DO loop variables and subroutines

2020-06-24 Thread tobi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31593 Tobias Schlüter changed: What|Removed |Added Status|ASSIGNED|NEW

[Bug fortran/31593] Invariant DO loop variables and subroutines

2014-08-22 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31593 --- Comment #46 from Thomas Koenig --- (In reply to Dominique d'Humieres from comment #45) > Anything left to fix in this PR? Unfortunately yes... We still do not take advantage of the fact that the call to a subroutine cannot change the value

[Bug fortran/31593] Invariant DO loop variables and subroutines

2013-10-09 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31593 --- Comment #45 from Dominique d'Humieres --- Anything left to fix in this PR?

[Bug fortran/31593] Invariant DO loop variables and subroutines

2013-08-28 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31593 Bug 31593 depends on bug 31094, which changed state. Bug 31094 Summary: Support annotating function parameters as read-only and/or non-escaping http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31094 What|Removed |Ad

[Bug fortran/31593] Invariant DO loop variables and subroutines

2010-10-16 Thread tkoenig at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31593 --- Comment #44 from Thomas Koenig 2010-10-16 16:06:16 UTC --- Author: tkoenig Date: Sat Oct 16 16:06:07 2010 New Revision: 165559 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=165559 Log: 2010-10-16 Thomas Koenig PR fortran/2016

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-10-08 Thread matz at gcc dot gnu dot org
--- Comment #43 from matz at gcc dot gnu dot org 2009-10-08 11:24 --- There already is PR31094 about this enhancement. -- matz at gcc dot gnu dot org changed: What|Removed |Added -

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-10-08 Thread steven at gcc dot gnu dot org
--- Comment #42 from steven at gcc dot gnu dot org 2009-10-08 11:06 --- Add Matz, following comment #40. Micha, maybe you can open a separate bug report for the issues you mention in your mail (http://gcc.gnu.org/ml/fortran/2009-08/msg00200.html) and make that new PR block this existing

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-17 Thread tobi at gcc dot gnu dot org
--- Comment #41 from tobi at gcc dot gnu dot org 2009-08-17 22:39 --- (In reply to comment #40) One more thing: my previous benchmarks were wrong, I had an error in my setup. With a correct benchmark, polyhedron improves slightly in the testcases where the change is outside the measure

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-17 Thread tobi at gcc dot gnu dot org
--- Comment #40 from tobi at gcc dot gnu dot org 2009-08-17 22:08 --- Created an attachment (id=18392) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18392&action=view) Patch for savin function arguments This patch copies do loops which are passed as actual arguments to a temporary

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-16 Thread tobi at gcc dot gnu dot org
--- Comment #39 from tobi at gcc dot gnu dot org 2009-08-16 17:00 --- Sigh, with the patch capacita.f90 loses 4%. Your testcase really is nasty, Thomas! :) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31593

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-16 Thread tobi at gcc dot gnu dot org
--- Comment #38 from tobi at gcc dot gnu dot org 2009-08-16 16:20 --- Thanks(In reply to comment #37) > Subject: Re: Invariant DO loop variables and subroutines > > On Sun, 2009-08-16 at 15:57 +, tobi at gcc dot gnu dot org wrote: > > Now I only need to figure out how to make that

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-16 Thread tkoenig at gcc dot gnu dot org
--- Comment #37 from tkoenig at gcc dot gnu dot org 2009-08-16 16:12 --- Subject: Re: Invariant DO loop variables and subroutines On Sun, 2009-08-16 at 15:57 +, tobi at gcc dot gnu dot org wrote: > Now I only need to figure out how to make that patch pass the > testsuite :) If yo

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-16 Thread tobi at gcc dot gnu dot org
--- Comment #36 from tobi at gcc dot gnu dot org 2009-08-16 15:57 --- I have a patch which copies DO loop variables that are passed as arguments to functions, which gives the same speedup as enclosing the arguments into parentheses. Now I only need to figure out how to make that patch p

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-15 Thread Tobias Schlüter
--- Comment #35 from =?ISO-8859-1?Q?Tobias_Schl=FCter?= 2009-08-15 10:58 --- Subject: Re: Invariant DO loop variables and subroutines tkoenig at gcc dot gnu dot org wrote: > --- Comment #34 from tkoenig at gcc dot gnu dot org 2009-08-15 10:57 > --- > (In reply to comment #

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-15 Thread tkoenig at gcc dot gnu dot org
--- Comment #34 from tkoenig at gcc dot gnu dot org 2009-08-15 10:57 --- (In reply to comment #33) > Actually, we're buggy there, and my patch fixes it. I'm just now trying > out testcases. Are we really buggy? $ cat gaga.f90 n=10 do i=1,n call foo(n) print *,i end do end subrouti

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-15 Thread Tobias Schlüter
--- Comment #33 from =?ISO-8859-1?Q?Tobias_Schl=FCter?= 2009-08-15 10:17 --- Subject: Re: Invariant DO loop variables and subroutines jv244 at cam dot ac dot uk wrote: > --- Comment #32 from jv244 at cam dot ac dot uk 2009-08-15 10:05 --- > (In reply to comment #29) > >> I

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-15 Thread jv244 at cam dot ac dot uk
--- Comment #32 from jv244 at cam dot ac dot uk 2009-08-15 10:05 --- (In reply to comment #29) > It's the other way around: If output were to modify any of its > arguments, the program would be illegal. Therefore, the compiler can > assume that this doesn't happen. Intent(in) would b

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-15 Thread tobi at gcc dot gnu dot org
--- Comment #31 from tobi at gcc dot gnu dot org 2009-08-15 09:51 --- (In reply to comment #30) > Escaping pointers for non-target dummy arguments can't happen in > Fortran, can they? Could we just disable this (or ad a > TREE_CANNOT_ALIAS flag to the middle end, which is on by default

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-15 Thread tkoenig at gcc dot gnu dot org
--- Comment #30 from tkoenig at gcc dot gnu dot org 2009-08-15 09:25 --- Subject: Re: Invariant DO loop variables and subroutines On Fri, 2009-08-14 at 22:58 +, tobi at gcc dot gnu dot org wrote: > > --- Comment #26 from tobi at gcc dot gnu dot org 2009-08-14 22:58 --- >

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-15 Thread tkoenig at gcc dot gnu dot org
--- Comment #29 from tkoenig at gcc dot gnu dot org 2009-08-15 09:22 --- Subject: Re: Invariant DO loop variables and subroutines On Sat, 2009-08-15 at 07:53 +, jv244 at cam dot ac dot uk wrote: > > --- Comment #28 from jv244 at cam dot ac dot uk 2009-08-15 07:53 --- > (

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-15 Thread jv244 at cam dot ac dot uk
--- Comment #28 from jv244 at cam dot ac dot uk 2009-08-15 07:53 --- (In reply to comment #23) > subroutine output(i1,i2,i3,i4,i5) > print '(5(I0,:" "))',i1,i2,i3,i4,i5 > end subroutine output [..] > if (p1 * p2 * p3 * p4 == value * 100) &

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-15 Thread jv244 at cam dot ac dot uk
--- Comment #27 from jv244 at cam dot ac dot uk 2009-08-15 07:50 --- (In reply to comment #26) > If it weren't for the outermost loop it would actually be perfectly legal to > modify 'value' inside the loops. If there were a way of telling the compiler > "this pointer can't escape" this

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-14 Thread tobi at gcc dot gnu dot org
--- Comment #26 from tobi at gcc dot gnu dot org 2009-08-14 22:58 --- (In reply to comment #25) > (In reply to comment #23) > > Actually, you're right. In nested loops, there's no way without copying. > If it weren't for the outermost loop it would actually be perfectly legal to modif

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-14 Thread tobi at gcc dot gnu dot org
--- Comment #25 from tobi at gcc dot gnu dot org 2009-08-14 22:46 --- (In reply to comment #23) Actually, you're right. In nested loops, there's no way without copying. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31593

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-14 Thread tobi at gcc dot gnu dot org
--- Comment #24 from tobi at gcc dot gnu dot org 2009-08-14 22:38 --- (In reply to comment #23) That's sad. I'm guessing that everytime it enters one of the inner loops, it has to deal with the fact that the upper bound escaped. A way without all the copying would be to set the DO var

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-14 Thread tkoenig at gcc dot gnu dot org
--- Comment #23 from tkoenig at gcc dot gnu dot org 2009-08-14 22:05 --- (In reply to comment #20) > Created an attachment (id=18369) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18369&action=view) [edit] > updated patch > > Corrected patch, I copied the variables in the wrong o

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-14 Thread tobi at gcc dot gnu dot org
--- Comment #22 from tobi at gcc dot gnu dot org 2009-08-14 21:46 --- (In reply to comment #21) > (In reply to comment #19) > > (In reply to comment #17) > > From quickly looking at the code, the copy to real_to is probably > > unnecessary > > because loop bounds are passed through gfc_

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-14 Thread tobi at gcc dot gnu dot org
--- Comment #21 from tobi at gcc dot gnu dot org 2009-08-14 21:44 --- (In reply to comment #19) > (In reply to comment #17) > From quickly looking at the code, the copy to real_to is probably unnecessary > because loop bounds are passed through gfc_evaluate_now before calling > gfc_trans

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-14 Thread tobi at gcc dot gnu dot org
--- Comment #20 from tobi at gcc dot gnu dot org 2009-08-14 21:31 --- Created an attachment (id=18369) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18369&action=view) updated patch Corrected patch, I copied the variables in the wrong order on loop entry, clobbering the upper boun

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-14 Thread mikael at gcc dot gnu dot org
--- Comment #19 from mikael at gcc dot gnu dot org 2009-08-14 21:18 --- (In reply to comment #17) >From quickly looking at the code, the copy to real_to is probably unnecessary because loop bounds are passed through gfc_evaluate_now before calling gfc_trans_simple_do ( never mind if it g

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-14 Thread jvdelisle at gcc dot gnu dot org
--- Comment #18 from jvdelisle at gcc dot gnu dot org 2009-08-14 20:18 --- Patch applied cleanly, building , and will test shortly -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31593

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-14 Thread tobi at gcc dot gnu dot org
--- Comment #17 from tobi at gcc dot gnu dot org 2009-08-14 19:55 --- Created an attachment (id=18368) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18368&action=view) Speed up loops where the loop variable is used as function argument inside the loop This patch gives the good ass

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-14 Thread tobi at gcc dot gnu dot org
--- Comment #16 from tobi at gcc dot gnu dot org 2009-08-14 19:28 --- Created an attachment (id=18367) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18367&action=view) use const * when writing Thomas, can you please test the attached patch with your testcase from comment #6. I ca

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-14 Thread tobi at gcc dot gnu dot org
--- Comment #15 from tobi at gcc dot gnu dot org 2009-08-14 18:12 --- I'm wondering if instead we can't simply mark all arguments to the transfer functions in PRINT, WRITE and INTENT(IN) arguments as 'const *' instead of '*'. Are there any reasons against this? I can't think of any exc

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-13 Thread Tobias Schlüter
--- Comment #14 from =?ISO-8859-1?Q?Tobias_Schl=FCter?= 2009-08-13 23:33 --- Subject: Re: Invariant DO loop variables and subroutines tkoenig at gcc dot gnu dot org wrote: > --- Comment #13 from tkoenig at gcc dot gnu dot org 2009-08-13 18:55 > --- > (In reply to comment #

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-13 Thread tkoenig at gcc dot gnu dot org
--- Comment #13 from tkoenig at gcc dot gnu dot org 2009-08-13 18:55 --- (In reply to comment #12) > That's exactly what Thomas is achieving by adding parentheses. Thomas, If you > want to tackle something more difficult, I'm willing to do this over the > weekend in order to warm up m

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-13 Thread tobi at gcc dot gnu dot org
--- Comment #12 from tobi at gcc dot gnu dot org 2009-08-13 13:39 --- (In reply to comment #11) > DO i = 1,10 > call bar(i) > END DO > > if bar may not modify i then the frontend can simply communicate that to the > middle-end by doing > > DO i = 1,10 > j = i; > call

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-13 Thread rguenth at gcc dot gnu dot org
--- Comment #11 from rguenth at gcc dot gnu dot org 2009-08-13 13:30 --- DO i = 1,10 call bar(i) END DO if bar may not modify i then the frontend can simply communicate that to the middle-end by doing DO i = 1,10 j = i; call bar (j) END DO likewise if loop bounds

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-13 Thread jv244 at cam dot ac dot uk
--- Comment #10 from jv244 at cam dot ac dot uk 2009-08-13 09:13 --- (In reply to comment #9) I believe there are at least two important independent issues. One is the fact that the compiler ignores INTENT(IN) and similarly issues (see also PR 40194). This holds for general variables. L

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-12 Thread tobi at gcc dot gnu dot org
--- Comment #9 from tobi at gcc dot gnu dot org 2009-08-12 20:52 --- Side remark: DO i = 1,10 call bar(i) END DO wouldn't be valid if bar changed its argument, i.e. the compiler should generate the same, better code it does for the case where you copy the argument (bar((i))). I

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-12 Thread tkoenig at gcc dot gnu dot org
--- Comment #8 from tkoenig at gcc dot gnu dot org 2009-08-12 20:36 --- (In reply to comment #7) > An interesting approach. As long as you don't print array slices in the > loops this should work around the escaping pointer problem. It comes at > the risk of creating excessive copie

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-12 Thread Tobias Schlüter
--- Comment #7 from =?ISO-8859-1?Q?Tobias_Schl=FCter?= 2009-08-12 18:11 --- Subject: Re: Invariant DO loop variables and subroutines tkoenig at gcc dot gnu dot org wrote: > --- Comment #6 from tkoenig at gcc dot gnu dot org 2009-08-12 17:53 > --- > We get a dramatic speedu

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-08-12 Thread tkoenig at gcc dot gnu dot org
--- Comment #6 from tkoenig at gcc dot gnu dot org 2009-08-12 17:53 --- We get a dramatic speedup when enclosing the arguments to print in parentheses: This is something we can do for - write and print statements - intent(in) arguments - any do variable passed as an argument within the

[Bug fortran/31593] Invariant DO loop variables and subroutines

2009-07-02 Thread burnus at gcc dot gnu dot org
--- Comment #5 from burnus at gcc dot gnu dot org 2009-07-02 12:36 --- > > call output (p1, p2, p3, p4) > > That still clobbers p1, p2, p3, and p4 as they are passed by reference so > > is it really undefined code if output changes the values for the do loop? > Yes. Conf

[Bug fortran/31593] Invariant DO loop variables and subroutines

2008-06-15 Thread fxcoudert at gcc dot gnu dot org
-- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|fxcoudert at gcc dot gnu dot|unassigned at gcc dot gnu |org

[Bug fortran/31593] Invariant DO loop variables and subroutines

2008-02-19 Thread fxcoudert at gcc dot gnu dot org
-- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |fxcoudert at gcc dot gnu dot |dot org

[Bug fortran/31593] Invariant DO loop variables and subroutines

2007-04-16 Thread tobi at gcc dot gnu dot org
--- Comment #4 from tobi at gcc dot gnu dot org 2007-04-17 01:14 --- (In reply to comment #3) > call output (p1, p2, p3, p4) > > That still clobbers p1, p2, p3, and p4 as they are passed by reference so is > it > really undefined code if output changes the values for th

[Bug fortran/31593] Invariant DO loop variables and subroutines

2007-04-16 Thread pinskia at gcc dot gnu dot org
--- Comment #3 from pinskia at gcc dot gnu dot org 2007-04-16 23:12 --- call output (p1, p2, p3, p4) That still clobbers p1, p2, p3, and p4 as they are passed by reference so is it really undefined code if output changes the values for the do loop? -- http://gcc.gnu

[Bug fortran/31593] Invariant DO loop variables and subroutines

2007-04-16 Thread tkoenig at gcc dot gnu dot org
--- Comment #2 from tkoenig at gcc dot gnu dot org 2007-04-16 23:03 --- (In reply to comment #1) > This is not suprising as it is a dup of bug 20165 anyways. > > *** This bug has been marked as a duplicate of 20165 *** Only one part. The other part is that we don't mark the variables