]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/80672 (gcc/config/sh/sh.c:716: prefer compare to find.)
authorOleg Endo <olegendo@gcc.gnu.org>
Sat, 28 Sep 2019 08:41:09 +0000 (08:41 +0000)
committerOleg Endo <olegendo@gcc.gnu.org>
Sat, 28 Sep 2019 08:41:09 +0000 (08:41 +0000)
gcc/
2019-09-28  Oleg Endo  <olegendo@gcc.gnu.org>

Backport from mainline
2019-09-28  Oleg Endo  <olegendo@gcc.gnu.org>

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
gcc/config/sh/sh.c

index 3828edd0fb243754841cf564b4fec9d98f02f3ad..966b036591d2dfa492ffca13e389c190f6368cfe 100644 (file)
@@ -1,3 +1,12 @@
+2019-09-28  Oleg Endo  <olegendo@gcc.gnu.org>
+
+       Backport from mainline
+       2019-09-28  Oleg Endo  <olegendo@gcc.gnu.org>
+
+       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  <olegendo@gcc.gnu.org>
 
        Backport from mainline
index 11f121d716276b8a4b9a278757f77d8488a15624..c303e5e54ae8ef6fcd585ba8f559d6045734d0a9 100644 (file)
@@ -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 ());