[Bug fortran/42131] Weird translation of DO loops

2009-12-04 Thread dominiq at lps dot ens dot fr
--- Comment #29 from dominiq at lps dot ens dot fr 2009-12-04 14:24 --- AFAICT the inner loop of PR42108 is still unrolled. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42131

[Bug fortran/42131] Weird translation of DO loops

2009-12-02 Thread jb at gcc dot gnu dot org
--- Comment #28 from jb at gcc dot gnu dot org 2009-12-02 09:23 --- Subject: Bug 42131 Author: jb Date: Wed Dec 2 09:22:50 2009 New Revision: 154900 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154900 Log: Typo in ChangeLog entry for PR fortran/42131 Modified: trunk/gcc/

[Bug fortran/42131] Weird translation of DO loops

2009-12-01 Thread jb at gcc dot gnu dot org
--- Comment #27 from jb at gcc dot gnu dot org 2009-12-01 18:32 --- Subject: Bug 42131 Author: jb Date: Tue Dec 1 18:32:37 2009 New Revision: 154876 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154876 Log: PR fortran/42131 Sign test using ternary operator Modified: trunk

[Bug fortran/42131] Weird translation of DO loops

2009-12-01 Thread rguenther at suse dot de
--- Comment #26 from rguenther at suse dot de 2009-12-01 09:42 --- Subject: Re: Weird translation of DO loops On Mon, 30 Nov 2009, tkoenig at gcc dot gnu dot org wrote: > > > --- Comment #22 from tkoenig at gcc dot gnu dot org 2009-11-30 19:15 > --- > (In reply to comment

[Bug fortran/42131] Weird translation of DO loops

2009-11-30 Thread tkoenig at gcc dot gnu dot org
--- Comment #25 from tkoenig at gcc dot gnu dot org 2009-11-30 21:01 --- Fixed on trunk. Closing. -- tkoenig at gcc dot gnu dot org changed: What|Removed |Added

[Bug fortran/42131] Weird translation of DO loops

2009-11-30 Thread tkoenig at gcc dot gnu dot org
--- Comment #24 from tkoenig at gcc dot gnu dot org 2009-11-30 20:35 --- Subject: Bug 42131 Author: tkoenig Date: Mon Nov 30 20:35:41 2009 New Revision: 154839 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154839 Log: 2009-11-30 Thomas Koenig PR fortran/42131

[Bug fortran/42131] Weird translation of DO loops

2009-11-30 Thread jvdelisle at gcc dot gnu dot org
--- Comment #23 from jvdelisle at gcc dot gnu dot org 2009-11-30 20:19 --- Thomas, Ido not have email access at the moment. I reviewed your patch and it is approved for trunk. Thanks for the work. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42131

[Bug fortran/42131] Weird translation of DO loops

2009-11-30 Thread tkoenig at gcc dot gnu dot org
--- Comment #22 from tkoenig at gcc dot gnu dot org 2009-11-30 19:15 --- (In reply to comment #21) > the "sign" for unsigned steps is always 1, you don't seem to account > for unsignedness? (Un)fortunately, there are no unsigned varaibles in Fortran. > Note that I believe generating

[Bug fortran/42131] Weird translation of DO loops

2009-11-30 Thread rguenther at suse dot de
--- Comment #21 from rguenther at suse dot de 2009-11-30 10:10 --- Subject: Re: Weird translation of DO loops On Mon, 30 Nov 2009, tkoenig at gcc dot gnu dot org wrote: > --- Comment #20 from tkoenig at gcc dot gnu dot org 2009-11-30 07:31 > --- > Created an attachment (id=1

[Bug fortran/42131] Weird translation of DO loops

2009-11-29 Thread tkoenig at gcc dot gnu dot org
--- Comment #20 from tkoenig at gcc dot gnu dot org 2009-11-30 07:31 --- Created an attachment (id=19182) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19182&action=view) Patch that works for unrolling It also passes do_3.F90. I'll submit just in time for meeting the phase 4 dea

