From patchwork Sun Sep 16 12:19:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 184127 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 1C3FF2C0083 for ; Sun, 16 Sep 2012 22:19:52 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1348402794; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=RZP22tD 7+R/hNYu52fPcjohYV20=; b=eRHC0kVdO0vAK3ZLdKHd4WRRKmDgjFOhu/yMu+/ pnw+Xu6qSiRvUmZtQDcueGv4T/n6r1ydiZevIXgUNJV13/mSa+S80UmwzgNeAPzL BeN1bKsp9Lb2nBsBZa/Qe10IGCrs7i1AKS5RkgdllKFgUUTZ16yqHiA8xn9WjLwn I8Ds= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=XLrnQCGR8q3LOafxjYw5SKh9TuyoB2davxiIR9h3PPPrgAl2xUbS3wzLnoyCp9 NunO3KTTlkt0Ps7fEHmOpCfqv9/p+Zh39VgD5QuKjQSZ5YyuCb1/4KRVdDrg20Z8 Wdo26RQeMjAAEyrWlHGDM8tMLOz3nH8UjfEEnnGEf3/Ts=; Received: (qmail 26715 invoked by alias); 16 Sep 2012 12:19:43 -0000 Received: (qmail 26696 invoked by uid 22791); 16 Sep 2012 12:19:42 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mx01.qsc.de (HELO mx01.qsc.de) (213.148.129.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 16 Sep 2012 12:19:28 +0000 Received: from [192.168.178.22] (port-92-204-67-8.dynamic.qsc.de [92.204.67.8]) by mx01.qsc.de (Postfix) with ESMTP id 833D73EBEF; Sun, 16 Sep 2012 14:19:27 +0200 (CEST) Message-ID: <5055C3CF.7020206@net-b.de> Date: Sun, 16 Sep 2012 14:19:27 +0200 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120825 Thunderbird/15.0 MIME-Version: 1.0 To: gcc patches , gfortran Subject: [Patch, Fortran] (3/n) Fix bit/logical bugs found by Coverity 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 Committed as obvious (Rev. 191358) after building and successfully regtesting on x86-64-linux. I collected some futher bugs in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54599. There several additional ones, but many are bogus. I think the most common "defect" is that one dereferences a pointer and either before or afterwards one checks whether it is NULL. And there are several places where gfortran leaks memory. Tobias Index: gcc/fortran/ChangeLog =================================================================== --- gcc/fortran/ChangeLog (Revision 191357) +++ gcc/fortran/ChangeLog (Arbeitskopie) @@ -1,3 +1,10 @@ +2012-09-16 Tobias Burnus + + * trans-decl.c (gfc_generate_function_code): Fix + gfc_option.coarray check. + * trans-stmt.c (compute_inner_temp_size): Fix handling + of gfc_option.rtcheck. + 2012-09-16 Mikael Morin * symbol.c (gfc_undo_symbols): Correctly undo namelists. Index: gcc/fortran/trans-decl.c =================================================================== --- gcc/fortran/trans-decl.c (Revision 191357) +++ gcc/fortran/trans-decl.c (Arbeitskopie) @@ -5480,7 +5480,7 @@ gfc_generate_function_code (gfc_namespace * ns) } current_function_decl = old_context; - if (decl_function_context (fndecl) && !gfc_option.coarray == GFC_FCOARRAY_LIB + if (decl_function_context (fndecl) && gfc_option.coarray != GFC_FCOARRAY_LIB && has_coarray_vars) /* Register this function with cgraph just far enough to get it added to our parent's nested function list. Index: gcc/fortran/trans-stmt.c =================================================================== --- gcc/fortran/trans-stmt.c (Revision 191357) +++ gcc/fortran/trans-stmt.c (Arbeitskopie) @@ -3132,7 +3132,7 @@ compute_inner_temp_size (gfc_expr *expr1, gfc_expr /* Calculate the bounds of the scalarization. */ save_flag = gfc_option.rtcheck; - gfc_option.rtcheck &= !GFC_RTCHECK_BOUNDS; + gfc_option.rtcheck &= ~GFC_RTCHECK_BOUNDS; gfc_conv_ss_startstride (&loop); gfc_option.rtcheck = save_flag; gfc_conv_loop_setup (&loop, &expr2->where);