This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/17145] New: sum does not handle complex numbers
- From: "schnetter at aei dot mpg dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Aug 2004 08:01:05 -0000
- Subject: [Bug fortran/17145] New: sum does not handle complex numbers
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The sum intrinsic reports an error when it is given an array of complex
numbers. I believe that a previous patch of mine introduced this bug. I
append a patch below.
2004-08-23 Erik Schnetter <schnetter@aei.mpg.de>
PR fortran/[this PR]
* intrinsic.h (gfc_check_reduction): Remove.
(gfc_check_minval_maxval, gfc_check_sum_product): New prototypes.
(gfc_check_sum): Remove previously unused prototype.
* gfortran.h: Combine gfc_check_f union fields f3ml and f3red into
f3reorder.
* intrinsic.c (add_sym_3ml, add_sym_3red): change field names.
(add_functions): Check minval and maxval with gfc_check_minval_maxval,
and check sum and produce with gfc_check_product.
(check_specific): Combine reordering checks.
* check.c (gfc_check_reduction): Rename to gfc_check_minval_maxval.
(gfc_check_minval_maxval): Renamed from gfc_check_reduction.
(gfc_check_sum_product): Copy from gfc_check_reduction, but allow
complex arguments.
A compile time test case for this bug is
subroutine sumcomplex (ca, cs, za, zs)
implicit none
complex ca(10), cs
double complex za(10), zs
cs = sum(ca)
zs = sum(za)
end subroutine sumcomplex
--
Summary: sum does not handle complex numbers
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: schnetter at aei dot mpg dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17145