This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran] PR64771 - Fix coarray ICE
- From: Tobias Burnus <tobias dot burnus at physik dot fu-berlin dot de>
- To: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Steve Kargl <sgk at troutmask dot apl dot washington dot edu>, Tobias Burnus <burnus at net-b dot de>, gcc-patches <gcc-patches at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>
- Date: Tue, 27 Jan 2015 17:41:33 +0100
- Subject: Re: [Patch, Fortran] PR64771 - Fix coarray ICE
- Authentication-results: sourceware.org; auth=none
Rainer Orth wrote:
> > Why don't you use MAX macro instead of std::max as everywhere else
> > in the gcc sources?
>
> No idea, ask Tobias :-)
No real reason - presumably, because I had MAX not in mind and thought
of the general move towards standard features.
> Anyway, the original patch would most likely
> have worked: system.h already includes <algorithm>.
It did on my system :-)
> This one compiles just as well, of course.
>From my side, that patch (using MAX) is fine. Thanks for
bearing the bootstrap failure and for the patch.
Tobias
> 2015-01-27 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
>
> * interface.c: Remove <algorithm>.
> (check_dummy_characteristics): Use MAX instead of std::max.
>
> # HG changeset patch
> # Parent a742f8ce2a00e481ddf92dbecaf8d1ee01448911
> Avoid std::max
>
> diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
> --- a/gcc/fortran/interface.c
> +++ b/gcc/fortran/interface.c
> @@ -63,8 +63,6 @@ along with GCC; see the file COPYING3.
> formal argument list points to symbols within the same namespace as
> the program unit name. */
>
> -#include <algorithm> /* For std::max. */
> -
> #include "config.h"
> #include "system.h"
> #include "coretypes.h"
> @@ -1215,7 +1213,7 @@ check_dummy_characteristics (gfc_symbol
> }
>
> if (s1->as->type == AS_EXPLICIT)
> - for (i = 0; i < s1->as->rank + std::max(0, s1->as->corank-1); i++)
> + for (i = 0; i < s1->as->rank + MAX (0, s1->as->corank-1); i++)
> {
> shape1 = gfc_subtract (gfc_copy_expr (s1->as->upper[i]),
> gfc_copy_expr (s1->as->lower[i]));