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/31593] Invariant DO loop variables and subroutines



------- 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 in a do
statement as unchanging.

Consider the following:

$ cat count-3.f90
program main
  implicit none
  integer, parameter :: value = 747
  integer :: p1, p2, p3, p4
  integer :: i

  do i=1, 10
     do p1 = 1, value-2
        do p2 = p1 + 1, value - p1
           do p3 = p2 + 1, value - p1 - p2
              p4 = value - p1 - p2 - p3
              if (p1 * p2 * p3 * p4 == value * 1000000) &
                call output (p1, p2, p3, p4)
           end do
        end do
     end do
  end do
end program main

This produces the (partial) dump

<L34>:;
  p2.2 = p2;
  p3.4 = p2.2 + 1;
  D.1014 = (747 - p1) - p2.2;
  p3 = p3.4;
  if (p3.4 <= D.1014) goto <L35>; else goto <L12>;

<L35>:;
  p1.57 = p1;
  p2.59 = p2;
  p3.60 = p3;
  p4.6 = ((747 - p1.57) - p2.59) - p3.60;
  p4 = p4.6;
  if (((p2.59 * p1.57) * p3.60) * p4.6 == 747000000) goto <L8>; else goto <L9>;

Reopening, adjusting subject.


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |
            Summary|Invariant DO loop variables |Invariant DO loop variables
                   |(and I/O)                   |and subroutines


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


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