diff options
-rw-r--r-- | gcc/fortran/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/fortran/f95-lang.c | 7 | ||||
-rw-r--r-- | gcc/fortran/trans-expr.c | 29 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_fraction_exponent.f90 | 4 | ||||
-rw-r--r-- | libgfortran/ChangeLog | 23 | ||||
-rw-r--r-- | libgfortran/Makefile.am | 4 | ||||
-rw-r--r-- | libgfortran/Makefile.in | 39 | ||||
-rw-r--r-- | libgfortran/gfortran.map | 4 |
9 files changed, 66 insertions, 59 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index d76029d..d0fe5d7 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,13 @@ 2007-07-01 Janne Blomqvist <jb@gcc.gnu.org> + PR fortran/32239 + * trans-expr.c (gfc_conv_power_op): Use builtin_powi for + real**int4 powers. + * f95-lang.c (gfc_init_builtin_functions): Add builtin_powi to the + builtins table. + +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. diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c index 558ba0c..314fc37 100644 --- a/gcc/fortran/f95-lang.c +++ b/gcc/fortran/f95-lang.c @@ -950,6 +950,13 @@ 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_powil", mfunc_longdouble[2], + BUILT_IN_POWIL, "powil", true); + gfc_define_builtin ("__builtin_powi", mfunc_double[2], + BUILT_IN_POWI, "powi", true); + gfc_define_builtin ("__builtin_powif", mfunc_float[2], + BUILT_IN_POWIF, "powif", true); + if (TARGET_C99_FUNCTIONS) { diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index a466935..d70e4d5 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -780,9 +780,9 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr) gfc_add_block_to_block (&se->pre, &rse.pre); if (expr->value.op.op2->ts.type == BT_INTEGER - && expr->value.op.op2->expr_type == EXPR_CONSTANT) + && expr->value.op.op2->expr_type == EXPR_CONSTANT) if (gfc_conv_cst_int_power (se, lse.expr, rse.expr)) - return; + return; gfc_int4_type_node = gfc_get_int_type (4); @@ -852,7 +852,30 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr) break; case BT_REAL: - fndecl = gfor_fndecl_math_powi[kind][ikind].real; + /* Use builtins for real ** int4. */ + if (ikind == 0) + { + switch (kind) + { + case 0: + fndecl = built_in_decls[BUILT_IN_POWIF]; + break; + + case 1: + fndecl = built_in_decls[BUILT_IN_POWI]; + break; + + case 2: + case 3: + fndecl = built_in_decls[BUILT_IN_POWIL]; + break; + + default: + gcc_unreachable (); + } + } + else + fndecl = gfor_fndecl_math_powi[kind][ikind].real; break; case BT_COMPLEX: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2a7786c..6a556cd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2007-07-01 Janne Blomqvist <jb@gcc.gnu.org> + + PR fortran/32239 + * gfortran.fortran-torture/execute/intrinsic_fraction_exponent.f90 + (test_4): Use proper test for floating point equality. + (test_8): Likewise. + 2007-06-29 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/32554 diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_fraction_exponent.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_fraction_exponent.f90 index a22d0b9..c469cb4 100644 --- a/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_fraction_exponent.f90 +++ b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_fraction_exponent.f90 @@ -66,7 +66,7 @@ if (z .gt. 0) then else y = (y / 2.) * (2. ** (z + 1)) end if -if (abs (x - y) .gt. abs(x * 1e-6)) call abort() +if (abs (x - y) .gt. spacing (max (abs (x), abs (y)))) call abort() end subroutine test_8(x) @@ -79,6 +79,6 @@ if (z .gt. 0) then else y = (y / 2._8) * (2._8 ** (z + 1)) end if -if (abs (x - y) .gt. abs(x * 1e-6)) call abort() +if (abs (x - y) .gt. spacing (max (abs (x), abs(y)))) call abort() end diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index ac234b5..c3d2b71 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,10 @@ +2007-07-01 Janne Blomqvist <jb@gcc.gnu.org> + + PR fortran/32239 + * Makefile.am: Don't generate real**int4 pow functions. + * gfortran.map: Remove real**int4 pow symbols. + * Makefile.in: Regenerated. + 2007-07-01 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/32554 @@ -6,14 +13,14 @@ 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. + * 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. 2007-06-29 Jerry DeLisle <jvdelisle@gcc.gnu.org> diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am index 0495548..0e74530 100644 --- a/libgfortran/Makefile.am +++ b/libgfortran/Makefile.am @@ -430,10 +430,6 @@ i_pow_c = \ $(srcdir)/generated/pow_i4_i4.c \ $(srcdir)/generated/pow_i8_i4.c \ $(srcdir)/generated/pow_i16_i4.c \ -$(srcdir)/generated/pow_r4_i4.c \ -$(srcdir)/generated/pow_r8_i4.c \ -$(srcdir)/generated/pow_r10_i4.c \ -$(srcdir)/generated/pow_r16_i4.c \ $(srcdir)/generated/pow_c4_i4.c \ $(srcdir)/generated/pow_c8_i4.c \ $(srcdir)/generated/pow_c10_i4.c \ diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in index 0e2106e..c2acb13 100644 --- a/libgfortran/Makefile.in +++ b/libgfortran/Makefile.in @@ -158,8 +158,7 @@ am__objects_25 = nearest_r4.lo nearest_r8.lo nearest_r10.lo \ nearest_r16.lo am__objects_26 = set_exponent_r4.lo set_exponent_r8.lo \ set_exponent_r10.lo set_exponent_r16.lo -am__objects_27 = pow_i4_i4.lo pow_i8_i4.lo pow_i16_i4.lo pow_r4_i4.lo \ - pow_r8_i4.lo pow_r10_i4.lo pow_r16_i4.lo pow_c4_i4.lo \ +am__objects_27 = pow_i4_i4.lo pow_i8_i4.lo pow_i16_i4.lo pow_c4_i4.lo \ pow_c8_i4.lo pow_c10_i4.lo pow_c16_i4.lo pow_i4_i8.lo \ pow_i8_i8.lo pow_i16_i8.lo pow_r4_i8.lo pow_r8_i8.lo \ pow_r10_i8.lo pow_r16_i8.lo pow_c4_i8.lo pow_c8_i8.lo \ @@ -816,10 +815,6 @@ i_pow_c = \ $(srcdir)/generated/pow_i4_i4.c \ $(srcdir)/generated/pow_i8_i4.c \ $(srcdir)/generated/pow_i16_i4.c \ -$(srcdir)/generated/pow_r4_i4.c \ -$(srcdir)/generated/pow_r8_i4.c \ -$(srcdir)/generated/pow_r10_i4.c \ -$(srcdir)/generated/pow_r16_i4.c \ $(srcdir)/generated/pow_c4_i4.c \ $(srcdir)/generated/pow_c8_i4.c \ $(srcdir)/generated/pow_c10_i4.c \ @@ -1412,16 +1407,12 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_i8_i4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_i8_i8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r10_i16.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r10_i4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r10_i8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r16_i16.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r16_i4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r16_i8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r4_i16.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r4_i4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r4_i8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r8_i16.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r8_i4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_r8_i8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/product_c10.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/product_c16.Plo@am__quote@ @@ -3786,34 +3777,6 @@ pow_i16_i4.lo: $(srcdir)/generated/pow_i16_i4.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_i16_i4.lo `test -f '$(srcdir)/generated/pow_i16_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_i16_i4.c -pow_r4_i4.lo: $(srcdir)/generated/pow_r4_i4.c -@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_r4_i4.lo -MD -MP -MF "$(DEPDIR)/pow_r4_i4.Tpo" -c -o pow_r4_i4.lo `test -f '$(srcdir)/generated/pow_r4_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r4_i4.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pow_r4_i4.Tpo" "$(DEPDIR)/pow_r4_i4.Plo"; else rm -f "$(DEPDIR)/pow_r4_i4.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/pow_r4_i4.c' object='pow_r4_i4.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_r4_i4.lo `test -f '$(srcdir)/generated/pow_r4_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r4_i4.c - -pow_r8_i4.lo: $(srcdir)/generated/pow_r8_i4.c -@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_r8_i4.lo -MD -MP -MF "$(DEPDIR)/pow_r8_i4.Tpo" -c -o pow_r8_i4.lo `test -f '$(srcdir)/generated/pow_r8_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r8_i4.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pow_r8_i4.Tpo" "$(DEPDIR)/pow_r8_i4.Plo"; else rm -f "$(DEPDIR)/pow_r8_i4.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/pow_r8_i4.c' object='pow_r8_i4.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_r8_i4.lo `test -f '$(srcdir)/generated/pow_r8_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r8_i4.c - -pow_r10_i4.lo: $(srcdir)/generated/pow_r10_i4.c -@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_r10_i4.lo -MD -MP -MF "$(DEPDIR)/pow_r10_i4.Tpo" -c -o pow_r10_i4.lo `test -f '$(srcdir)/generated/pow_r10_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r10_i4.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pow_r10_i4.Tpo" "$(DEPDIR)/pow_r10_i4.Plo"; else rm -f "$(DEPDIR)/pow_r10_i4.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/pow_r10_i4.c' object='pow_r10_i4.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_r10_i4.lo `test -f '$(srcdir)/generated/pow_r10_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r10_i4.c - -pow_r16_i4.lo: $(srcdir)/generated/pow_r16_i4.c -@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_r16_i4.lo -MD -MP -MF "$(DEPDIR)/pow_r16_i4.Tpo" -c -o pow_r16_i4.lo `test -f '$(srcdir)/generated/pow_r16_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r16_i4.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pow_r16_i4.Tpo" "$(DEPDIR)/pow_r16_i4.Plo"; else rm -f "$(DEPDIR)/pow_r16_i4.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/pow_r16_i4.c' object='pow_r16_i4.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pow_r16_i4.lo `test -f '$(srcdir)/generated/pow_r16_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_r16_i4.c - pow_c4_i4.lo: $(srcdir)/generated/pow_c4_i4.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pow_c4_i4.lo -MD -MP -MF "$(DEPDIR)/pow_c4_i4.Tpo" -c -o pow_c4_i4.lo `test -f '$(srcdir)/generated/pow_c4_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/pow_c4_i4.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pow_c4_i4.Tpo" "$(DEPDIR)/pow_c4_i4.Plo"; else rm -f "$(DEPDIR)/pow_c4_i4.Tpo"; exit 1; fi diff --git a/libgfortran/gfortran.map b/libgfortran/gfortran.map index e135784..6aebef3 100644 --- a/libgfortran/gfortran.map +++ b/libgfortran/gfortran.map @@ -526,16 +526,12 @@ GFORTRAN_1.0 { _gfortran_pow_i8_i4; _gfortran_pow_i8_i8; _gfortran_pow_r10_i16; - _gfortran_pow_r10_i4; _gfortran_pow_r10_i8; _gfortran_pow_r16_i16; - _gfortran_pow_r16_i4; _gfortran_pow_r16_i8; _gfortran_pow_r4_i16; - _gfortran_pow_r4_i4; _gfortran_pow_r4_i8; _gfortran_pow_r8_i16; - _gfortran_pow_r8_i4; _gfortran_pow_r8_i8; _gfortran_product_c10; _gfortran_product_c16; |