The attached patch changes the gfc_call_free() function to simply call 
__builtin_free() without first checking if the pointer is NULL, because 
free(NULL) is a nop. This simplifies code, but could lead to pessimization in 
cases where the pointer is likely to be NULL, and the test would have saved the 
function call. After auditing all the gfc_call_free() callers in the front-end, 
I come to the conclusion that there are no such cases (in fact, in most cases, 
the front-end knows for sure that the pointer is non-NULL, because it was just 
allocated some lines earlier).

Committed as rev. 227336 after bootstrap and regtesting on 
x86_64-apple-darwin15.

FX


Attachment: free.ChangeLog
Description: Binary data

Attachment: free.diff
Description: Binary data

Reply via email to