From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7744 invoked by alias); 25 Jul 2010 15:52:38 -0000 Received: (qmail 7721 invoked by uid 22791); 25 Jul 2010 15:52:37 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mx02.qsc.de (HELO mx02.qsc.de) (213.148.130.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 25 Jul 2010 15:52:03 +0000 Received: from [192.168.178.22] (port-92-204-52-63.dynamic.qsc.de [92.204.52.63]) by mx02.qsc.de (Postfix) with ESMTP id BEC421D956; Sun, 25 Jul 2010 17:52:00 +0200 (CEST) Message-ID: <4C4C5DA0.9040708@net-b.de> Date: Sun, 25 Jul 2010 15:52:00 -0000 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.10) Gecko/20100520 SUSE/3.0.5 Thunderbird/3.0.5 MIME-Version: 1.0 To: Thomas Koenig CC: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [patch, fortran] PR 40628, front-end optimization pass References: <1279391905.4628.7.camel@linux-fd1f.site> <4C42BF4D.20400@domob.eu> <4C43D07A.9050500@verizon.net> <1279578709.9185.9.camel@linux-fd1f.site> <4C44F9A4.1080908@verizon.net> <4C4558AF.60309@net-b.de> <4C455DAD.9020509@domob.eu> <4C456FE6.7010805@moene.org> <1279663274.29693.4.camel@linux-fd1f.site> In-Reply-To: <1279663274.29693.4.camel@linux-fd1f.site> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-07/txt/msg01990.txt.bz2 Thomas Koenig wrote: > Well, here is an updated version of the patch. > > I have also changed the place where the gfc_run_passes is called to > resolve.c, as pault had suggested on IRC. > > Regression-tested, only allocate_with_typespec.f90 failed (which I also > saw on gcc-testresults). > OK? > OK. Thanks for the patch - and sorry for the late review. Nits: Index: gfortran.h +/* passes.c */ + +void gfc_run_passes (gfc_namespace *); Update the filename in the comment. ! { dg-final { scan-tree-dump-times "memmove" 2 "original" } } Can you add: ! { dg-final { scan-tree-dump-times "string_trim" 0 "original" } } /* Check for direct comparison between identical variables. TODO: Handle cases with identical refs. */ if (op1->expr_type == EXPR_VARIABLE && op2->expr_type == EXPR_VARIABLE && op1->symtree == op2->symtree && op1->ref == NULL && op2->ref == NULL && op1->ts.type != BT_REAL && op2->ts.type != BT_REAL && op1->ts.type != BT_COMPLEX && op2->ts.type !=BT_COMPLEX) Is there a reason that you do not include REAL and COMPLEX variables, but everything else? (characters, derived types, polymorphic types (class), integer, Hollerith, ...). Especially, as derived types can also contains real/complex variables ;-) It seems to be save to do this comparison also for REAL and COMPLEX. Tobias > 2010-07-20 Thomas Koenig > > * Make-lang.in: Add fortran/frontend-passes.o. > * gfortran.h: Add prototype for gfc_run_passes. > * resolve.c (gfc_resolve): Call gfc_run_passes. > * frontend-passes.c: New file. > > 2010-0717 Thomas Koenig > > * trim_optimize_1.f90: New test. > * character_comparision_1.f90: New test. >