From 457442eb8afcd995a002df6c91d4a9ef8fa3eeb6 Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Fri, 30 Mar 2018 21:04:06 +0000 Subject: [PATCH] PR tree-optimization/84818 - integer_onep must not be used for i18n gcc/ChangeLog: PR tree-optimization/84818 * builtins.c (check_access): Use warning_n. From-SVN: r258983 --- gcc/ChangeLog | 5 +++++ gcc/builtins.c | 20 +++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9114947a763..b9f56ad1eab 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-03-30 Martin Sebor + + PR tree-optimization/84818 + * builtins.c (check_access): Use warning_n. + 2018-03-30 Aaron Sawdey PR target/83822 diff --git a/gcc/builtins.c b/gcc/builtins.c index 487d9d58db2..0c560182f72 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -3172,13 +3172,12 @@ check_access (tree exp, tree, tree, tree dstwrite, exp, func, range[0], dstsize); } else if (tree_int_cst_equal (range[0], range[1])) - warning_at (loc, opt, - (integer_onep (range[0]) - ? G_("%K%qD writing %E byte into a region " - "of size %E overflows the destination") - : G_("%K%qD writing %E bytes into a region " - "of size %E overflows the destination")), - exp, func, range[0], dstsize); + warning_n (loc, opt, tree_to_uhwi (range[0]), + "%K%qD writing %E byte into a region " + "of size %E overflows the destination", + "%K%qD writing %E bytes into a region " + "of size %E overflows the destination", + exp, func, range[0], dstsize); else if (tree_int_cst_sign_bit (range[1])) { /* Avoid printing the upper bound if it's invalid. */ @@ -3273,10 +3272,9 @@ check_access (tree exp, tree, tree, tree dstwrite, location_t loc = tree_nonartificial_location (exp); if (tree_int_cst_equal (range[0], range[1])) - warning_at (loc, opt, - (tree_int_cst_equal (range[0], integer_one_node) - ? G_("%K%qD reading %E byte from a region of size %E") - : G_("%K%qD reading %E bytes from a region of size %E")), + warning_n (loc, opt, tree_to_uhwi (range[0]), + "%K%qD reading %E byte from a region of size %E", + "%K%qD reading %E bytes from a region of size %E", exp, func, range[0], slen); else if (tree_int_cst_sign_bit (range[1])) { -- 2.30.2