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

wf_cs at yahoo dot com gcc-bugzilla@gcc.gnu.org
Tue Mar 15 03:59:00 GMT 2005


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



More information about the Gcc-bugs mailing list