]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2014-07-14 Richard Biener <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Jul 2014 11:12:29 +0000 (11:12 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Jul 2014 11:12:29 +0000 (11:12 +0000)
* builtins.c (c_strlen): Make only_value == 2 really only
affect warning generation.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212514 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/builtins.c

index 43f871fce81657d5f6092fb499d8d737b76bbfd0..04cece4ee76b8186b24cd6b9adbe1cb2111b1ea3 100644 (file)
@@ -1,3 +1,8 @@
+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
index cc94302d0cf5fbced5df7204bbe9847fca45a017..03d1dcadfa13de0cf6504675cc876a5be6a885f2 100644 (file)
@@ -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
      runtime.  */
-  if (only_value != 2
-      && (offset < 0 || offset > max))
+  if (offset < 0 || offset > max)
     {
      /* 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");
           TREE_NO_WARNING (src) = 1;