This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ PATCH to make constexpr respect -fno-inline
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 24 Feb 2016 10:17:17 -0500
- Subject: C++ PATCH to make constexpr respect -fno-inline
- Authentication-results: sourceware.org; auth=none
While talking about constexpr issues it occurred to me that we ought not
fold away calls to constexpr functions in regular expressions when the
user has specified -fno-inline, so that they can debug those calls normally.
Tested x86_64-pc-linux-gnu, applying to trunk.
commit bf89c79569525294101eb024502fcc03011b16d2
Author: Jason Merrill <jason@redhat.com>
Date: Mon Feb 22 13:32:50 2016 -0500
* cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index 34bdc82..c59cd90 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -2154,7 +2154,8 @@ cp_fold (tree x)
TODO:
Do constexpr expansion of expressions where the call itself is not
constant, but the call followed by an INDIRECT_REF is. */
- if (callee && DECL_DECLARED_CONSTEXPR_P (callee))
+ if (callee && DECL_DECLARED_CONSTEXPR_P (callee)
+ && !flag_no_inline)
r = maybe_constant_value (x);
optimize = sv;