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

             Bug #: 51788
           Summary: Unstable gfc_verify_binding_labels check for a binding
                    label which collides with a global entity
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: bur...@gcc.gnu.org
            Blocks: 51578


Found when trying to create a patch for PR 51578. Seemingly, the generated tree
is now slightly different.

The problem is that the test case
  gfortran.dg/binding_label_tests_10_main.f03
fails with my patch - without, one gets the following.

However, if one swaps the lines
  use binding_label_tests_10_main
  use binding_label_tests_10 ! { dg-error "collides" }
I get now an error with my patch - but none with the unpatched GCC.

Hence, the test case is not stable. At least with my patch it fails in
resolve.c's gfc_verify_binding_labels as:
          if (sym->attr.if_source == IFSRC_DECL
is not fulfilled. The reason is that symbols loaded from .mod files are have
IFSRC_UNKNOWN.


A "proper" error message looks as follows:

gfortran.dg/binding_label_tests_10_main.f03:11.6:

  use binding_label_tests_10 ! { dg-error "collides" }
      1
gfortran.dg/binding_label_tests_10_main.f03:7.45:

  integer(c_int), bind(c,name="c_one") :: one ! { dg-error "collides" }
                                             2
Error: Binding label 'c_one' at (1) collides with global entity 'c_one' at (2)


(Cf. PR 48858 comment 9 for some information about binding labels.)

Reply via email to