diff options
author | Francois-Xavier Coudert <coudert@clipper.ens.fr> | 2008-02-23 19:42:04 +0100 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2008-02-23 18:42:04 +0000 |
commit | fb2202350d6e67d9fef57a392532938270714364 (patch) | |
tree | cd6f69f8cb255a89ac25d6d47a969d01dbc4675e /gcc/fortran | |
parent | f79db4f66eba251456c2a9c2fc9d0daef1af9e90 (diff) | |
download | gcc-fb2202350d6e67d9fef57a392532938270714364.zip gcc-fb2202350d6e67d9fef57a392532938270714364.tar.gz gcc-fb2202350d6e67d9fef57a392532938270714364.tar.bz2 |
re PR target/25477 (builtin functions should use $LDBL128 suffix on darwin when appropriate)
PR target/25477
* config/darwin-protos.h: Add darwin_patch_builtins prototype.
* config/darwin-ppc-ldouble-patch.def: New file.
* config/rs6000/darwin.h (SUBTARGET_INIT_BUILTINS): New macro.
* config/rs6000/rs6000.c (rs6000_init_builtins): Call
SUBTARGET_INIT_BUILTINS if defined.
* config/darwin.c (darwin_patch_builtin,
darwin_patch_builtins): New functions.
* trans-expr.c (gfc_conv_power_op): Use BUILT_IN_CPOW{F,,L}.
* f95-lang.c (gfc_init_builtin_functions): Define BUILT_IN_CPOW{F,,L}.
* trans.h (gfor_fndecl_math_cpow, gfor_fndecl_math_cpowf,
gfor_fndecl_math_cpowl10, gfor_fndecl_math_cpowl16): Remove.
* trans-decl.c: Likewise.
* gfortran.dg/large_real_kind_2.F90: Split testing of ERF and
ERFC into gfortran.dg/large_real_kind_3.F90.
* gfortran.dg/large_real_kind_3.F90: New test.
From-SVN: r132576
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/fortran/f95-lang.c | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-decl.c | 27 | ||||
-rw-r--r-- | gcc/fortran/trans-expr.c | 8 | ||||
-rw-r--r-- | gcc/fortran/trans.h | 4 |
5 files changed, 18 insertions, 36 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 0273000..89766c6 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,12 @@ +2008-02-23 Francois-Xavier Coudert <coudert@clipper.ens.fr> + + PR target/25477 + * trans-expr.c (gfc_conv_power_op): Use BUILT_IN_CPOW{F,,L}. + * f95-lang.c (gfc_init_builtin_functions): Define BUILT_IN_CPOW{F,,L}. + * trans.h (gfor_fndecl_math_cpow, gfor_fndecl_math_cpowf, + gfor_fndecl_math_cpowl10, gfor_fndecl_math_cpowl16): Remove. + * trans-decl.c: Likewise. + 2008-02-20 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/34907 diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c index dcc64b9..3056fdb 100644 --- a/gcc/fortran/f95-lang.c +++ b/gcc/fortran/f95-lang.c @@ -942,6 +942,12 @@ gfc_init_builtin_functions (void) BUILT_IN_POW, "pow", true); gfc_define_builtin ("__builtin_powf", mfunc_float[1], BUILT_IN_POWF, "powf", true); + gfc_define_builtin ("__builtin_cpowl", mfunc_clongdouble[1], + BUILT_IN_CPOWL, "cpowl", true); + gfc_define_builtin ("__builtin_cpow", mfunc_cdouble[1], + BUILT_IN_CPOW, "cpow", true); + gfc_define_builtin ("__builtin_cpowf", mfunc_cfloat[1], + BUILT_IN_CPOWF, "cpowf", true); gfc_define_builtin ("__builtin_powil", mfunc_longdouble[2], BUILT_IN_POWIL, "powil", true); gfc_define_builtin ("__builtin_powi", mfunc_double[2], diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 79a3e8b..8ca4d43 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -99,10 +99,6 @@ tree gfor_fndecl_associated; trans-intrinsic.c. */ gfc_powdecl_list gfor_fndecl_math_powi[4][3]; -tree gfor_fndecl_math_cpowf; -tree gfor_fndecl_math_cpow; -tree gfor_fndecl_math_cpowl10; -tree gfor_fndecl_math_cpowl16; tree gfor_fndecl_math_ishftc4; tree gfor_fndecl_math_ishftc8; tree gfor_fndecl_math_ishftc16; @@ -2024,10 +2020,6 @@ gfc_build_intrinsic_function_decls (void) tree gfc_real8_type_node = gfc_get_real_type (8); tree gfc_real10_type_node = gfc_get_real_type (10); tree gfc_real16_type_node = gfc_get_real_type (16); - tree gfc_complex4_type_node = gfc_get_complex_type (4); - tree gfc_complex8_type_node = gfc_get_complex_type (8); - tree gfc_complex10_type_node = gfc_get_complex_type (10); - tree gfc_complex16_type_node = gfc_get_complex_type (16); /* String functions. */ gfor_fndecl_compare_string = @@ -2195,25 +2187,6 @@ gfc_build_intrinsic_function_decls (void) #undef NRKINDS } - gfor_fndecl_math_cpowf = - gfc_build_library_function_decl (get_identifier ("cpowf"), - gfc_complex4_type_node, - 1, gfc_complex4_type_node); - gfor_fndecl_math_cpow = - gfc_build_library_function_decl (get_identifier ("cpow"), - gfc_complex8_type_node, - 1, gfc_complex8_type_node); - if (gfc_complex10_type_node) - gfor_fndecl_math_cpowl10 = - gfc_build_library_function_decl (get_identifier ("cpowl"), - gfc_complex10_type_node, 1, - gfc_complex10_type_node); - if (gfc_complex16_type_node) - gfor_fndecl_math_cpowl16 = - gfc_build_library_function_decl (get_identifier ("cpowl"), - gfc_complex16_type_node, 1, - gfc_complex16_type_node); - gfor_fndecl_math_ishftc4 = gfc_build_library_function_decl (get_identifier (PREFIX("ishftc4")), gfc_int4_type_node, diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 8d0392f..37fc728 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -935,16 +935,14 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr) switch (kind) { case 4: - fndecl = gfor_fndecl_math_cpowf; + fndecl = built_in_decls[BUILT_IN_CPOWF]; break; case 8: - fndecl = gfor_fndecl_math_cpow; + fndecl = built_in_decls[BUILT_IN_CPOW]; break; case 10: - fndecl = gfor_fndecl_math_cpowl10; - break; case 16: - fndecl = gfor_fndecl_math_cpowl16; + fndecl = built_in_decls[BUILT_IN_CPOWL]; break; default: gcc_unreachable (); diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h index 9ccf571..7247688 100644 --- a/gcc/fortran/trans.h +++ b/gcc/fortran/trans.h @@ -526,10 +526,6 @@ typedef struct gfc_powdecl_list GTY(()) gfc_powdecl_list; extern GTY(()) gfc_powdecl_list gfor_fndecl_math_powi[4][3]; -extern GTY(()) tree gfor_fndecl_math_cpowf; -extern GTY(()) tree gfor_fndecl_math_cpow; -extern GTY(()) tree gfor_fndecl_math_cpowl10; -extern GTY(()) tree gfor_fndecl_math_cpowl16; extern GTY(()) tree gfor_fndecl_math_ishftc4; extern GTY(()) tree gfor_fndecl_math_ishftc8; extern GTY(()) tree gfor_fndecl_math_ishftc16; |