From patchwork Tue Jan 27 16:09:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 433566 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7B9F71401E7 for ; Wed, 28 Jan 2015 03:10:18 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; q=dns; s=default; b=uWA2xZBTNdnem0UI QCPBfXKDLovNxAiSEAwcX43GhYB66bzWwsP5IT2ISQzZIoVnqZSwzOdUVCvD4J8a /kSdOtRZweP38QFbiVpXpBE2OIF3L1dBfhWac6I5fnRTx26oWmqLiEE/nb0DXzKB j7zysLGoJ3o0y9ZKHVUyIYtspsA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; s=default; bh=kcEI93km8+UpZ6jSDXQVyb WpmwY=; b=V6r5FROmYRj9+iAZjPmfC63Xyn3KKNkdIEgt363ICMIjAgvONro1s3 9aOz302cOjf0QKK8snKYDncbUJVnsmJw9uUmpN9vqi0IhvL11nYtr/l+SkdscSIi AsdfQavPNLSV43XgCb/eJnT1hzNKJY00ARNzGYivPmwKf1qw2c5W0= Received: (qmail 26848 invoked by alias); 27 Jan 2015 16:10:05 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 26795 invoked by uid 89); 27 Jan 2015 16:10:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: smtp-relay.CeBiTec.Uni-Bielefeld.DE Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Jan 2015 16:10:00 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 401D32CB2; Tue, 27 Jan 2015 17:09:58 +0100 (CET) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 15-Hguoo0SQc; Tue, 27 Jan 2015 17:09:56 +0100 (CET) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.110]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 5B5492CB1; Tue, 27 Jan 2015 17:09:56 +0100 (CET) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.14.7+Sun/8.14.7/Submit) id t0RG9tt4021908; Tue, 27 Jan 2015 17:09:55 +0100 (CET) From: Rainer Orth To: Jakub Jelinek Cc: Steve Kargl , Tobias Burnus , gcc-patches , gfortran , Alessandro Fanfarillo Subject: Re: [Patch, Fortran] PR64771 - Fix coarray ICE References: <54C3D2A0.5090905@net-b.de> <20150124201153.GA83897@troutmask.apl.washington.edu> <20150127145851.GH1746@tucnak.redhat.com> Date: Tue, 27 Jan 2015 17:09:55 +0100 In-Reply-To: <20150127145851.GH1746@tucnak.redhat.com> (Jakub Jelinek's message of "Tue, 27 Jan 2015 15:58:51 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Jakub Jelinek writes: >> The problem is (as so often) that 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? No idea, ask Tobias :-) Anyway, the original patch would most likely have worked: system.h already includes . This one compiles just as well, of course. Rainer 2015-01-27 Rainer Orth * interface.c: Remove . (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 /* 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]));