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] Give up instead of ICE on invalid stringops attributes (PR tree-optimization/71588)


On 06/20/2016 12:35 PM, Jakub Jelinek wrote:
Hi!

If users use attributes like const or pure incorrectly on stringops
builtins, the tree-ssa-strlen.c pass can ICE, because it expects it can e.g.
replace a strcpy (which should not be const or pure) with memcpy (which also
shouldn't be const/pure) etc.
The patch just pretends the calls aren't builtins for the purpose of
tree-ssa-strlen.c pass if they have unexpected const/pure-ness.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk/6.2?

2016-06-20  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/71588
	* tree-ssa-strlen.c (valid_builtin_call): New function.
	(adjust_last_stmt, handle_builtin_memset, strlen_optimize_stmt): Use
	it.

	* gcc.dg/pr71558.c: New test.
OK.
jeff



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