Commit 975d3303 by Tobias Burnus Committed by Tobias Burnus

re PR fortran/43015 (ICE with BIND(C) and -fbounds-check in mingw-w64 cross-compiler)

2010-02-10  Tobias Burnus  <burnus@net-b.de>

        PR fortran/43015
        * trans-decl.c (gfc_generate_function_code): Only check
        actual-vs.-dummy character bounds if not bind(C).

2010-02-10  Tobias Burnus  <burnus@net-b.de>

        PR fortran/43015
        * gfortran.dg/bind_c_usage_20.f90: New test.

From-SVN: r156663
parent 3b2524b1
2010-02-10 Tobias Burnus <burnus@net-b.de>
PR fortran/43015
* trans-decl.c (gfc_generate_function_code): Only check
actual-vs.-dummy character bounds if not bind(C).
2010-02-10 Jakub Jelinek <jakub@redhat.com> 2010-02-10 Jakub Jelinek <jakub@redhat.com>
PR fortran/42309 PR fortran/42309
......
/* Backend function setup /* Backend function setup
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc. Free Software Foundation, Inc.
Contributed by Paul Brook Contributed by Paul Brook
...@@ -4367,7 +4367,7 @@ gfc_generate_function_code (gfc_namespace * ns) ...@@ -4367,7 +4367,7 @@ gfc_generate_function_code (gfc_namespace * ns)
/* If bounds-checking is enabled, generate code to check passed in actual /* If bounds-checking is enabled, generate code to check passed in actual
arguments against the expected dummy argument attributes (e.g. string arguments against the expected dummy argument attributes (e.g. string
lengths). */ lengths). */
if (gfc_option.rtcheck & GFC_RTCHECK_BOUNDS) if ((gfc_option.rtcheck & GFC_RTCHECK_BOUNDS) && !sym->attr.is_bind_c)
add_argument_checking (&body, sym); add_argument_checking (&body, sym);
tmp = gfc_trans_code (ns->code); tmp = gfc_trans_code (ns->code);
......
2010-02-10 Tobias Burnus <burnus@net-b.de>
PR fortran/43015
* gfortran.dg/bind_c_usage_20.f90: New test.
2010-02-10 Jakub Jelinek <jakub@redhat.com> 2010-02-10 Jakub Jelinek <jakub@redhat.com>
PR debug/43010 PR debug/43010
......
! { dg-do compile }
! { dg-options "-fcheck=bounds" }
!
! PR fortran/43015
!
! Contributed by Dennis Wassel
!
SUBROUTINE foo(msg) BIND(C, name = "Foo")
USE, INTRINSIC :: iso_c_binding
IMPLICIT NONE
CHARACTER (KIND=C_CHAR), INTENT (out) :: msg(*)
END SUBROUTINE foo
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment