From 6a1f70d39581038bceb6820ba24a66a9d0bb9d67 Mon Sep 17 00:00:00 2001 From: Oleg Endo Date: Sat, 28 Sep 2019 08:41:09 +0000 Subject: [PATCH] backport: re PR target/80672 (gcc/config/sh/sh.c:716: prefer compare to find.) gcc/ 2019-09-28 Oleg Endo Backport from mainline 2019-09-28 Oleg Endo PR target/80672 * config/sh/sh.c (parse_validate_atomic_model_option): Use std::string::compare instead of std::string::find. From-SVN: r276243 --- gcc/ChangeLog | 9 +++++++++ gcc/config/sh/sh.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3828edd0fb24..966b036591d2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2019-09-28 Oleg Endo + + Backport from mainline + 2019-09-28 Oleg Endo + + PR target/80672 + * config/sh/sh.c (parse_validate_atomic_model_option): Use + std::string::compare instead of std::string::find. + 2019-09-28 Oleg Endo Backport from mainline diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 11f121d71627..c303e5e54ae8 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -713,7 +713,7 @@ got_mode_name:; { if (tokens[i] == "strict") ret.strict = true; - else if (tokens[i].find ("gbr-offset=") == 0) + else if (!tokens[i].compare (0, strlen ("gbr-offset="), "gbr-offset=")) { std::string offset_str = tokens[i].substr (strlen ("gbr-offset=")); ret.tcb_gbr_offset = integral_argument (offset_str.c_str ()); -- 2.47.2