The attached patch simplifies code in various gcc/fortran/trans* routines 
related to malloc and free:

  - we don’t need to check if types match before calling fold_convert(): 
fold_convert() does it itself
  - in some cases where the argument is used only once, we don’t need to call 
gfc_evaluate_now()
  - in other cases, we can used save_expr() instead of gfc_evaluate_now(), 
which is simpler to use and doesn’t create a new decl
  - the callers of gfc_call_free() don’t need to convert their argument to 
pvoid_type_node: gfc_call_free() itself does it

The resulting code is simpler, shorter and more unified.

Committed as revision 227316, after regtesting on x86_64-pc-linux-gnu.

FX


Attachment: x.ChangeLog
Description: Binary data

Attachment: x.diff
Description: Binary data

Reply via email to