This is the mail archive of the 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: Optimize callers using nonnull attribute

On Mon, Oct 07, 2013 at 03:52:25PM +0200, Marc Glisse wrote:
> 2013-10-08  Marc Glisse  <>
> 	PR tree-optimization/58480
> gcc/
> 	* tree-vrp.c (infer_nonnull_range): New function.
> 	(infer_value_range): Call infer_nonnull_range.

This broke whole bunch of OpenMP tests.  Internal calls
have NULL gimple_call_fntype.

Fixed thusly, committed as obvious to trunk.

OT, do you plan to define ATTRIBUTE_RETURNS_NONNULL for
GCC_VERSION >= 4009 in ansidecl.h and use it on the various xmalloc
etc. prototypes?

2013-10-11  Jakub Jelinek  <>

	* tree-vrp.c (infer_nonnull_range): Use is_gimple_call,
	ignore internal calls.

--- gcc/tree-vrp.c.jj	2013-10-10 18:28:15.000000000 +0200
+++ gcc/tree-vrp.c	2013-10-11 14:41:22.625280236 +0200
@@ -4484,7 +4484,7 @@ infer_nonnull_range (gimple stmt, tree o
   if (num_loads + num_stores > 0)
     return true;
-  if (gimple_code (stmt) == GIMPLE_CALL)
+  if (is_gimple_call (stmt) && !gimple_call_internal_p (stmt))
       tree fntype = gimple_call_fntype (stmt);
       tree attrs = TYPE_ATTRIBUTES (fntype);


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