This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/36840] Fortran complex array multiply missed optimization
- From: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jul 2008 19:03:10 -0000
- Subject: [Bug fortran/36840] Fortran complex array multiply missed optimization
- References: <bug-36840-15800@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from kargl at gcc dot gnu dot org 2008-07-15 19:03 -------
This would appear to be a middle-end or back-end issue. Given
-fdump-tree-original to 4.2.3, one finds
complex_mult_test (iy, ix, nx)
{
S.4 = 1;
while (1)
{
if (S.4 > ubound.0) goto L.1; else (void) 0;
(*iy)[NON_LVALUE_EXPR <S.4> + -1] = (*iy)[NON_LVALUE_EXPR <S.4> + -1]
* (*ix)[NON_LVALUE_EXPR <S.4> + -1];
S.4 = S.4 + 1;
}
If I use 4.4.0, I get
complex_mult_test (complex(kind=8)[0:D.1020] * iy,
complex(kind=8)[0:D.1017] * ix, integer(kind=4) & nx)
{
S.4 = 1;
while (1)
{
if (S.4 > ubound.2) goto L.1;
(*iy)[S.4 + -1] = (*iy)[S.4 + -1] * (*ix)[S.4 + -1];
S.4 = S.4 + 1;
}
In either case, gfortran hands the middle-end the complex multiplication.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36840