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]

Re: [PATCH][PR65802] Mark ifn_va_arg with ECF_NOTHROW


On 21-04-15 09:50, Richard Biener wrote:
On Tue, 21 Apr 2015, Jan Hubicka wrote:

Mark ifn_va_arg with ECF_NOTHROW

You can definitely make it ECF_LEAF too. I wonder if we can make it ECF_CONST or at leat PURE
this would help to keep variadic functions const/pure that may be moderately interesting
in practice.

Yes to ECF_LEAF but it isn't const or pure as it modifies the valist
argument so you can't for example DCE va_arg (...) if the result isn't
needed.


I've committed this patch that marks ifn_va_arg as ECF_LEAF.

Bootstrapped and reg-tested on x86_64.

Thanks,
- Tom

Mark ifn_va_arg as ECF_LEAF

2015-04-26  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/65826
	* internal-fn.def: Mark VA_ARG with ECF_LEAF.

diff --git a/gcc/internal-fn.def b/gcc/internal-fn.def
index 7e19313..ba5c2c1 100644
--- a/gcc/internal-fn.def
+++ b/gcc/internal-fn.def
@@ -62,4 +62,4 @@ DEF_INTERNAL_FN (ADD_OVERFLOW, ECF_CONST | ECF_LEAF | ECF_NOTHROW, NULL)
 DEF_INTERNAL_FN (SUB_OVERFLOW, ECF_CONST | ECF_LEAF | ECF_NOTHROW, NULL)
 DEF_INTERNAL_FN (MUL_OVERFLOW, ECF_CONST | ECF_LEAF | ECF_NOTHROW, NULL)
 DEF_INTERNAL_FN (TSAN_FUNC_EXIT, ECF_NOVOPS | ECF_LEAF | ECF_NOTHROW, NULL)
-DEF_INTERNAL_FN (VA_ARG, ECF_NOTHROW, NULL)
+DEF_INTERNAL_FN (VA_ARG, ECF_NOTHROW | ECF_LEAF, NULL)
-- 
1.9.1


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