This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/20477] New: [4.0] Remove used label when optimizing.


See testsuite/gfortran.dg/assign.f90:
! { dg-do run }
! Program to test ASSIGNing a label to common variable. PR18827.
      program test
      integer i
      common i
      assign 2000 to i  ! { dg-warning "Obsolete: ASSIGN statement" }
2000  continue
      end

In the Fortran front-end we generate the label decl tree of "2000" and use its 
address in fortran/trans-stmt.c: gfc_trans_label_assign() function.

If we don't set DECL_ARTIFICIAL flag to zero on the label_tree, when compile 
the test program  the label will be removed when optimizing and cause to link 
error.

It disappeared in the recent GCC mainline version.

-- 
           Summary: [4.0] Remove used label when optimizing.
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wf_cs at yahoo dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]