Commit 3b57ff81 by Richard Biener Committed by Richard Biener

builtins.c (c_strlen): Make only_value == 2 really only affect warning generation.

2014-07-14  Richard Biener  <rguenther@suse.de>

	* builtins.c (c_strlen): Make only_value == 2 really only
	affect warning generation.

From-SVN: r212514
parent 406bfdd3
2014-07-14 Richard Biener <rguenther@suse.de> 2014-07-14 Richard Biener <rguenther@suse.de>
* builtins.c (c_strlen): Make only_value == 2 really only
affect warning generation.
2014-07-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/61757 PR tree-optimization/61757
PR tree-optimization/61783 PR tree-optimization/61783
PR tree-optimization/61787 PR tree-optimization/61787
......
...@@ -610,11 +610,11 @@ c_strlen (tree src, int only_value) ...@@ -610,11 +610,11 @@ c_strlen (tree src, int only_value)
/* If the offset is known to be out of bounds, warn, and call strlen at /* If the offset is known to be out of bounds, warn, and call strlen at
runtime. */ runtime. */
if (only_value != 2 if (offset < 0 || offset > max)
&& (offset < 0 || offset > max))
{ {
/* Suppress multiple warnings for propagated constant strings. */ /* Suppress multiple warnings for propagated constant strings. */
if (! TREE_NO_WARNING (src)) if (only_value != 2
&& !TREE_NO_WARNING (src))
{ {
warning_at (loc, 0, "offset outside bounds of constant string"); warning_at (loc, 0, "offset outside bounds of constant string");
TREE_NO_WARNING (src) = 1; TREE_NO_WARNING (src) = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment