Bug: Fatal error in iropt

Hi,

While compiling our code Octopus, I found a bug in the sun studio express fortran compiler (in x86 linux and sparc solaris). I made a bug report, but in that moment I wasn't able to reduce the file to a single file and in the bug report and I gave a pointer to our svn repository.

Now I was able to reduce the bug to a single subroutine and I would like to modify the report, but I couldn't find how to do it. My Review ID is 944794. Shall I submit a new bug report? As I will commit a workaround, my report will not be valid.

In any case I post here the code that triggers the bug, it appears when optimizations level is 3 or greater. The error is:

iropt: ../src/sr.c:8153: af_create_ir_node: Assertion `af->type == AF_NODE' failed.

f95: Fatal error in iropt: Aborted

[code]

subroutine sub(domain)

implicit none

integer :: no_f, i, last, grouplength, ii, domain

integer, parameter :: filter_freq = 1

grouplength = 0

i = 1

no_f = 10

do ii = 1, no_f

if(domain .eq. filter_freq) then

grouplength = grouplength + 1

end if

last = i + grouplength

end do

print*, last

end subroutine sub

[/code]

Removing the 'last = ...' statement of the loop or removing the 'print*... ' sentence the bug dissapears.

By the way, I am quite impressed with the perfomance of the sun studio compiler. I made some preliminary tests in x86 and for our code it seems to be faster than any other compiler.

[1551 byte] By [__xavier__a] at [2007-11-27 1:02:37]
# 1

Which version of studio express are you using (try "f95 -V" to get the official version and build date)?

The internal bug ID is 6545141, and it has been closed as a duplicate of another bug which was fixed. I tried to verify that it had been fixed, but I couldn't get any of the compilers that I used to fail with this subroutine.

igba at 2007-7-11 23:37:36 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2

Hi,

I get the problem in these two versions:

*i386 Linux:

uname -a: Linux ddraig 2.6.16.20 #1 PREEMPT Sat Jun 17 01:39:04 CEST 2006 i686 GNU/Linux

f95 -V: f95: Sun Fortran 95 8.3 Linux_i386 Build40_1 2007/02/09

f95: Sun Fortran 95 8.3 Linux_i386 Build40_1 2007/02/09

* Sparc Solaris:

uname -a: SunOS swsa00 5.9 Generic_117171-17 sun4u sparc SUNW,Netra-T12 Solaris

f95 -V: f95: Sun Fortran 95 8.3 SunOS_sparc Build40_1 2007/02/08

Please note that the bug only appears when -O3 or greater optimization is used.

__xavier__a at 2007-7-11 23:37:36 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3
OK, I can reproduce the problem with that build. More recent builds don't have the problem. Older builds also don't have the problem.
igba at 2007-7-11 23:37:36 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 4
Thank you very much.
__xavier__a at 2007-7-11 23:37:36 > top of Java-index,Development Tools,Solaris and Linux Development Tools...