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 c/14516] New: [3.4/3.5 regression] -fleading-underscore does not work correctly for file static variables


Compile this:

int i;
static int j;
int foo()
{
  static int k;
  return k;
}

with -fleading-underscore (gcc -S -fleading-underscore foo.c).  The variable k
is compiled as "k.0" with no leading underscore.  This worked correctly in 3.3.

I suspect that this problem also appears in a compiler targeted for sh-elf,
which sets USER_LABEL_PREFIX to "_".  In that case there is no need to use
-fleading-underscore, as it is implied.  The problem came up on the gdb-patches
list, and I tried recreating it using -fleading-underscore rather than building
an sh-elf compiler.

-- 
           Summary: [3.4/3.5 regression] -fleading-underscore does not work
                    correctly for file static variables
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ian at wasabisystems dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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