Commit Graph

2 Commits

Author SHA1 Message Date
Thomas Koenig
3d2244b97f re PR fortran/48066 (Segfault with SUM of zero-sized array)
2011-08-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/40866
	* generated/iall_i1.c: Regenerated.
	* generated/iall_i16.c: Regenerated.
	* generated/iall_i2.c: Regenerated.
	* generated/iall_i4.c: Regenerated.
	* generated/iall_i8.c: Regenerated.
	* generated/iany_i1.c: Regenerated.
	* generated/iany_i16.c: Regenerated.
	* generated/iany_i2.c: Regenerated.
	* generated/iany_i4.c: Regenerated.
	* generated/iany_i8.c: Regenerated.
	* generated/iparity_i1.c: Regenerated.
	* generated/iparity_i16.c: Regenerated.
	* generated/iparity_i2.c: Regenerated.
	* generated/iparity_i4.c: Regenerated.
	* generated/iparity_i8.c: Regenerated.
	* generated/norm2_r10.c: Regenerated.
	* generated/norm2_r16.c: Regenerated.
	* generated/norm2_r4.c: Regenerated.
	* generated/norm2_r8.c: Regenerated.
	* generated/parity_l1.c: Regenerated.
	* generated/parity_l16.c: Regenerated.
	* generated/parity_l2.c: Regenerated.
	* generated/parity_l4.c: Regenerated.
	* generated/parity_l8.c: Regenerated.
	* generated/misc_specifics.F90: Regenerated (comment change).
	* generated/_abs_c10.F90: Regenerated (comment change).
	* generated/_abs_c16.F90: Regenerated (comment change).
	* generated/_abs_c4.F90: Regenerated (comment change).
	* generated/_abs_c8.F90: Regenerated (comment change).
	* generated/_abs_i16.F90: Regenerated (comment change).
	* generated/_abs_i4.F90: Regenerated (comment change).
	* generated/_abs_i8.F90: Regenerated (comment change).
	* generated/_abs_r10.F90: Regenerated (comment change).
	* generated/_abs_r16.F90: Regenerated (comment change).
	* generated/_abs_r4.F90: Regenerated (comment change).
	* generated/_abs_r8.F90: Regenerated (comment change).
	* generated/_acosh_r10.F90: Regenerated (comment change).
	* generated/_acosh_r16.F90: Regenerated (comment change).
	* generated/_acosh_r4.F90: Regenerated (comment change).
	* generated/_acosh_r8.F90: Regenerated (comment change).
	* generated/_acos_r10.F90: Regenerated (comment change).
	* generated/_acos_r16.F90: Regenerated (comment change).
	* generated/_acos_r4.F90: Regenerated (comment change).
	* generated/_acos_r8.F90: Regenerated (comment change).
	* generated/_aimag_c10.F90: Regenerated (comment change).
	* generated/_aimag_c16.F90: Regenerated (comment change).
	* generated/_aimag_c4.F90: Regenerated (comment change).
	* generated/_aimag_c8.F90: Regenerated (comment change).
	* generated/_aint_r10.F90: Regenerated (comment change).
	* generated/_aint_r16.F90: Regenerated (comment change).
	* generated/_aint_r4.F90: Regenerated (comment change).
	* generated/_aint_r8.F90: Regenerated (comment change).
	* generated/_anint_r10.F90: Regenerated (comment change).
	* generated/_anint_r16.F90: Regenerated (comment change).
	* generated/_anint_r4.F90: Regenerated (comment change).
	* generated/_anint_r8.F90: Regenerated (comment change).
	* generated/_asinh_r10.F90: Regenerated (comment change).
	* generated/_asinh_r16.F90: Regenerated (comment change).
	* generated/_asinh_r4.F90: Regenerated (comment change).
	* generated/_asinh_r8.F90: Regenerated (comment change).
	* generated/_asin_r10.F90: Regenerated (comment change).
	* generated/_asin_r16.F90: Regenerated (comment change).
	* generated/_asin_r4.F90: Regenerated (comment change).
	* generated/_asin_r8.F90: Regenerated (comment change).
	* generated/_atan2_r10.F90: Regenerated (comment change).
	* generated/_atan2_r16.F90: Regenerated (comment change).
	* generated/_atan2_r4.F90: Regenerated (comment change).
	* generated/_atan2_r8.F90: Regenerated (comment change).
	* generated/_atanh_r10.F90: Regenerated (comment change).
	* generated/_atanh_r16.F90: Regenerated (comment change).
	* generated/_atanh_r4.F90: Regenerated (comment change).
	* generated/_atanh_r8.F90: Regenerated (comment change).
	* generated/_atan_r10.F90: Regenerated (comment change).
	* generated/_atan_r16.F90: Regenerated (comment change).
	* generated/_atan_r4.F90: Regenerated (comment change).
	* generated/_atan_r8.F90: Regenerated (comment change).
	* generated/_conjg_c10.F90: Regenerated (comment change).
	* generated/_conjg_c16.F90: Regenerated (comment change).
	* generated/_conjg_c4.F90: Regenerated (comment change).
	* generated/_conjg_c8.F90: Regenerated (comment change).
	* generated/_cosh_r10.F90: Regenerated (comment change).
	* generated/_cosh_r16.F90: Regenerated (comment change).
	* generated/_cosh_r4.F90: Regenerated (comment change).
	* generated/_cosh_r8.F90: Regenerated (comment change).
	* generated/_cos_c10.F90: Regenerated (comment change).
	* generated/_cos_c16.F90: Regenerated (comment change).
	* generated/_cos_c4.F90: Regenerated (comment change).
	* generated/_cos_c8.F90: Regenerated (comment change).
	* generated/_cos_r10.F90: Regenerated (comment change).
	* generated/_cos_r16.F90: Regenerated (comment change).
	* generated/_cos_r4.F90: Regenerated (comment change).
	* generated/_cos_r8.F90: Regenerated (comment change).
	* generated/_dim_i16.F90: Regenerated (comment change).
	* generated/_dim_i4.F90: Regenerated (comment change).
	* generated/_dim_i8.F90: Regenerated (comment change).
	* generated/_dim_r10.F90: Regenerated (comment change).
	* generated/_dim_r16.F90: Regenerated (comment change).
	* generated/_dim_r4.F90: Regenerated (comment change).
	* generated/_dim_r8.F90: Regenerated (comment change).
	* generated/_exp_c10.F90: Regenerated (comment change).
	* generated/_exp_c16.F90: Regenerated (comment change).
	* generated/_exp_c4.F90: Regenerated (comment change).
	* generated/_exp_c8.F90: Regenerated (comment change).
	* generated/_exp_r10.F90: Regenerated (comment change).
	* generated/_exp_r16.F90: Regenerated (comment change).
	* generated/_exp_r4.F90: Regenerated (comment change).
	* generated/_exp_r8.F90: Regenerated (comment change).
	* generated/_log10_r10.F90: Regenerated (comment change).
	* generated/_log10_r16.F90: Regenerated (comment change).
	* generated/_log10_r4.F90: Regenerated (comment change).
	* generated/_log10_r8.F90: Regenerated (comment change).
	* generated/_log_c10.F90: Regenerated (comment change).
	* generated/_log_c16.F90: Regenerated (comment change).
	* generated/_log_c4.F90: Regenerated (comment change).
	* generated/_log_c8.F90: Regenerated (comment change).
	* generated/_log_r10.F90: Regenerated (comment change).
	* generated/_log_r16.F90: Regenerated (comment change).
	* generated/_log_r4.F90: Regenerated (comment change).
	* generated/_log_r8.F90: Regenerated (comment change).
	* generated/_mod_i16.F90: Regenerated (comment change).
	* generated/_mod_i4.F90: Regenerated (comment change).
	* generated/_mod_i8.F90: Regenerated (comment change).
	* generated/_mod_r10.F90: Regenerated (comment change).
	* generated/_mod_r16.F90: Regenerated (comment change).
	* generated/_mod_r4.F90: Regenerated (comment change).
	* generated/_mod_r8.F90: Regenerated (comment change).
	* generated/_sign_i16.F90: Regenerated (comment change).
	* generated/_sign_i4.F90: Regenerated (comment change).
	* generated/_sign_i8.F90: Regenerated (comment change).
	* generated/_sign_r10.F90: Regenerated (comment change).
	* generated/_sign_r16.F90: Regenerated (comment change).
	* generated/_sign_r4.F90: Regenerated (comment change).
	* generated/_sign_r8.F90: Regenerated (comment change).
	* generated/_sinh_r10.F90: Regenerated (comment change).
	* generated/_sinh_r16.F90: Regenerated (comment change).
	* generated/_sinh_r4.F90: Regenerated (comment change).
	* generated/_sinh_r8.F90: Regenerated (comment change).
	* generated/_sin_c10.F90: Regenerated (comment change).
	* generated/_sin_c16.F90: Regenerated (comment change).
	* generated/_sin_c4.F90: Regenerated (comment change).
	* generated/_sin_c8.F90: Regenerated (comment change).
	* generated/_sin_r10.F90: Regenerated (comment change).
	* generated/_sin_r16.F90: Regenerated (comment change).
	* generated/_sin_r4.F90: Regenerated (comment change).
	* generated/_sin_r8.F90: Regenerated (comment change).
	* generated/_sqrt_c10.F90: Regenerated (comment change).
	* generated/_sqrt_c16.F90: Regenerated (comment change).
	* generated/_sqrt_c4.F90: Regenerated (comment change).
	* generated/_sqrt_c8.F90: Regenerated (comment change).
	* generated/_sqrt_r10.F90: Regenerated (comment change).
	* generated/_sqrt_r16.F90: Regenerated (comment change).
	* generated/_sqrt_r4.F90: Regenerated (comment change).
	* generated/_sqrt_r8.F90: Regenerated (comment change).
	* generated/_tanh_r10.F90: Regenerated (comment change).
	* generated/_tanh_r16.F90: Regenerated (comment change).
	* generated/_tanh_r4.F90: Regenerated (comment change).
	* generated/_tanh_r8.F90: Regenerated (comment change).
	* generated/_tan_r10.F90: Regenerated (comment change).
	* generated/_tan_r16.F90: Regenerated (comment change).
	* generated/_tan_r4.F90: Regenerated (comment change).
	* generated/_tan_r8.F90: Regenerated (comment change).

