From 3b57ff81e6246551d6eb563ff2981027db9e6205 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 14 Jul 2014 11:12:29 +0000 Subject: [PATCH] builtins.c (c_strlen): Make only_value == 2 really only affect warning generation. 2014-07-14 Richard Biener * builtins.c (c_strlen): Make only_value == 2 really only affect warning generation. From-SVN: r212514 --- gcc/ChangeLog | 5 +++++ gcc/builtins.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 43f871fce81..04cece4ee76 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-07-14 Richard Biener + + * builtins.c (c_strlen): Make only_value == 2 really only + affect warning generation. + 2014-07-14 Richard Biener PR tree-optimization/61757 diff --git a/gcc/builtins.c b/gcc/builtins.c index cc94302d0cf..03d1dcadfa1 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -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;