public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] microblaze: use strverscmp() in MICROBLAZE_VERSION_COMPARE()
@ 2022-10-16 18:15 Ovidiu Panait
  2022-10-24 15:18 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Ovidiu Panait @ 2022-10-16 18:15 UTC (permalink / raw)
  To: gcc-patches

Currently, combining '-mxl-multiply-high' with -mcpu=v11.0 produces the
following bogus warning:

  echo "int main(){}" | ./microblazeel-linux-gnu-gcc -mxl-multiply-high \
  -mno-xl-soft-mul -mcpu=v11.0 -nostdlib -x c -
  warning: '-mxl-multiply-high' can be used only with '-mcpu=v6.00.a' or greater

Since strcasecmp() doesn't properly compare single-digit cpu versions with
double-digit versions, switch MICROBLAZE_VERSION_COMPARE() to use strverscmp()
instead.

	* config/microblaze/microblaze.cc (MICROBLAZE_VERSION_COMPARE): Use
	strverscmp() to fix bogus warnings when passing multi-digit -mcpu
	versions on the command line.

Signed-off-by: Ovidiu Panait <ovpanait@gmail.com>
---
 gcc/config/microblaze/microblaze.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/microblaze/microblaze.cc b/gcc/config/microblaze/microblaze.cc
index 8fcca1829f6..28a2a9596d1 100644
--- a/gcc/config/microblaze/microblaze.cc
+++ b/gcc/config/microblaze/microblaze.cc
@@ -56,7 +56,7 @@
 /* This file should be included last.  */
 #include "target-def.h"
 
-#define MICROBLAZE_VERSION_COMPARE(VA,VB) strcasecmp (VA, VB)
+#define MICROBLAZE_VERSION_COMPARE(VA,VB) strverscmp (VA, VB)
 
 /* Classifies an address.
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] microblaze: use strverscmp() in MICROBLAZE_VERSION_COMPARE()
  2022-10-16 18:15 [PATCH] microblaze: use strverscmp() in MICROBLAZE_VERSION_COMPARE() Ovidiu Panait
@ 2022-10-24 15:18 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2022-10-24 15:18 UTC (permalink / raw)
  To: Ovidiu Panait, gcc-patches


On 10/16/22 12:15, Ovidiu Panait via Gcc-patches wrote:
> Currently, combining '-mxl-multiply-high' with -mcpu=v11.0 produces the
> following bogus warning:
>
>    echo "int main(){}" | ./microblazeel-linux-gnu-gcc -mxl-multiply-high \
>    -mno-xl-soft-mul -mcpu=v11.0 -nostdlib -x c -
>    warning: '-mxl-multiply-high' can be used only with '-mcpu=v6.00.a' or greater
>
> Since strcasecmp() doesn't properly compare single-digit cpu versions with
> double-digit versions, switch MICROBLAZE_VERSION_COMPARE() to use strverscmp()
> instead.
>
> 	* config/microblaze/microblaze.cc (MICROBLAZE_VERSION_COMPARE): Use
> 	strverscmp() to fix bogus warnings when passing multi-digit -mcpu
> 	versions on the command line.

But strverscmp doesn't ignore character case.  ISTM that you need to 
canonicalize the case first if you're going to use strverscmp.


Jeff



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-24 15:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-16 18:15 [PATCH] microblaze: use strverscmp() in MICROBLAZE_VERSION_COMPARE() Ovidiu Panait
2022-10-24 15:18 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).