From-SVN: r178140
2011-08-28 10:08:50 +00:00
Tobias Burnus
0cd0559e8c re PR fortran/33197 (Fortran 2008: math functions)
gcc/fortran/
2010-08-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/33197
        * gcc/fortran/intrinsic.c (add_functions): Add norm2 and parity.
        * gcc/fortran/intrinsic.h (gfc_check_norm2, gfc_check_parity):
        gfc_simplify_norm2, gfc_simplify_parity, gfc_resolve_norm2,
        gfc_resolve_parity): New prototypes.
        * gcc/fortran/gfortran.h (gfc_isym_id): New enum items
        GFC_ISYM_NORM2 and GFC_ISYM_PARITY.
        * gcc/fortran/iresolve.c (gfc_resolve_norm2,
        gfc_resolve_parity): New functions.
        * gcc/fortran/check.c (gfc_check_norm2, gfc_check_parity):
        New functions.
        * gcc/fortran/trans-intrinsic.c (gfc_conv_intrinsic_arith,
        gfc_conv_intrinsic_function): Handle NORM2 and PARITY.
        * gcc/fortran/intrinsic.texi (NORM2, PARITY): Add.
        * gcc/fortran/simplify.c (simplify_transformation_to_array):
        Add post-processing opterator.
        (gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
        gfc_simplify_product, gfc_simplify_sum): Update call.
        (add_squared, do_sqrt, gfc_simplify_norm2, do_xor,
        gfc_simplify_parity): New functions.

