diff mbox series

[SH,committed] Fix PR 80672

Message ID d992124cf3f53543653d7a478378ff6e528b7f23.camel@t-online.de
State New
Headers show
Series [SH,committed] Fix PR 80672 | expand

Commit Message

Oleg Endo Sept. 28, 2019, 8:44 a.m. UTC
Hi,

The attached patch fixes PR 80672.
Tested by building the compiler with "make all-gcc" and manually
invoking it and checking that the option is parsed as expected.

Committed to trunk as r276240, GCC 9 as r276241, GCC 8 as r276242, GCC
7 as r276243.

Cheers,
Oleg


gcc/ChangeLog
	PR target/80672
	* config/sh/sh.c (parse_validate_atomic_model_option): Use
	std::string::compare instead of std::string::find.
diff mbox series

Patch

Index: gcc/config/sh/sh.c
===================================================================
--- gcc/config/sh/sh.c	(revision 276235)
+++ gcc/config/sh/sh.c	(working copy)
@@ -734,7 +734,7 @@ 
     {
       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 ());