public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/56082] New: FAIL: gfortran.dg/bind_c_bool_1.f90  -O   (test for errors, line 18) on powerpc-apple-darwin9 with -m32
@ 2013-01-23 13:57 dominiq at lps dot ens.fr
  2013-02-12 11:33 ` [Bug testsuite/56082] " dominiq at lps dot ens.fr
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-01-23 13:57 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56082
           Summary: FAIL: gfortran.dg/bind_c_bool_1.f90  -O   (test for
                    errors, line 18) on powerpc-apple-darwin9 with -m32
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dominiq@lps.ens.fr
                CC: burnus@net-b.de, iains@gcc.gnu.org,
                    mikestump@comcast.net
              Host: powerpc-apple-darwin9
            Target: powerpc-apple-darwin9
             Build: powerpc-apple-darwin9


The test gfortran.dg/bind_c_bool_1.f90 fails on powerpc-apple-darwin9 with -m32
(but not with -m64). From 
http://gcc.gnu.org/onlinedocs/gcc/Darwin-Options.html#Darwin-Options

-mone-byte-bool
Override the defaults for `bool' so that `sizeof(bool)==1'. By default
`sizeof(bool)' is `4' when compiling for Darwin/PowerPC and `1' when compiling
for Darwin/x86, so this option has no effect on x86.

As shown by the following test

[karma] f90/bug% cat c_bool.f90
use iso_c_binding; print *, C_Bool; end
[karma] f90/bug% gfc c_bool.f90
[karma] f90/bug% a.out 
           4
[karma] f90/bug% gfc c_bool.f90 -m64
[karma] f90/bug% a.out
           1
[karma] f90/bug% 

C_Bool is 4 for Darwin/PowerPC (32 bit mode) and the test

