------- Comment #4 from burnus at gcc dot gnu dot org 2007-04-27 17:42 ------- Created an attachment (id=13456) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13456&action=view) Test case
Writing test cases first helps! I need go back to the drawing board as the pos = pos + 1 is not added for empty arrays. The attached test case works with NAG f95, g95 and sunf95; it fails 24 times ("1" should be "0") with ifort and 18 times with unmodified gfortran (0 not 1 plus other bugs). It does not test the library function though. The test case shows however some additional problems where pos = pos.1 - (from - 1) ! from = starting index of the array does not work correctly (e.g. "3" instead of "2") -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31726