[Bug 1610220] [NEW] atomic header cannot be compiled into translation unit with -fkeep-inline-functions

Dimitri John Ledkov launchpad at surgut.co.uk
Fri Aug 5 11:59:01 UTC 2016


Public bug reported:

With gcc-6 6.1.1-11ubuntu11:

$ echo '#include <atomic>' > foo.h
$ gcc -fdump-translation-unit -fkeep-inline-functions -c -x c++-header -fpermissive -w -fPIC foo.h
In file included from /usr/include/c++/6/atomic:41:0,
                 from foo.h:1:
/usr/include/c++/6/bits/atomic_base.h: In member function 'std::atomic<bool>::operator bool() const':
/usr/include/c++/6/bits/atomic_base.h:390:7: error: inlining failed in call to always_inline 'std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::load(std::memory_order) const noexcept [with _ITp = bool; std::__atomic_base<_IntTp>::__int_type = bool; std::memory_order = std::memory_order]': function body not available
       load(memory_order __m = memory_order_seq_cst) const noexcept
       ^~~~
In file included from foo.h:1:0:
/usr/include/c++/6/atomic:81:27: note: called from here
     { return _M_base.load(); }
                           ^

Expected no errors, and translation unit dumped as before, as was with gcc 5.4.0-6ubuntu1:
$ gcc -std=c++11 -fdump-translation-unit -fkeep-inline-functions -c -x c++-header -fpermissive -w -fPIC foo.h

** Affects: gcc-6 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-6 in Ubuntu.
https://bugs.launchpad.net/bugs/1610220

Title:
  atomic header cannot be compiled into translation unit with -fkeep-
  inline-functions

Status in gcc-6 package in Ubuntu:
  New

Bug description:
  With gcc-6 6.1.1-11ubuntu11:

  $ echo '#include <atomic>' > foo.h
  $ gcc -fdump-translation-unit -fkeep-inline-functions -c -x c++-header -fpermissive -w -fPIC foo.h
  In file included from /usr/include/c++/6/atomic:41:0,
                   from foo.h:1:
  /usr/include/c++/6/bits/atomic_base.h: In member function 'std::atomic<bool>::operator bool() const':
  /usr/include/c++/6/bits/atomic_base.h:390:7: error: inlining failed in call to always_inline 'std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::load(std::memory_order) const noexcept [with _ITp = bool; std::__atomic_base<_IntTp>::__int_type = bool; std::memory_order = std::memory_order]': function body not available
         load(memory_order __m = memory_order_seq_cst) const noexcept
         ^~~~
  In file included from foo.h:1:0:
  /usr/include/c++/6/atomic:81:27: note: called from here
       { return _M_base.load(); }
                             ^

  Expected no errors, and translation unit dumped as before, as was with gcc 5.4.0-6ubuntu1:
  $ gcc -std=c++11 -fdump-translation-unit -fkeep-inline-functions -c -x c++-header -fpermissive -w -fPIC foo.h

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-6/+bug/1610220/+subscriptions



More information about the foundations-bugs mailing list