! { dg-do compile }
subroutine sub(x) bind(C) ! { dg-error "GNU Extension: LOGICAL dummy argument
'x' at .1. with non-C_Bool kind in BIND.C. procedure 'sub'" }
  logical(kind=4) :: x
end subroutine sub

does not give any error even with -std=f2003.

I can think of at least 3 ways to fix the test:

(a) XFAIL the test.

--- /opt/gcc/_gcc_clean/gcc/testsuite/gfortran.dg/bind_c_bool_1.f90   
2013-01-13 07:07:14.000000000 +0100
+++ /opt/gcc/work/gcc/testsuite/gfortran.dg/bind_c_bool_1_a.f90    2013-01-23
14:44:33.000000000 +0100
@@ -16,7 +16,7 @@ end function sub4


 subroutine sub(x) bind(C) ! { dg-error "GNU Extension: LOGICAL dummy argument
'x' at .1. with non-C_Bool kind in BIND.C. procedure 'sub'" }
-  logical(kind=4) :: x
+  logical(kind=2) :: x
 end subroutine sub

 subroutine sub3(y) bind(C)

(b) Use logical(kind=2), hoping that there is no targer with C_Bool==2.

--- /opt/gcc/_gcc_clean/gcc/testsuite/gfortran.dg/bind_c_bool_1.f90   
2013-01-13 07:07:14.000000000 +0100
+++ /opt/gcc/work/gcc/testsuite/gfortran.dg/bind_c_bool_1_b.f90    2013-01-23
14:52:45.000000000 +0100
@@ -15,7 +15,7 @@ function sub4() bind(C) result(res) ! { 
 end function sub4


-subroutine sub(x) bind(C) ! { dg-error "GNU Extension: LOGICAL dummy argument
'x' at .1. with non-C_Bool kind in BIND.C. procedure 'sub'" }
+subroutine sub(x) bind(C) ! { dg-error "GNU Extension: LOGICAL dummy argument
'x' at .1. with non-C_Bool kind in BIND.C. procedure 'sub'" "" { xfail {
powerpc*-apple-darwin* && { ! lp64 } } } }
   logical(kind=4) :: x
 end subroutine sub


(c) Use the following patch

--- /opt/gcc/_gcc_clean/gcc/testsuite/gfortran.dg/bind_c_bool_1.f90   
2013-01-13 07:07:14.000000000 +0100
+++ /opt/gcc/work/gcc/testsuite/gfortran.dg/bind_c_bool_1.f90    2013-01-21
19:50:29.000000000 +0100
@@ -1,5 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-std=f2003" }
+! { dg-additional-options "-mone-byte-bool" { target { powerpc*-apple-darwin*
&& { ! lp64 } } } }
 !
 ! PR fortran/55758
 !

What is the best one? or is there a better one?


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

* [Bug testsuite/56082] FAIL: gfortran.dg/bind_c_bool_1.f90  -O   (test for errors, line 18) on powerpc-apple-darwin9 with -m32
  2013-01-23 13:57 [Bug testsuite/56082] New: FAIL: gfortran.dg/bind_c_bool_1.f90 -O (test for errors, line 18) on powerpc-apple-darwin9 with -m32 dominiq at lps dot ens.fr
@ 2013-02-12 11:33 ` dominiq at lps dot ens.fr
  2013-02-12 16:22 ` burnus at gcc dot gnu.org
  2013-02-12 16:27 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-02-12 11:33 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2013-02-12 11:33:37 UTC ---
I just noticed that I swapped the patches for (a) and (b).


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

* [Bug testsuite/56082] FAIL: gfortran.dg/bind_c_bool_1.f90  -O   (test for errors, line 18) on powerpc-apple-darwin9 with -m32
  2013-01-23 13:57 [Bug testsuite/56082] New: FAIL: gfortran.dg/bind_c_bool_1.f90 -O (test for errors, line 18) on powerpc-apple-darwin9 with -m32 dominiq at lps dot ens.fr
  2013-02-12 11:33 ` [Bug testsuite/56082] " dominiq at lps dot ens.fr
@ 2013-02-12 16:22 ` burnus at gcc dot gnu.org
  2013-02-12 16:27 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-02-12 16:22 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-02-12 16:22:26 UTC ---
Author: burnus
Date: Tue Feb 12 16:22:13 2013
New Revision: 195984

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195984
Log:
2013-02-12  Dominique d'Humieres  <dominiq@lps.ens.fr>
            Tobias Burnus  <burnus@net-b.de>

        PR fortran/56082
        * gfortran.dg/bind_c_bool_1.f90 (sub): Change kind=4
        to kind=2 as 32bit Darwin has C_Bool == 4.


Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/bind_c_bool_1.f90


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

* [Bug testsuite/56082] FAIL: gfortran.dg/bind_c_bool_1.f90  -O   (test for errors, line 18) on powerpc-apple-darwin9 with -m32
  2013-01-23 13:57 [Bug testsuite/56082] New: FAIL: gfortran.dg/bind_c_bool_1.f90 -O (test for errors, line 18) on powerpc-apple-darwin9 with -m32 dominiq at lps dot ens.fr
  2013-02-12 11:33 ` [Bug testsuite/56082] " dominiq at lps dot ens.fr
  2013-02-12 16:22 ` burnus at gcc dot gnu.org
@ 2013-02-12 16:27 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-02-12 16:27 UTC (permalink / raw)
  To: gcc-bugs


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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |burnus at gcc dot gnu.org
         Resolution|                            |FIXED

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-02-12 16:27:12 UTC ---
Should be FIXED.

Thanks Dominique for the report, debugging the issue, and for the patch!


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

end of thread, other threads:[~2013-02-12 16:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-23 13:57 [Bug testsuite/56082] New: FAIL: gfortran.dg/bind_c_bool_1.f90 -O (test for errors, line 18) on powerpc-apple-darwin9 with -m32 dominiq at lps dot ens.fr
2013-02-12 11:33 ` [Bug testsuite/56082] " dominiq at lps dot ens.fr
2013-02-12 16:22 ` burnus at gcc dot gnu.org
2013-02-12 16:27 ` burnus at gcc dot gnu.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).