This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/34868] ICE with -ff2c for function returning a complex number
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jan 2008 07:41:34 -0000
- Subject: [Bug fortran/34868] ICE with -ff2c for function returning a complex number
- References: <bug-34868-15665@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from burnus at gcc dot gnu dot org 2008-01-21 07:41 -------
> Then the resultant C source is
> VOID f_(doublecomplex * ret_val, doublereal *a)
Indeed this is f2c (and g77 -ff2c) syntax.
> So it seems to me that the current functionality of the gfortran is different
> from that of f2c, isn't it?
The functionality is not really different (except that gfortran supports much
more), but the calling is indeed different. All (most) modern compilers,
including gfortran, generate such a prototype:
complex double f_ (double *a)
> And, I'm wondering why changing the pseudo-size array "a(:)" to the
> variable "a"
This rings a bell. And indeed the patch for PR 34848 [attachment 14978] fixes
this problem (but it causes some other regressions, see PR 34848).
(Note that "a(:)" and "a(*)" make a huge difference: For "a(*)" the size/upper
bound of the array "a" is unknown and the array is contiguous, while for "a(:)"
the bounds and sizes are known and the array might be not contiguous in memory
(strides); additionally the interface of the procedure "f" needs then to be
known to the caller of "f".)
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
BugsThisDependsOn| |34848
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34868