This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/39280] New: Optimizing integer power


$ cat foo.f90
subroutine foo
  implicit none
  integer :: i,n
  do i=1,10
    n = (-1)**(i+1)
    call bar(n)
  end do
end subroutine foo
$ gfortran -S -O2 -fdump-tree-optimized foo.f90
...

  i = i + 1;
  n.0 = _gfortran_pow_i4_i4 (-1, i);
  n = n.0;
  bar (&n);

We could eliminate the call to _gfortran_pow_i4_i4.


-- 
           Summary: Optimizing integer power
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39280


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]