This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/37536] [4.3/4.4 Regression] a mfcr is produced instead of branches for DO loops
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Sep 2008 15:55:30 -0000
- Subject: [Bug fortran/37536] [4.3/4.4 Regression] a mfcr is produced instead of branches for DO loops
- References: <bug-37536-6528@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from pinskia at gcc dot gnu dot org 2008-09-16 15:55 -------
(In reply to comment #5)
> (In reply to comment #2)
> Hi Andrew,
>
> Does this do it for you or is this all to rarified for this
> Bear-of-little-brain to follow?
>
> D.1359 = *start - *offset;
> D.1360 = *end + *offset;
> D.1361 = *step;
> D.1364 = D.1361 > 0 ? D.1360 < D.1359 : D.1360 > D.1359; /* Fix the
> result*/
> if (D.1364) goto L.2; /* Then branch */
The issue is that D.1364 is used to the store of the result of a comparison.
Since GCC does not currently optimize that case, the front-end could rewrite
the if statement to begin with; this is what Jabuk's patch does (Thanks
Jabuk!).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37536