[Patch, Fortran] PR64771 - Fix coarray ICE

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Tue Jan 27 14:55:00 GMT 2015


Steve Kargl <sgk@troutmask.apl.washington.edu> writes:

> On Sat, Jan 24, 2015 at 06:13:04PM +0100, Tobias Burnus wrote:
>>        if (s1->as->type == AS_EXPLICIT)
>> -	for (i = 0; i < s1->as->rank + s1->as->corank; i++)
>> +	for (i = 0; i < s1->as->rank + std::max(0, s1->as->corank-1); i++)
>
> Doesn't this require '#include <algorithms>'?
> I suspect that you are depending on namespace pollution
> via some other header (coretypes.h?).

It was committed with that change, which unfortunately broke Solaris
bootstrap:

In file included from ./config.h:6:0,
                 from /vol/gcc/src/hg/trunk/local/gcc/fortran/interface.c:68:
./auto-host.h:2055:0: error: "_FILE_OFFSET_BITS" redefined [-Werror]
 #define _FILE_OFFSET_BITS 64
 ^
In file included from /usr/include/iso/stdlib_iso.h:24:0,
                 from /usr/include/stdlib.h:11,
                 from /var/gcc/regression/trunk/11-gcc/build/prev-i386-pc-solaris2.11/libstdc++-v3/include/cstdlib:72,
                 from /var/gcc/regression/trunk/11-gcc/build/prev-i386-pc-solaris2.11/libstdc++-v3/include/bits/stl_algo.h:59,
                 from /var/gcc/regression/trunk/11-gcc/build/prev-i386-pc-solaris2.11/libstdc++-v3/include/algorithm:62,
                 from /vol/gcc/src/hg/trunk/local/gcc/fortran/interface.c:66:
/var/gcc/regression/trunk/11-gcc/build/prev-gcc/include-fixed/sys/feature_tests.h:213:0: note: this is the location of the previous definition
 #define _FILE_OFFSET_BITS 32
 ^

The problem is (as so often) that <algorithm> was included *before*
config.h.  Moving it after the other includes allows interface.c to
compile without warnings.

Ok for mainline?

	Rainer


2015-01-27  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc/fortran:
	* interface.c: Include <algorithm> after config.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: int.patch
Type: text/x-patch
Size: 723 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20150127/49d5a9e2/attachment.bin>
-------------- next part --------------

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


More information about the Fortran mailing list