[Prev][Next][Index]

problem with insertStatementAfter(SgStatement &s);



It looks the insertStatementAfter() is confused with end of a loop right before
the end of a program. I applied the simple instrumentation program on the 
following test fortran program:
          program test
          integer a(20)
          do 10 i = 1, 20
            a(i) = i
10        continue
          end

and got output:
         program test
         call exit_event(3)           //This shouold not be here !
         integer  a(20)
         call entry_event(0)
         call loop_entry_event(1)
         do  i = 1,20
            a(i) = i
         enddo
         call loop_exit_event(2)
         end

I traced the instrumenter, found that it knows the correct line number for
statement "10    continue" right before it performs an s->insertStmtAfter(*c).
Then I modified the test program by adding "i=i+1" before the "end", the 
instrumenter worked OK.

Any idea about it ?

-X