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/16973] New: Differences between addresses of labels broken


In the course of writing a formal model of constant expressions,
including the GNU extensions which have been requested, I found
that one of these, differences such as &&a - &&b in initializers,
doesn't actually work properly.  This is a regression from 3.4.x.

void
f (void)
{
  static __SIZE_TYPE__ x = &&a - &&b;
  a : b : return;
}

compiles to a .s file, but with mainline the .s file is invalid:

/home/jsm28/tmp/tmpdir/ccASoFOw.s: Assembler messages:
/home/jsm28/tmp/tmpdir/ccASoFOw.s:7: Error: can't resolve `.text' {.text
section} - `.L2' {*UND* section}

        .file   "t.c"
        .data
        .align 4
        .type   x.1120, @object
        .size   x.1120, 4
x.1120:
        .long   .L1-.L2
        .text
        .align 4
.globl f
        .type   f, @function
f:
        pushl   %ebp
        movl    %esp, %ebp
        popl    %ebp
        ret
.L1:
        .size   f, .-f
        .ident  "GCC: (GNU) 3.5.0 20040810 (experimental)"
        .section        .note.GNU-stack,"",@progbits

(note the absence of a .L2 label).

3.4.1 generates working output with the difference of two
assembler labels that actually exist (although oddly the
labels aren't at the same place).

-- 
           Summary: Differences between addresses of labels broken
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jsm28 at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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