public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/42950]  New: gfortran testsuite failures on mingw64
@ 2010-02-03 21:09 burnus at gcc dot gnu dot org
  2010-02-04  4:10 ` [Bug fortran/42950] " nightstrike at gmail dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-02-03 21:09 UTC (permalink / raw)
  To: gcc-bugs

As mentioned by NightStrike on IRC. The MinGW64 results are at
http://mingw-w64.sf.net/gfortran.log -- I assume that they are daily updated,
but I do not know for sure (the HTTP header always shows the current
date/time).


Failures:


(1) There are several run-time failures about "g0" with "Zero width in format
descriptor". Tests:
gfortran.dg/complex_intrinsic_5.f90
gfortran.dg/fmt_g0_1.f08
gfortran.dg/unlimited_fmt_1.f08

(2) /dev/null test (gfortran.dg/dev_null.F90 and gfortran.dg/write_to_null.F90)
where seemingly

#if defined  _WIN32
#define DEV_NULL "nul"

does not work as one gets:
  Fortran runtime error: File '/dev/null' does not exist


(3) gfortran.dg/large_real_kind_2.F90  fails at run time, but I do not know
where.


(4) gfortran.dg/namelist_42.f90  fails at run time. (same problem: where? For
NaN I/O?)


(5) gfortran.dg/nan_3.f90  fails at run time (ditto)

(6) gfortran.dg/streamio_16.f90 -- also some abort() call, but I do not see
what goes wrong (not hitting EOF - END=<label>?)


-- 
           Summary: gfortran testsuite failures on mingw64
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42950


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/42950] gfortran testsuite failures on mingw64
  2010-02-03 21:09 [Bug fortran/42950] New: gfortran testsuite failures on mingw64 burnus at gcc dot gnu dot org
@ 2010-02-04  4:10 ` nightstrike at gmail dot com
  2010-02-04 12:32 ` burnus at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: nightstrike at gmail dot com @ 2010-02-04  4:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from nightstrike at gmail dot com  2010-02-04 04:10 -------
The logs are not updated daily, but I try to do them frequently.  I thought
there was date information within the logs themselves.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42950


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/42950] gfortran testsuite failures on mingw64
  2010-02-03 21:09 [Bug fortran/42950] New: gfortran testsuite failures on mingw64 burnus at gcc dot gnu dot org
  2010-02-04  4:10 ` [Bug fortran/42950] " nightstrike at gmail dot com
@ 2010-02-04 12:32 ` burnus at gcc dot gnu dot org
  2010-02-28 17:42 ` burnus at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-02-04 12:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2010-02-04 12:31 -------
Regarding (2): gcc/fortran/cpp.c contains the following, see PR 42954

  /* FIXME: Pandora's Box
    Using the macros below results in multiple breakages:
     - mingw will fail to compile this file as dependent macros
       assume to be used in c-cppbuiltin.c only. Further, they use
       flags only valid/defined in C (same as noted above).
       [config/i386/mingw32.h, config/i386/cygming.h]
     - other platforms (not as popular) break similarly
       [grep for 'builtin_define_with_int_value' in gcc/config/]

  TARGET_CPU_CPP_BUILTINS ();
  TARGET_OS_CPP_BUILTINS ();
  TARGET_OBJFMT_CPP_BUILTINS (); */


Regarding (4)/(5): The NaN problems might be because we do not use
  __USE_MINGW_ANSI_STDIO=1  or  _POSIX
which is needed for POSIX compatible printf routines. Cf.
  http://sourceforge.net/project/shownotes.php?release_id=24832
Even if it is not the issue, it presumably makes sense to define it.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |42954


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42950


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/42950] gfortran testsuite failures on mingw64
  2010-02-03 21:09 [Bug fortran/42950] New: gfortran testsuite failures on mingw64 burnus at gcc dot gnu dot org
  2010-02-04  4:10 ` [Bug fortran/42950] " nightstrike at gmail dot com
  2010-02-04 12:32 ` burnus at gcc dot gnu dot org
@ 2010-02-28 17:42 ` burnus at gcc dot gnu dot org
  2010-03-04 17:56 ` burnus at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-02-28 17:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from burnus at gcc dot gnu dot org  2010-02-28 17:42 -------
Patch for using _POSIX - untested.

Index: libgfortran/io/io.h
===================================================================
--- libgfortran/io/io.h (Revision 157097)
+++ libgfortran/io/io.h (Arbeitskopie)
@@ -27,6 +27,12 @@
 #ifndef GFOR_IO_H
 #define GFOR_IO_H

