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:33:31 +0000 (08:33 +0000)
committerOleg Endo <olegendo@gcc.gnu.org>
Sat, 28 Sep 2019 08:33:31 +0000 (08:33 +0000)
gcc/
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: r276240

gcc/ChangeLog
gcc/config/sh/sh.c

index ae7c8dd1295d0480a573938689a285cbffb3af9e..459fbe53771fc1927507d7949c4707f363ed4d22 100644 (file)
@@ -1,3 +1,9 @@
+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-27  Maciej W. Rozycki  <macro@wdc.com>
 
        * configure: Regenerate.
index e3eea1032ce2538f0667562596dae3eb5963decb..5c4598fb2c0b939f1277e7dd97b194903d2d682d 100644 (file)
@@ -734,7 +734,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 ());