[Patch, Fortran] PR64771 - Fix coarray ICE

Jakub Jelinek jakub@redhat.com
Tue Jan 27 14:59:00 GMT 2015


On Tue, Jan 27, 2015 at 03:55:17PM +0100, Rainer Orth wrote:
> 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.

Why don't you use MAX macro instead of std::max as everywhere else
in the gcc sources?

Your change is wrong, you can't include system headers after including
system.h and other headers.

	Jakub



More information about the Fortran mailing list