+/* Ensure that ANSI conform stdio is used. This needs to be set before
+   any system header file is included.  */
+#if defined __MINGW32__
+#  define _POSIX 1
+#endif
+
 /* IO library include.  */

 #include "libgfortran.h"


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42950


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/42950] gfortran testsuite failures on mingw64
  2010-02-03 21:09 [Bug fortran/42950] New: gfortran testsuite failures on mingw64 burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-02-28 17:42 ` burnus at gcc dot gnu dot org
@ 2010-03-04 17:56 ` burnus at gcc dot gnu dot org
  2010-03-04 19:09 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-03-04 17:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from burnus at gcc dot gnu dot org  2010-03-04 17:56 -------
Another patch - please try!

Index: libgfortran.h
===================================================================
--- libgfortran.h       (revision 157215)
+++ libgfortran.h       (working copy)
@@ -121,2 +121,9 @@ extern int __mingw_snprintf (char *, siz

+/* MinGW needs to use the gnu_printf formatter.  */
+#if __MINGW32__
+#  define PRINTF_FORMAT gnu_printf
+#else
+#  define PRINTF_FORMAT printf
+#endif
+

@@ -705,3 +712,3 @@ internal_proto(show_locus);
 extern void runtime_error (const char *, ...)
-     __attribute__ ((noreturn, format (printf, 1, 2)));
+     __attribute__ ((noreturn, format (PRINTF_FORMAT, 1, 2)));
 iexport_proto(runtime_error);
@@ -709,3 +716,3 @@ iexport_proto(runtime_error);
 extern void runtime_error_at (const char *, const char *, ...)
-     __attribute__ ((noreturn, format (printf, 2, 3)));
+     __attribute__ ((noreturn, format (PRINTF_FORMAT, 2, 3)));
 iexport_proto(runtime_error_at);
@@ -713,3 +720,3 @@ iexport_proto(runtime_error_at);
 extern void runtime_warning_at (const char *, const char *, ...)
-     __attribute__ ((format (printf, 2, 3)));
+     __attribute__ ((format (PRINTF_FORMAT, 2, 3)));
 iexport_proto(runtime_warning_at);
@@ -797,3 +804,3 @@ internal_proto(unit_to_fd);
 extern int st_printf (const char *, ...)
-  __attribute__ ((format (printf, 1, 2)));
+  __attribute__ ((format (PRINTF_FORMAT, 1, 2)));
 internal_proto(st_printf);


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42950


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/42950] gfortran testsuite failures on mingw64
  2010-02-03 21:09 [Bug fortran/42950] New: gfortran testsuite failures on mingw64 burnus at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2010-03-04 17:56 ` burnus at gcc dot gnu dot org
@ 2010-03-04 19:09 ` pinskia at gcc dot gnu dot org
  2010-03-05 10:04 ` ktietz at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-03-04 19:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2010-03-04 19:09 -------
(In reply to comment #4)
> +/* MinGW needs to use the gnu_printf formatter.  */
> +#if __MINGW32__
> +#  define PRINTF_FORMAT gnu_printf
> +#else
> +#  define PRINTF_FORMAT printf
> +#endif

Note I would do:
+/* MinGW needs to use the gnu_printf formatter.  */
+#if __MINGW32__
+#  define PRINTF_FORMAT __gnu_printf__
+#else
+#  define PRINTF_FORMAT __printf__
+#endif

Just in case printf and gnu_printf are macros, I doubt it will be in this case
but I helped someone where printf was a macro.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42950


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/42950] gfortran testsuite failures on mingw64
  2010-02-03 21:09 [Bug fortran/42950] New: gfortran testsuite failures on mingw64 burnus at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2010-03-04 19:09 ` pinskia at gcc dot gnu dot org
@ 2010-03-05 10:04 ` ktietz at gcc dot gnu dot org
  2010-03-05 10:34 ` ktietz at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ktietz at gcc dot gnu dot org @ 2010-03-05 10:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from ktietz at gcc dot gnu dot org  2010-03-05 10:04 -------
