https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64363

            Bug ID: 64363
           Summary: Unresolved labels with -fcheck-pointer-bounds and
                    -mmpx
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: christian.otterstad at gmail dot com

I believe there is a problem with the -fcheck-pointer-bounds and -mmpx
arguments for GCC.

gcc test.c -c -std=gnu99 -O2 -Wall -fcheck-pointer-bounds -g -mmpx
/tmp/ccugNfJ8.s: Assembler messages:
/tmp/ccugNfJ8.s:67: Error: can't resolve `.L5' {*UND* section} - `.L6' {*UND*
section}

For the following source:


#include <stdio.h>

int main(int argc, char **argv)
{
        static int array = &&label_B - &&label_A;

        label_A:

        printf("%d\n", array);

        label_B:

        return 0;
}


This is derived from code found in vfprintf.c in glibc (after a lot of
rewriting). Attempting to compile glibc results in numerous such errors ("can't
resolve") of the same type. Omitting -fcheck-pointer-bounds and -mmpx allows it
(and all of glibc as well) to compile without errors.

Part of the following assembly generated (using -S) is given here:

__chkp_zero_bounds:
        .zero   16
        .data
        .align 4
        .type   array.2314, @object
        .size   array.2314, 4
array.2314:
        .long   .L5-.L6
        .section        .text.unlikely

No AS version appears to be able to assemble this, as .L5, .L6 doesn't exist
anywhere in the assembly source file.


At least the following versions appear to have this problem:

gcc (GCC) 5.0.0 20141211 (experimental) using GNU assembler (Gentoo 2.24 p1.4)
2.24
gcc (GCC) 5.0.0 20141215 (experimental) using GNU assembler (Gentoo 2.24 p1.4)
2.24
gcc (GCC) 5.0.0 20141216 (experimental) using GNU assembler (Gentoo 2.24 p1.4)
2.24
gcc (GCC) 5.0.0 20141216 (experimental) using GNU assembler (GNU Binutils)
2.25.51.20141215
gcc (GCC) 5.0.0 20141216 (experimental) using GNU assembler (GNU Binutils)
2.25.51.20141216
gcc (GCC) 5.0.0 20140925 (experimental) using GNU assembler (GNU Binutils)
2.24.51.20140422
gcc (GCC) 5.0.0 20141218 (experimental) using GNU assembler (Gentoo 2.24 p1.4)


Please note that gcc (GCC) 5.0.0 20140925 (experimental) is the same version
provided by Intel (in both source and binary form) to be used experimentally
with MPX.
https://software.intel.com/en-us/articles/intel-software-development-emulator
However I've also tried these other versions to see if the issue happened to be
resolved.

Reply via email to