[Bug fortran/42131] Weird translation of DO loops

2009-11-28 Thread tkoenig at gcc dot gnu dot org
--- Comment #19 from tkoenig at gcc dot gnu dot org 2009-11-28 15:16 --- (In reply to comment #18) > Well, in that case you can as well rely on twos-complement > arithmetic and avoid all the overflow issues? This is difficult without if statements or MAX_EXPR and MIN_EXPR, because I n

[Bug fortran/42131] Weird translation of DO loops

2009-11-27 Thread rguenther at suse dot de
--- Comment #18 from rguenther at suse dot de 2009-11-27 09:48 --- Subject: Re: Weird translation of DO loops On Thu, 26 Nov 2009, tkoenig at gcc dot gnu dot org wrote: > --- Comment #15 from tkoenig at gcc dot gnu dot org 2009-11-26 23:43 > --- > (In reply to comment #14) >

[Bug fortran/42131] Weird translation of DO loops

2009-11-27 Thread rguenther at suse dot de
--- Comment #17 from rguenther at suse dot de 2009-11-27 09:47 --- Subject: Re: Weird translation of DO loops On Thu, 26 Nov 2009, tkoenig at gcc dot gnu dot org wrote: > --- Comment #13 from tkoenig at gcc dot gnu dot org 2009-11-26 21:56 > --- > Created an attachment (id=1

[Bug fortran/42131] Weird translation of DO loops

2009-11-27 Thread burnus at gcc dot gnu dot org
--- Comment #16 from burnus at gcc dot gnu dot org 2009-11-27 08:29 --- (In reply to comment #12) > > Any tricks I have missed? > Yes - we could provide for loop versioning in the front end. [...] > ELSE >ABORT "M3 MUST NOT BE ZERO" > ENDIF Just for completeness a zeroness check is

[Bug fortran/42131] Weird translation of DO loops

2009-11-26 Thread tkoenig at gcc dot gnu dot org
--- Comment #15 from tkoenig at gcc dot gnu dot org 2009-11-26 23:43 --- (In reply to comment #14) > Looks much better than the current situation. Is there a valid > reason for the character(kind=4) casts? I would have thought > that this should be a integer(kind=4). The casts are g

[Bug fortran/42131] Weird translation of DO loops

2009-11-26 Thread kargl at gcc dot gnu dot org
--- Comment #14 from kargl at gcc dot gnu dot org 2009-11-26 22:07 --- (In reply to comment #13) > } > countm1.1 = (((character(kind=4)) D.1338 - (character(kind=4)) D.1337) * > (character(kind=4)) step_sign.2) / (character(kind=4)) (step_sign.2 * D.1339); > > implementing the

[Bug fortran/42131] Weird translation of DO loops

2009-11-26 Thread tkoenig at gcc dot gnu dot org
--- Comment #13 from tkoenig at gcc dot gnu dot org 2009-11-26 21:56 --- Created an attachment (id=19159) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19159&action=view) patch that implements the multiplication idea This generates if (D.1339 > 0) { if (D.1338 <

[Bug fortran/42131] Weird translation of DO loops

2009-11-24 Thread toon at moene dot org
--- Comment #12 from toon at moene dot org 2009-11-24 18:03 --- > Any tricks I have missed? Yes - we could provide for loop versioning in the front end. I.e., generate code like: IF (M3 > 0) THEN ... compute loop count ... ... perform loop ... ELSE IF (M3 < 0) THEN ... comput

[Bug fortran/42131] Weird translation of DO loops

2009-11-23 Thread tkoenig at gcc dot gnu dot org
--- Comment #11 from tkoenig at gcc dot gnu dot org 2009-11-23 21:48 --- Created an attachment (id=19104) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19104&action=view) another proposed patch Here's another proposed patch, but there is a problem with it. If we calculate (m2 -

[Bug fortran/42131] Weird translation of DO loops

