This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C++ PATCH to make constexpr respect -fno-inline


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;
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]