[Bug c/64805] New: Specific use of __attribute ((always_inline)) breaks MPX functionality with -fcheck-pointer-bounds -mmpx

christian.otterstad at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Jan 26 17:07:00 GMT 2015


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

            Bug ID: 64805
           Summary: Specific use of __attribute ((always_inline)) breaks
                    MPX functionality with -fcheck-pointer-bounds -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

Using the latest git pull of GCC the following program fails to compile:

#include <stdio.h>

static inline void __attribute ((always_inline)) functionA(void)
{
        return;
}

static inline void __attribute ((always_inline)) functionB(void)
{
        functionA();
}

int test(void)
{
        functionB();

        return 0;
}


Attempt at compiling:

attribute_bug.c: In function 'functionB':
attribute_bug.c:18:1: error: Analyzed node has no reference to instrumented
version
 }
 ^
functionB/12 (functionB) @0x7f8d783a8dc8
  Type: function definition analyzed
  Visibility: prevailing_def_ironly
  References: 
  Referring: 
  Availability: local
  First run: 0
  Function flags: body local
  Called by: 
  Calls: 
  Has instrumented version.
attribute_bug.c:18:1: internal compiler error: verify_cgraph_node failed
0x749ab0 cgraph_node::verify_node()
        ../../../temp_git/gcc/gcc/cgraph.c:3096
0x73eab7 symtab_node::verify()
        ../../../temp_git/gcc/gcc/symtab.c:1161
0xb5a089 optimize_inline_calls(tree_node*)
        ../../../temp_git/gcc/gcc/tree-inline.c:4936
0x10dadf8 early_inliner(function*)
        ../../../temp_git/gcc/gcc/ipa-inline.c:2577
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


This is rewritten from code found in glibc, in libc-start.c (it also fails to
compile with the same error).

This may be related to fixes resulting from bug 64363
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64363 , as earlier versions of GCC
supporting -fcheck-pointer-bounds -mmpx do not feature this issue. However
since it is a bug of a different type I'm nevertheless opening a new bug for
this problem.

It appears gcc (GCC) 5.0.0 20150122 and up have this problem (latest version
tested: gcc (GCC) 5.0.0 20150126)

It appears that at least gcc (GCC) 5.0.0 20150107, gcc (GCC) 5.0.0 20150105,
gcc (GCC) 5.0.0 20141218 do not feature this bug.



More information about the Gcc-bugs mailing list