From patchwork Tue Sep 7 19:29:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 64056 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]) by ozlabs.org (Postfix) with SMTP id 62C60B6F0E for ; Wed, 8 Sep 2010 05:30:07 +1000 (EST) Received: (qmail 20427 invoked by alias); 7 Sep 2010 19:30:04 -0000 Received: (qmail 20372 invoked by uid 22791); 7 Sep 2010 19:30:04 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp5.netcologne.de (HELO smtp5.netcologne.de) (194.8.194.25) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 07 Sep 2010 19:29:58 +0000 Received: from [192.168.0.196] (xdsl-78-34-104-17.netcologne.de [78.34.104.17]) by smtp5.netcologne.de (Postfix) with ESMTP id 8A05040CB0B; Tue, 7 Sep 2010 21:29:55 +0200 (CEST) Subject: [patch, fortran] Fix PR 45576 (Regression involving char lengths) From: Thomas Koenig To: fortran@gcc.gnu.org Cc: gcc-patches@gcc.gnu.org Date: Tue, 07 Sep 2010 21:29:55 +0200 Message-ID: <1283887795.3786.38.camel@linux-fd1f.site> Mime-Version: 1.0 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 Hello world, this fixes a regression introduced by my changes to gfc_deb_compare_expr and exposed by my recent changes to string comparison. OK for trunk? Thomas 2010-09-07 Thomas Koenig PR fortran/45576 * dependency.c (gfc_deb_compare_expr): Take missing optional arguments into account. 2010-09-07 Thomas Koenig PR fortran/45576 * gfortran.dg/char_length_18.f90: New test. Index: dependency.c =================================================================== --- dependency.c (Revision 163868) +++ dependency.c (Arbeitskopie) @@ -368,8 +368,14 @@ gfc_dep_compare_expr (gfc_expr *e1, gfc_expr *e2) /* Compare the argument lists for equality. */ while (args1 && args2) { - if (gfc_dep_compare_expr (args1->expr, args2->expr) != 0) + /* Bitwise xor, since C has no non-bitwise xor operator. */ + if ((args1->expr == NULL) ^ (args2->expr == NULL)) return -2; + + if (args1->expr != NULL && args2->expr != NULL + && gfc_dep_compare_expr (args1->expr, args2->expr) != 0) + return -2; + args1 = args1->next; args2 = args2->next; }