(In reply to comment #5)

This patch has a problem about the printf formatter definitions in
libgfortran.h header. So I suggest to use the following patch instead.
I am current on to bootstrap it completely and test the given testcases by it
again.

Index: gcc/libgfortran/libgfortran.h
===================================================================
--- gcc.orig/libgfortran/libgfortran.h  2009-12-04 18:22:19.000000000 +0100
+++ gcc/libgfortran/libgfortran.h       2010-03-05 07:44:41.230103300 +0100
@@ -28,6 +28,15 @@ see the files COPYING3 and COPYING.RUNTI
 #ifndef LIBGFOR_H
 #define LIBGFOR_H

+/* Ensure that ANSI conform stdio is used. This needs to be set before
+   any system header file is included.  */
+#if defined __MINGW32__
+#  define _POSIX 1
+#  define gfc_printf gnu_printf
+#else
+#  define gfc_printf __printf__
+#endif
+
 /* config.h MUST be first because it can affect system headers.  */
 #include "config.h"

@@ -703,15 +712,15 @@ extern void show_locus (st_parameter_com
 internal_proto(show_locus);

 extern void runtime_error (const char *, ...)
-     __attribute__ ((noreturn, format (printf, 1, 2)));
+     __attribute__ ((noreturn, format (gfc_printf, 1, 2)));
 iexport_proto(runtime_error);

 extern void runtime_error_at (const char *, const char *, ...)
-     __attribute__ ((noreturn, format (printf, 2, 3)));
+     __attribute__ ((noreturn, format (gfc_printf, 2, 3)));
 iexport_proto(runtime_error_at);

 extern void runtime_warning_at (const char *, const char *, ...)
-     __attribute__ ((format (printf, 2, 3)));
+     __attribute__ ((format (gfc_printf, 2, 3)));
 iexport_proto(runtime_warning_at);

 extern void internal_error (st_parameter_common *, const char *)
@@ -795,7 +804,7 @@ extern int unit_to_fd (int);
 internal_proto(unit_to_fd);

 extern int st_printf (const char *, ...)
-  __attribute__ ((format (printf, 1, 2)));
+  __attribute__ ((format (gfc_printf, 1, 2)));
 internal_proto(st_printf);

 extern int st_vprintf (const char *, va_list);


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42950


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/42950] gfortran testsuite failures on mingw64
  2010-02-03 21:09 [Bug fortran/42950] New: gfortran testsuite failures on mingw64 burnus at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2010-03-05 10:04 ` ktietz at gcc dot gnu dot org
@ 2010-03-05 10:34 ` ktietz at gcc dot gnu dot org
  2010-03-06  7:21 ` ktietz at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ktietz at gcc dot gnu dot org @ 2010-03-05 10:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from ktietz at gcc dot gnu dot org  2010-03-05 10:34 -------
(In reply to comment #6)

As by this patch libgfortran.h defines _POSIX, some additional features (at
least for mingw-w64) getting active about localtime_r and gmtime_r (which
getting implemented by defines, if _POSIX is defined). So the following patch
is getting necessary too.

Index: gcc/libgfortran/intrinsics/date_and_time.c
===================================================================
--- gcc.orig/libgfortran/intrinsics/date_and_time.c     2009-06-22
09:43:32.000000000 +0200
+++ gcc/libgfortran/intrinsics/date_and_time.c  2010-03-05 11:14:39.200103300
+0100
@@ -55,6 +55,11 @@ see the files COPYING3 and COPYING.RUNTI
    thread-local storage so they are threadsafe.  */

 #ifndef HAVE_LOCALTIME_R
+/* If _POSIX is defined localtime_r gets defined by mingw-w64 headers.  */
+#ifdef localtime_r
+#undef localtime_r
+#endif
+
 static struct tm *
 localtime_r (const time_t * timep, struct tm * result)
 {
@@ -64,6 +69,11 @@ localtime_r (const time_t * timep, struc
 #endif

 #ifndef HAVE_GMTIME_R
+/* If _POSIX is defined gmtime_r gets defined by mingw-w64 headers.  */
+#ifdef gmtime_r
+#undef gmtime_r
+#endif
+
 static struct tm *
 gmtime_r (const time_t * timep, struct tm * result)
 {


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42950


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/42950] gfortran testsuite failures on mingw64
  2010-02-03 21:09 [Bug fortran/42950] New: gfortran testsuite failures on mingw64 burnus at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2010-03-05 10:34 ` ktietz at gcc dot gnu dot org
@ 2010-03-06  7:21 ` ktietz at gcc dot gnu dot org
  2010-03-08  2:54 ` jvdelisle at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ktietz at gcc dot gnu dot org @ 2010-03-06  7:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from ktietz at gcc dot gnu dot org  2010-03-06 07:21 -------
Created an attachment (id=20034)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20034&action=view)
Patch about printf and POSIX float conversion

