This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[Patch, fortran] Avoid creating unnecessary type node
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 26 Jul 2007 17:25:36 +0300
- Subject: [Patch, fortran] Avoid creating unnecessary type node
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:content-type; b=VGZ/QjodTlldtl8ltWR5QGEVWGox41p6kRQmjjPZHzcC+E7lpWdpL85eQyzCVGTqYH1dJlzizvGCYtuGHjfPzTncmwuuJWo1sXNPYuEFnap0Drk55eVs5zV1Kb+VrVFsAC/VjzSCXnz6jwXx6hFiO845OcZhKqiH3GwMfFPgZlI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:content-type; b=f7NPU4HynuSwhUeZHMU1fUMfwVAEfpbeSG7FOVT5wt5xdu31ySK3l/fPV0gNB89qU8uUTwpaCSLQvIbn9m0DQIfozMX2jB5TM0GpFZX2CBb7VpPSCBDtMVLwGkOSXO9E8M3NhFo1CGmF5pVdtIpnM0kwO3Yfr7gb+qlsxON8I9A=
Hi,
another obvious patch that I intend to commit in 24h, unless objections
arise. We don't need to create tree gfc_index_int_type_node, which is
identical to tree gfc_array_index_type.
--
Janne Blomqvist
2007-07-26 Janne Blomqvist <jb@gcc.gnu.org>
* trans-decl.c (gfc_build_builtin_function_decls): Use existing
gfc_array_index_type rather than creating another typenode for
gfc_index_integer_kind.
Index: trans-decl.c
===================================================================
--- trans-decl.c (revision 126947)
+++ trans-decl.c (working copy)
@@ -2283,24 +2283,23 @@ gfc_build_builtin_function_decls (void)
tree gfc_int4_type_node = gfc_get_int_type (4);
tree gfc_logical4_type_node = gfc_get_logical_type (4);
tree gfc_pint4_type_node = build_pointer_type (gfc_int4_type_node);
- tree gfc_index_int_type_node = gfc_get_int_type (gfc_index_integer_kind);
gfor_fndecl_internal_realloc =
gfc_build_library_function_decl (get_identifier
(PREFIX("internal_realloc")),
pvoid_type_node, 2, pvoid_type_node,
- gfc_index_int_type_node);
+ gfc_array_index_type);
gfor_fndecl_allocate =
gfc_build_library_function_decl (get_identifier (PREFIX("allocate")),
pvoid_type_node, 2,
- gfc_index_int_type_node, gfc_pint4_type_node);
+ gfc_array_index_type, gfc_pint4_type_node);
DECL_IS_MALLOC (gfor_fndecl_allocate) = 1;
gfor_fndecl_allocate_array =
gfc_build_library_function_decl (get_identifier (PREFIX("allocate_array")),
pvoid_type_node, 3, pvoid_type_node,
- gfc_index_int_type_node, gfc_pint4_type_node);
+ gfc_array_index_type, gfc_pint4_type_node);
DECL_IS_MALLOC (gfor_fndecl_allocate_array) = 1;
gfor_fndecl_deallocate =