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, CHKP] Don't generate bndret for not instrumented calls


On 12/02/14 06:33, Ilya Enkovich wrote:
Hi,

Currently bndret is generated each time we need to get bounds for returned pointer.  It causes bndret generated for not instrumented calls incuding builtin function calls.  Troubles appear when such builtin call is optimized out - bndret needs to be handled appropriately.  Since we don't want not instrumented builtin calls optimizers to be affected by instrumentation, we better avoid bndret for not instrumented calls.  This patch uses zero bounds when we don't expect call to return bounds.

Bootstrapped and tested on  x86_64-unknown-linux-gnu.  OK for trunk?

Thanks,
Ilya
--
gcc/

2014-12-02  Ilya Enkovich  <ilya.enkovich@intel.com>

	* tree-chkp.c (chkp_call_returns_bounds_p): New.
	(chkp_build_returned_bound): Use zero bounds as
	returned by calls not returning bounds.

gcc/testsuite/

2014-12-02  Ilya Enkovich  <ilya.enkovich@intel.com>

	* gcc.target/i386/chkp-bndret.c: New.
	* gcc.target/i386/chkp-strchr.c: New.
OK.
Jeff


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