--- Begin Message ---
- From: Tobias Burnus <burnus at net-b dot de>
- To: FX Coudert <fxcoudert at gmail dot com>
- Cc: Fortran List <fortran at gcc dot gnu dot org>
- Date: Sat, 03 Mar 2007 18:42:59 +0100
- Subject: [Fortran, patch, commited] Fix testsuite failue by using int64_tinstead of long (was: c_by_val_1.f failure)
- References: <A0CB71E2-4FB1-4DEC-99B9-F863F011284C@gmail.com>
FX Coudert wrote:
> Somewhere between 2007-02-28 and 2007-03-01 (to be precise, between
> revs. 122400 and 122422), gfortran.dg/c_by_val_1.f started failing on
> i386-pc-linux-gnu at all optimization levels (see
> http://gcc.gnu.org/ml/gcc-testresults/2007-03/msg00007.html, for
> example; other platforms exhibit the same failure). It still happens
> on trunk.
Thanks for the report. My test case was the culprit.
This is due to a mismatch between "long" and "integer(kind=8)" on x86-32
("-m32" on my x86-64 system), it works on x86-64. Using "int64_t"
instead of "long" fixes it.
The patch which introduced this failure was the test case for PR30887
(%VAL() only accepted default-kind variables), cf.
http://gcc.gnu.org/ml/gcc-patches/2007-02/msg01839.html
I committed (r122510) the following patch as obvious; tested with
make RUNTESTFLAGS="dg.exp=c_by_val*f90" check-gfortran
make RUNTESTFLAGS="dg.exp=c_by_val*f90 --target_board=unix/-m32"
check-gfortran
on x86_64-unknown-linux-gnu/openSUSE10.2.
Tobias
2007-03-03 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/c_by_val.c: Use int64_t instead of long
to be more compatible with integer(kind=8).
Index: gcc/testsuite/gfortran.dg/c_by_val.c
===================================================================
--- gcc/testsuite/gfortran.dg/c_by_val.c (Revision 122502)
+++ gcc/testsuite/gfortran.dg/c_by_val.c
@@ -1,11 +1,13 @@
/* Passing from fortran to C by value, using %VAL. */
+#include <inttypes.h>
+
typedef struct { float r, i; } complex;
typedef struct { double r, i; } complex8;
extern void f_to_f__ (float*, float, float*, float**);
extern void f_to_f8__ (double*, double, double*, double**);
extern void i_to_i__ (int*, int, int*, int**);
-extern void i_to_i8__ (long*, long, long*, long**);
+extern void i_to_i8__ (int64_t*, int64_t, int64_t*, int64_t**);
extern void c_to_c__ (complex*, complex, complex*, complex**);
extern void c_to_c8__ (complex8*, complex8, complex8*, complex8**);
extern void abort (void);
@@ -41,7 +43,7 @@
}
void
-i_to_i8__(long *retval, long i1, long *i2, long **i3)
+i_to_i8__(int64_t *retval, int64_t i1, int64_t *i2, int64_t **i3)
{
if ( i1 != *i2 ) abort();
if ( i1 != **i3 ) abort();
--- End Message ---