From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13667 invoked by alias); 19 Dec 2014 17:11:16 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 13366 invoked by uid 48); 19 Dec 2014 17:11:09 -0000 From: "christian.otterstad at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/64363] New: Unresolved labels with -fcheck-pointer-bounds and -mmpx Date: Fri, 19 Dec 2014 17:11:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: christian.otterstad at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-12/txt/msg02424.txt.bz2 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 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.