2009-11-22 Thread burnus at gcc dot gnu dot org
--- Comment #10 from burnus at gcc dot gnu dot org 2009-11-22 19:04 --- "Do loop with HUGE stepsize": http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/63348a0461ccf3e0 > Current status is that g77 prints 0 and gfortran prints 1. To add: NAG f95, g95, sunf95, and ifo

[Bug fortran/42131] Weird translation of DO loops

2009-11-22 Thread toon at moene dot org
--- Comment #9 from toon at moene dot org 2009-11-22 10:20 --- Richard wondered about this earlier: >countm1.1 = (character(kind=4)) (D.1337 - D.1336) / (character(kind=4)) D.1338; but perhaps it's better to asked explicitly: Where does the "(character(kind=4))" comes from in this

[Bug fortran/42131] Weird translation of DO loops

2009-11-21 Thread tkoenig at gcc dot gnu dot org
--- Comment #8 from tkoenig at gcc dot gnu dot org 2009-11-21 23:42 --- Subject: Re: Weird translation of DO loops On Sat, 2009-11-21 at 23:23 +, rguenther at suse dot de wrote: > That's better. Not yet correct, though, this causes regressions for program main charac

[Bug fortran/42131] Weird translation of DO loops

2009-11-21 Thread rguenther at suse dot de
--- Comment #7 from rguenther at suse dot de 2009-11-21 23:23 --- Subject: Re: Weird translation of DO loops On Sat, 21 Nov 2009, tkoenig at gcc dot gnu dot org wrote: > --- Comment #6 from tkoenig at gcc dot gnu dot org 2009-11-21 23:07 > --- > Created an attachment (id=190

[Bug fortran/42131] Weird translation of DO loops

2009-11-21 Thread tkoenig at gcc dot gnu dot org
--- Comment #6 from tkoenig at gcc dot gnu dot org 2009-11-21 23:07 --- Created an attachment (id=19076) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19076&action=view) proposed patch This patch generates D.1336 = m1; D.1337 = m2; D.1338 = m3; i = D.1336; if

[Bug fortran/42131] Weird translation of DO loops

2009-11-21 Thread toon at moene dot org
--- Comment #5 from toon at moene dot org 2009-11-21 21:40 --- > The middle-end prefers do { } while () loop style so it knows the loop is > always executed. And the Fortran Standard describes the loops being built (by compilers) just so: 1. First you determine what is m1, m2, m3 2. T

[Bug fortran/42131] Weird translation of DO loops

2009-11-21 Thread rguenth at gcc dot gnu dot org
--- Comment #4 from rguenth at gcc dot gnu dot org 2009-11-21 19:24 --- The middle-end prefers do { } while () loop style so it knows the loop is always executed. It even tries to transform other loop forms into this by copying the loop header. So if the FE already can cheaply produce

[Bug fortran/42131] Weird translation of DO loops

2009-11-21 Thread tkoenig at gcc dot gnu dot org
--- Comment #3 from tkoenig at gcc dot gnu dot org 2009-11-21 18:31 --- (In reply to comment #2) > Sorry, Steve - my mistake. > > The original message should have been: > > To illustrate this with a simple example: > > DO I = M1, M2, M3 >B(I) = A(I) > ENDDO > > would be most easi

[Bug fortran/42131] Weird translation of DO loops

2009-11-21 Thread toon at moene dot org
--- Comment #2 from toon at moene dot org 2009-11-21 17:33 --- Sorry, Steve - my mistake. The original message should have been: To illustrate this with a simple example: DO I = M1, M2, M3 B(I) = A(I) ENDDO would be most easily, and straightforwardly, implemented as follows:

[Bug fortran/42131] Weird translation of DO loops

2009-11-21 Thread kargl at gcc dot gnu dot org
--- Comment #1 from kargl at gcc dot gnu dot org 2009-11-21 16:26 --- (In reply to comment #0) > To illustrate this with a simple example: > > DO I = M1, M2, M3 >B(I) = A(I) > ENDDO > > would be most easily, and atraightforwardly, implemented as follows: > > IF (M3 > 0 .AND.