diff options
author | Janne Blomqvist <jb@gcc.gnu.org> | 2007-07-01 15:08:59 +0300 |
---|---|---|
committer | Janne Blomqvist <jb@gcc.gnu.org> | 2007-07-01 15:08:59 +0300 |
commit | a6bd380438744b75e0f86176c6fe337126b6be27 (patch) | |
tree | 5bb9fc2057f4bb1d9f02aaf996558df2062ba915 /gcc/fortran | |
parent | c67e4bcd9f1a4dff58973ea9b3bf3297b0cdc709 (diff) | |
download | gcc-a6bd380438744b75e0f86176c6fe337126b6be27.zip gcc-a6bd380438744b75e0f86176c6fe337126b6be27.tar.gz gcc-a6bd380438744b75e0f86176c6fe337126b6be27.tar.bz2 |
fortran frontend:
2007-07-01 Janne Blomqvist <jb@gcc.gnu.org>
* trans.h: Remove decls for 64-bit allocation functions.
* trans-array.c (gfc_grow_array): Always pick the standard realloc
function decl.
(gfc_array_allocate): Likewise.
* trans-decl.c: Remove trees for 64-bit allocation functions.
(gfc_build_builtin_function_decls): Don't build fndecls for 64-bit
allocations functions, use index_int_type for normal allocation
functions.
libgfortran changelog:
2007-07-01 Janne Blomqvist <jb@gcc.gnu.org>
* runtime/memory.c (internal_realloc): Use index_type for size
argument instead of GFC_INTEGER_4.
(allocate_array): Likewise.
(allocate): Likewise, add ifdef around unnecessary check.
(internal_reallo64): Remove.
(allocate_array64): Remove.
(allocate64): Remove.
* gfortran.map: Remove symbols for 64-bit allocation functions.
From-SVN: r126166
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/fortran/trans-array.c | 16 | ||||
-rw-r--r-- | gcc/fortran/trans-decl.c | 29 | ||||
-rw-r--r-- | gcc/fortran/trans.h | 3 |
4 files changed, 19 insertions, 40 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 7c0618d..d76029d 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,14 @@ +2007-07-01 Janne Blomqvist <jb@gcc.gnu.org> + + * trans.h: Remove decls for 64-bit allocation functions. + * trans-array.c (gfc_grow_array): Always pick the standard realloc + function decl. + (gfc_array_allocate): Likewise. + * trans-decl.c: Remove trees for 64-bit allocation functions. + (gfc_build_builtin_function_decls): Don't build fndecls for 64-bit + allocations functions, use index_int_type for normal allocation + functions. + 2007-06-30 Daniel Franke <franke.daniel@gmail.com> PR fortran/20373 diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 8b13e67..07862d6 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -842,11 +842,9 @@ gfc_grow_array (stmtblock_t * pblock, tree desc, tree extra) arg1 = build2 (MULT_EXPR, gfc_array_index_type, tmp, fold_convert (gfc_array_index_type, size)); - /* Pick the appropriate realloc function. */ - if (gfc_index_integer_kind == 4) + /* Pick the realloc function. */ + if (gfc_index_integer_kind == 4 || gfc_index_integer_kind == 8) tmp = gfor_fndecl_internal_realloc; - else if (gfc_index_integer_kind == 8) - tmp = gfor_fndecl_internal_realloc64; else gcc_unreachable (); @@ -3575,20 +3573,14 @@ gfc_array_allocate (gfc_se * se, gfc_expr * expr, tree pstat) pointer = gfc_conv_descriptor_data_get (se->expr); STRIP_NOPS (pointer); - if (TYPE_PRECISION (gfc_array_index_type) == 32) + if (TYPE_PRECISION (gfc_array_index_type) == 32 || + TYPE_PRECISION (gfc_array_index_type) == 64) { if (allocatable_array) allocate = gfor_fndecl_allocate_array; else allocate = gfor_fndecl_allocate; } - else if (TYPE_PRECISION (gfc_array_index_type) == 64) - { - if (allocatable_array) - allocate = gfor_fndecl_allocate64_array; - else - allocate = gfor_fndecl_allocate64; - } else gcc_unreachable (); diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 0ab2d74..e1379ba 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -75,11 +75,8 @@ tree gfc_static_ctors; /* Function declarations for builtin library functions. */ tree gfor_fndecl_internal_realloc; -tree gfor_fndecl_internal_realloc64; tree gfor_fndecl_allocate; -tree gfor_fndecl_allocate64; tree gfor_fndecl_allocate_array; -tree gfor_fndecl_allocate64_array; tree gfor_fndecl_deallocate; tree gfor_fndecl_pause_numeric; tree gfor_fndecl_pause_string; @@ -2241,46 +2238,28 @@ gfc_build_builtin_function_decls (void) { tree gfc_c_int_type_node = gfc_get_int_type (gfc_c_int_kind); tree gfc_int4_type_node = gfc_get_int_type (4); - tree gfc_int8_type_node = gfc_get_int_type (8); 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_int4_type_node); - - gfor_fndecl_internal_realloc64 = - gfc_build_library_function_decl (get_identifier - (PREFIX("internal_realloc64")), - pvoid_type_node, 2, pvoid_type_node, - gfc_int8_type_node); + gfc_index_int_type_node); gfor_fndecl_allocate = gfc_build_library_function_decl (get_identifier (PREFIX("allocate")), pvoid_type_node, 2, - gfc_int4_type_node, gfc_pint4_type_node); + gfc_index_int_type_node, gfc_pint4_type_node); DECL_IS_MALLOC (gfor_fndecl_allocate) = 1; - gfor_fndecl_allocate64 = - gfc_build_library_function_decl (get_identifier (PREFIX("allocate64")), - pvoid_type_node, 2, - gfc_int8_type_node, gfc_pint4_type_node); - DECL_IS_MALLOC (gfor_fndecl_allocate64) = 1; - gfor_fndecl_allocate_array = gfc_build_library_function_decl (get_identifier (PREFIX("allocate_array")), pvoid_type_node, 3, pvoid_type_node, - gfc_int4_type_node, gfc_pint4_type_node); + gfc_index_int_type_node, gfc_pint4_type_node); DECL_IS_MALLOC (gfor_fndecl_allocate_array) = 1; - gfor_fndecl_allocate64_array = - gfc_build_library_function_decl (get_identifier (PREFIX("allocate64_array")), - pvoid_type_node, 3, pvoid_type_node, - gfc_int8_type_node, gfc_pint4_type_node); - DECL_IS_MALLOC (gfor_fndecl_allocate64_array) = 1; - gfor_fndecl_deallocate = gfc_build_library_function_decl (get_identifier (PREFIX("deallocate")), void_type_node, 2, pvoid_type_node, diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h index f2a5d44..a57deca 100644 --- a/gcc/fortran/trans.h +++ b/gcc/fortran/trans.h @@ -482,11 +482,8 @@ void gfc_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *, tree); /* Runtime library function decls. */ extern GTY(()) tree gfor_fndecl_internal_realloc; -extern GTY(()) tree gfor_fndecl_internal_realloc64; extern GTY(()) tree gfor_fndecl_allocate; -extern GTY(()) tree gfor_fndecl_allocate64; extern GTY(()) tree gfor_fndecl_allocate_array; -extern GTY(()) tree gfor_fndecl_allocate64_array; extern GTY(()) tree gfor_fndecl_deallocate; extern GTY(()) tree gfor_fndecl_pause_numeric; extern GTY(()) tree gfor_fndecl_pause_string; |