This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[fortran,committed] Simplify code for memory allocation and freeing


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]