2010-03-06  Kai TIetz  <kai.tietz@onevision.com>

        PR/42950
        * libgfortran.h (_POSIX): Define if __MINGW32__ is defined.
        (gfc_printf): Define to gnu_printf for __MINGW32__ case,
        otherwise to __printf__.
        (gfc_strtof,gfc_strtod,gfc_strtold): Define for mingw case
        to POSIX compatible converter functions.
        (runtime_error): Use instead gfc_printf as formatter
        attribute name.
        (runtime_error_at): Likewise.
        (runtime_warning_at): Likewise.
        (st_printf): Likewise.
        * intrinsics/date_and_time.c (localtime_r): Undefine
        possible defined macro.
        (gmtime_r): Likewise.
        * io/read.c (convert_real): Use gfc_strtof, gfc_strtod,
        and gfc_strtold.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42950


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/42950] gfortran testsuite failures on mingw64
  2010-02-03 21:09 [Bug fortran/42950] New: gfortran testsuite failures on mingw64 burnus at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2010-03-06  7:21 ` ktietz at gcc dot gnu dot org
@ 2010-03-08  2:54 ` jvdelisle at gcc dot gnu dot org
  2010-03-08  8:03 ` ktietz at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2010-03-08  2:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jvdelisle at gcc dot gnu dot org  2010-03-08 02:53 -------
Kai,

Patch in Comment #8 is OK to commit. Thanks!

(I also regression tested on x86-64-linux-gnu.)


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-03-08 02:53:52
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42950


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/42950] gfortran testsuite failures on mingw64
  2010-02-03 21:09 [Bug fortran/42950] New: gfortran testsuite failures on mingw64 burnus at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2010-03-08  2:54 ` jvdelisle at gcc dot gnu dot org
@ 2010-03-08  8:03 ` ktietz at gcc dot gnu dot org
  2010-03-12  8:57 ` ktietz at gcc dot gnu dot org
  2010-03-17  9:30 ` burnus at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: ktietz at gcc dot gnu dot org @ 2010-03-08  8:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from ktietz at gcc dot gnu dot org  2010-03-08 08:03 -------
(In reply to comment #9)
> Kai,
> 
> Patch in Comment #8 is OK to commit. Thanks!
> 
> (I also regression tested on x86-64-linux-gnu.)
> 

Ok, applied at revision 157271.

Patch for enumerators ERROR, WARNING, SILENT will follow soon.

Kai


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42950


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/42950] gfortran testsuite failures on mingw64
  2010-02-03 21:09 [Bug fortran/42950] New: gfortran testsuite failures on mingw64 burnus at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2010-03-08  8:03 ` ktietz at gcc dot gnu dot org
@ 2010-03-12  8:57 ` ktietz at gcc dot gnu dot org
  2010-03-17  9:30 ` burnus at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: ktietz at gcc dot gnu dot org @ 2010-03-12  8:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from ktietz at gcc dot gnu dot org  2010-03-12 08:57 -------
The follow-up patch about those collision in enumerator names is posted at
http://gcc.gnu.org/ml/gcc-patches/2010-03/msg00427.html to gcc's patch-ML.

The only issue remaining open for mingw/cygwin targets after this patch is the
preprocessor issue, but it has already its own bug-report.

Kai


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42950


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/42950] gfortran testsuite failures on mingw64
  2010-02-03 21:09 [Bug fortran/42950] New: gfortran testsuite failures on mingw64 burnus at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2010-03-12  8:57 ` ktietz at gcc dot gnu dot org
@ 2010-03-17  9:30 ` burnus at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-03-17  9:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from burnus at gcc dot gnu dot org  2010-03-17 09:30 -------
Close as fixed as only PR 42954 remains to be done.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42950


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-03-17  9:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-03 21:09 [Bug fortran/42950] New: gfortran testsuite failures on mingw64 burnus at gcc dot gnu dot org
2010-02-04  4:10 ` [Bug fortran/42950] " nightstrike at gmail dot com
2010-02-04 12:32 ` burnus at gcc dot gnu dot org
2010-02-28 17:42 ` burnus at gcc dot gnu dot org
2010-03-04 17:56 ` burnus at gcc dot gnu dot org
2010-03-04 19:09 ` pinskia at gcc dot gnu dot org
2010-03-05 10:04 ` ktietz at gcc dot gnu dot org
2010-03-05 10:34 ` ktietz at gcc dot gnu dot org
2010-03-06  7:21 ` ktietz at gcc dot gnu dot org
2010-03-08  2:54 ` jvdelisle at gcc dot gnu dot org
2010-03-08  8:03 ` ktietz at gcc dot gnu dot org
2010-03-12  8:57 ` ktietz at gcc dot gnu dot org
2010-03-17  9:30 ` burnus at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).