------- 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