gcc/testsuite/
2010-08-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/33197
        * gcc/testsuite/gfortran.dg/norm2_1.f90: New.
        * gcc/testsuite/gfortran.dg/norm2_2.f90: New.
        * gcc/testsuite/gfortran.dg/norm2_3.f90: New.
        * gcc/testsuite/gfortran.dg/norm2_4.f90: New.
        * gcc/testsuite/gfortran.dg/parity_1.f90: New.
        * gcc/testsuite/gfortran.dg/parity_2.f90: New.
        * gcc/testsuite/gfortran.dg/parity_3.f90: New.

libgfortran/
2010-08-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/33197
        * libgfortran/m4/ifunction.m4 (FINISH_ARRAY_FUNCTION,
        ARRAY_FUNCTION): Allow expression after loop.
        * libgfortran/m4/norm2.m4: New for _gfortran_norm2_r{4,8,10,16}.
        * libgfortran/m4/parity.m4: New for
        * _gfortran_parity_l{1,2,4,8,16}.
        * libgfortran/gfortran.map: Add new functions.
        * libgfortran/Makefile.am: Ditto.
        * libgfortran/m4/minloc1.m4: Add empty argument for
        * ARRAY_FUNCTION.
        * libgfortran/m4/maxloc1.m4: Ditto.
        * libgfortran/m4/all.m4: Ditto.
        * libgfortran/m4/minval.m4: Ditto.
        * libgfortran/m4/maxval.m4: Ditto.
        * libgfortran/m4/count.m4: Ditto.
        * libgfortran/m4/product.m4: Ditto.
        * libgfortran/m4/any.m4: Ditto.
        * Makefile.in: Regenerated.
        * generated/minval_r8.c: Regenerated.
        * generated/maxloc1_4_r8.c: Regenerated.
        * generated/minloc1_16_r16.c: Regenerated.
        * generated/norm2_r4.c: Regenerated.
        * generated/sum_i8.c: Regenerated.
        * generated/parity_l2.c: Regenerated.
        * generated/any_l16.c: Regenerated.
        * generated/maxval_i2.c: Regenerated.
        * generated/any_l2.c: Regenerated.
        * generated/product_r4.c: Regenerated.
        * generated/maxloc1_8_i4.c: Regenerated.
        * generated/parity_l16.c: Regenerated.
        * generated/all_l1.c: Regenerated.
        * generated/product_i2.c: Regenerated.
        * generated/minloc1_8_r16.c: Regenerated.
        * generated/maxloc1_8_r16.c: Regenerated.
        * generated/sum_r16.c: Regenerated.
        * generated/sum_i1.c: Regenerated.
        * generated/minloc1_4_r8.c: Regenerated.
        * generated/maxloc1_16_r16.c: Regenerated.
        * generated/minloc1_16_i4.c: Regenerated.
        * generated/maxloc1_16_i4.c: Regenerated.
        * generated/maxval_r16.c: Regenerated.
        * generated/product_c10.c: Regenerated.
        * generated/minloc1_8_i4.c: Regenerated.
        * generated/all_l2.c: Regenerated.
        * generated/product_c4.c: Regenerated.
        * generated/sum_r4.c: Regenerated.
        * generated/all_l16.c: Regenerated.
        * generated/minloc1_16_r10.c: Regenerated.
        * generated/sum_i2.c: Regenerated.
        * generated/maxloc1_8_r8.c: Regenerated.
        * generated/minval_i16.c: Regenerated.
        * generated/parity_l4.c: Regenerated.
        * generated/maxval_i4.c: Regenerated.
        * generated/any_l4.c: Regenerated.
        * generated/minval_i8.c: Regenerated.
        * generated/maxloc1_4_i8.c: Regenerated.
        * generated/minloc1_4_i16.c: Regenerated.
        * generated/maxloc1_4_i16.c: Regenerated.
        * generated/minloc1_8_r10.c: Regenerated.
        * generated/product_i4.c: Regenerated.
        * generated/maxloc1_8_r10.c: Regenerated.
        * generated/sum_c16.c: Regenerated.
        * generated/minloc1_16_r8.c: Regenerated.
        * generated/maxloc1_16_r8.c: Regenerated.
        * generated/count_4_l.c: Regenerated.
        * generated/sum_r10.c: Regenerated.
        * generated/count_8_l.c: Regenerated.
        * generated/sum_c4.c: Regenerated.
        * generated/maxloc1_16_r10.c: Regenerated.
        * generated/minloc1_8_r8.c: Regenerated.
        * generated/maxval_r10.c: Regenerated.
        * generated/minval_i1.c: Regenerated.
        * generated/maxloc1_4_i1.c: Regenerated.
        * generated/minloc1_4_i8.c: Regenerated.
        * generated/product_i16.c: Regenerated.
        * generated/all_l4.c: Regenerated.
        * generated/norm2_r16.c: Regenerated.
        * generated/minval_r4.c: Regenerated.
        * generated/maxloc1_4_r4.c: Regenerated.
        * generated/sum_i4.c: Regenerated.
        * generated/maxval_r8.c: Regenerated.
        * generated/norm2_r8.c: Regenerated.
        * generated/minloc1_4_i1.c: Regenerated.
        * generated/minval_r16.c: Regenerated.
        * generated/minval_i2.c: Regenerated.
        * generated/maxloc1_4_i2.c: Regenerated.
        * generated/product_r8.c: Regenerated.
        * generated/maxloc1_8_i8.c: Regenerated.
        * generated/sum_c10.c: Regenerated.
        * generated/minloc1_4_r16.c: Regenerated.
        * generated/maxloc1_4_r16.c: Regenerated.
        * generated/count_1_l.c: Regenerated.
        * generated/minloc1_4_r4.c: Regenerated.
        * generated/minloc1_16_i8.c: Regenerated.
        * generated/maxloc1_16_i8.c: Regenerated.
        * generated/minloc1_4_i2.c: Regenerated.
        * generated/maxloc1_8_i1.c: Regenerated.
        * generated/minloc1_8_i8.c: Regenerated.
        * generated/product_r16.c: Regenerated.
        * generated/product_c8.c: Regenerated.
        * generated/sum_r8.c: Regenerated.
        * generated/norm2_r10.c: Regenerated.
        * generated/minloc1_16_i16.c: Regenerated.
        * generated/maxloc1_8_r4.c: Regenerated.
        * generated/minloc1_16_i1.c: Regenerated.
        * generated/maxloc1_16_i1.c: Regenerated.
        * generated/minval_r10.c: Regenerated.
        * generated/count_16_l.c: Regenerated.
        * generated/parity_l8.c: Regenerated.
        * generated/minloc1_8_i1.c: Regenerated.
        * generated/minval_i4.c: Regenerated.
        * generated/maxloc1_4_i4.c: Regenerated.
        * generated/maxloc1_8_i2.c: Regenerated.
        * generated/maxval_i8.c: Regenerated.
        * generated/any_l8.c: Regenerated.
        * generated/minloc1_4_r10.c: Regenerated.
        * generated/minloc1_8_i16.c: Regenerated.
        * generated/maxloc1_4_r10.c: Regenerated.
        * generated/maxloc1_8_i16.c: Regenerated.
        * generated/minloc1_16_r4.c: Regenerated.
        * generated/maxloc1_16_r4.c: Regenerated.
        * generated/product_i8.c: Regenerated.
        * generated/sum_i16.c: Regenerated.
        * generated/count_2_l.c: Regenerated.
        * generated/maxloc1_16_i16.c: Regenerated.
        * generated/minloc1_8_r4.c: Regenerated.
        * generated/sum_c8.c: Regenerated.
        * generated/minloc1_16_i2.c: Regenerated.
        * generated/maxloc1_16_i2.c: Regenerated.
        * generated/parity_l1.c: Regenerated.
        * generated/maxval_i16.c: Regenerated.
        * generated/maxval_i1.c: Regenerated.
        * generated/minloc1_4_i4.c: Regenerated.
        * generated/any_l1.c: Regenerated.
        * generated/minloc1_8_i2.c: Regenerated.
        * generated/product_c16.c: Regenerated.
        * generated/product_r10.c: Regenerated.
        * generated/product_i1.c: Regenerated.
        * generated/all_l8.c: Regenerated.
        * generated/maxval_r4.c: Regenerated.

From-SVN: r163595
2010-08-27 21:17:45 +02:00