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

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-02-06 
17:45:36 UTC ---
(In reply to comment #2)
> Thank you for the information. THe work-around works with the newer (4.6.2)
> compiler, but is unrecognized by older versions of gcc that are in use on
> - for example - NERSC computers.

Well, the bug is related to (re)allocation on assignment (a Fortran 2003
features), which is new in GCC 4.6. Thus, both the flag -f(no-)realloc-lhs but
also the bug is only in GCC 4.6 (and 4.7).

You could also use "-std=f95", which implies -fno-realloc-lhs with GCC 4.6/4.7
but is also supported in older gfortrans; however, you need to have a code
which follows Fortran 95 close enough to be compilable with that flag.


> Is there a FIX other than the workaround planned, that will be backwards
> compatible with older compilers?

The actual bug has been fixed on both the GCC 4.6 branch (on 2012-02-03) and on
the GCC 4.7 trunk (on 2012-02-02). Thus, if you have a newer version of GCC
4.6/4.7, you are also not affected. (Cf. the nightly build from
http://gcc.gnu.org/wiki/GFortranBinaries )

See bug 52012 for details.


> Also, the B(:) fails on some platforms, I'm told by some of my co-workers.

Can you provides more details? Using "B(:) =" prevents the (re)allocation of
the left-hand side and thus it should also prevent the bug.

In particular:
- How does it fail? At compile time? At run time? With which error?
- Which version/platform of the compiler are you using?
- Is that with the code of comment 0 with only "B = RESHAPE..." changed to
"B(:) = RESHAPE..." or is it for some other code?

Reply via email to