From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21947 invoked by alias); 28 Mar 2010 13:57:01 -0000 Received: (qmail 21895 invoked by uid 48); 28 Mar 2010 13:56:49 -0000 Date: Sun, 28 Mar 2010 13:57:00 -0000 Message-ID: <20100328135649.21894.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/42958] Weird temporary array allocation In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-03/txt/msg02864.txt.bz2 ------- Comment #14 from burnus at gcc dot gnu dot org 2010-03-28 13:56 ------- Created an attachment (id=20230) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20230&action=view) Draft patch for NULL check for deallocation Draft patch for removing the NULL check before __builtin_free. According to POSIX, passing NULL to free is allowed. The patch removes all the NULL checks where it is likely that the temporary is not-NULL. For procedure arguments (_gfortran_pack/_gfortran_unpack) the chance is high that it is NULL - which is the case if the variable was already contiguous. Thus, I left the check in. The patch removes 5 of the 15 "!= 0" checks for the test case (attachment 20225). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42958