public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/105234] inlining failed in call to 'always_inline' 'memset': target specific option mismatch
Date: Tue, 12 Apr 2022 08:51:08 +0000	[thread overview]
Message-ID: <bug-105234-4-8nkq32PAfN@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105234-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Reduced test-case:

$ cat ~/Programming/testcases/AtomicFile.cpp.i
namespace std {
typedef char string;
class runtime_error {
public:
  runtime_error(string);
};
} // namespace std
#pragma GCC push_options
namespace fmt {
namespace {
__attribute__((always_inline)) auto format() -> std::string {}
#pragma GCC pop_options
} // namespace
} // namespace fmt
namespace core {
class ErrorBase : std::runtime_error {
  runtime_error::runtime_error;
};
class Error : ErrorBase {
public:
  template <typename... T> Error(T &&...);
};
template <typename... T> Error::Error(T &&...) : ErrorBase(fmt::format()) {}
} // namespace core
void commit() { core::Error(); }

$ ./xg++ -B. ~/Programming/testcases/AtomicFile.cpp.i -c
/home/marxin/Programming/testcases/AtomicFile.cpp.i: In function ‘std::string
fmt::{anonymous}::format()’:
/home/marxin/Programming/testcases/AtomicFile.cpp.i:11:62: warning: no return
statement in function returning non-void [-Wreturn-type]
   11 | __attribute__((always_inline)) auto format() -> std::string {}
      |                                                              ^
/home/marxin/Programming/testcases/AtomicFile.cpp.i: At global scope:
/home/marxin/Programming/testcases/AtomicFile.cpp.i:17:3: warning: access
declarations are deprecated in favour of using-declarations; suggestion: add
the ‘using’ keyword [-Wdeprecated]
   17 |   runtime_error::runtime_error;
      |   ^~~~~~~~~~~~~
/home/marxin/Programming/testcases/AtomicFile.cpp.i:11:37: warning:
‘always_inline’ function might not be inlinable [-Wattributes]
   11 | __attribute__((always_inline)) auto format() -> std::string {}
      |                                     ^~~~~~
/home/marxin/Programming/testcases/AtomicFile.cpp.i: In constructor
‘core::Error::Error(T&& ...) [with T = {}]’:
/home/marxin/Programming/testcases/AtomicFile.cpp.i:11:37: error: inlining
failed in call to ‘always_inline’ ‘std::string fmt::{anonymous}::format()’:
target specific option mismatch
/home/marxin/Programming/testcases/AtomicFile.cpp.i:23:73: note: called from
here
   23 | template <typename... T> Error::Error(T &&...) :
ErrorBase(fmt::format()) {}
      |                                                                        
^

Note it crashes if I enable inlined dumps:

$ ./xg++ -B. ~/Programming/testcases/AtomicFile.cpp.i -c -fdump-tree-einline
/home/marxin/Programming/testcases/AtomicFile.cpp.i: In function ‘std::string
fmt::{anonymous}::format()’:
/home/marxin/Programming/testcases/AtomicFile.cpp.i:11:62: warning: no return
statement in function returning non-void [-Wreturn-type]
   11 | __attribute__((always_inline)) auto format() -> std::string {}
      |                                                              ^
/home/marxin/Programming/testcases/AtomicFile.cpp.i: At global scope:
/home/marxin/Programming/testcases/AtomicFile.cpp.i:17:3: warning: access
declarations are deprecated in favour of using-declarations; suggestion: add
the ‘using’ keyword [-Wdeprecated]
   17 |   runtime_error::runtime_error;
      |   ^~~~~~~~~~~~~
/home/marxin/Programming/testcases/AtomicFile.cpp.i:11:37: warning:
‘always_inline’ function might not be inlinable [-Wattributes]
   11 | __attribute__((always_inline)) auto format() -> std::string {}
      |                                     ^~~~~~
during GIMPLE pass: einline
dump file: AtomicFile.cpp.i.031t.einline
/home/marxin/Programming/testcases/AtomicFile.cpp.i: In constructor
‘core::Error::Error(T&& ...) [with T = {}]’:
/home/marxin/Programming/testcases/AtomicFile.cpp.i:25:32: internal compiler
error: Segmentation fault
   25 | void commit() { core::Error(); }
      |                                ^
0x183066f crash_signal
        /home/marxin/Programming/gcc/gcc/toplev.cc:322
0x7ffff78b93cf ???
       
/usr/src/debug/glibc-2.35-2.1.x86_64/signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x1699c8c cl_target_option_print_diff(_IO_FILE*, int, cl_target_option*,
cl_target_option*)
        /dev/shm/objdir2/gcc/options-save.cc:9319
0x262d142 report_inline_failed_reason
        /home/marxin/Programming/gcc/gcc/ipa-inline.cc:249
0x262d6e4 can_inline_edge_p
        /home/marxin/Programming/gcc/gcc/ipa-inline.cc:401
0x262eb19 can_early_inline_edge_p
        /home/marxin/Programming/gcc/gcc/ipa-inline.cc:656
0x2635fac inline_always_inline_functions
        /home/marxin/Programming/gcc/gcc/ipa-inline.cc:2866
0x2636516 early_inliner(function*)
        /home/marxin/Programming/gcc/gcc/ipa-inline.cc:2976
0x263696f execute
        /home/marxin/Programming/gcc/gcc/ipa-inline.cc:3110
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

I'll take a look.

  parent reply	other threads:[~2022-04-12  8:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12  2:28 [Bug c++/105234] New: nlining failed in call to 'always_inline' 'fmt::v8::basic_format_string<Char, Args>::basic_format_string(const S&) raj.khem at gmail dot com
2022-04-12  2:49 ` [Bug c++/105234] inlining " raj.khem at gmail dot com
2022-04-12  2:49 ` raj.khem at gmail dot com
2022-04-12  2:58 ` [Bug c++/105234] inlining failed in call to 'always_inline' 'memset': target specific option mismatch raj.khem at gmail dot com
2022-04-12  8:51 ` marxin at gcc dot gnu.org [this message]
2022-04-12  8:51 ` [Bug target/105234] " marxin at gcc dot gnu.org
2022-04-12  9:45 ` [Bug target/105234] [12 Regression] inlining failed in call to 'always_inline' 'memset': target specific option mismatch since r12-5920-g01ad8c54fdca1d marxin at gcc dot gnu.org
2022-04-12 10:32 ` jakub at gcc dot gnu.org
2022-04-12 10:33 ` jakub at gcc dot gnu.org
2022-04-12 10:45 ` jakub at gcc dot gnu.org
2022-04-12 10:49 ` redi at gcc dot gnu.org
2022-04-12 11:00 ` marxin at gcc dot gnu.org
2022-04-12 11:03 ` jakub at gcc dot gnu.org
2022-04-12 11:09 ` jakub at gcc dot gnu.org
2022-04-12 11:16 ` marxin at gcc dot gnu.org
2022-04-13  1:50 ` linkw at gcc dot gnu.org
2022-04-13  8:14 ` cvs-commit at gcc dot gnu.org
2022-04-13  8:36 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-105234-4-8nkq32PAfN@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).