Re: [PATCH] arm: unified syntax for libgcc clear_cache

2022-09-30 Thread Seija Kijin via Gcc-patches
Yes, please!

On Tue, Sep 6, 2022 at 10:48 AM Kyrylo Tkachov  wrote:
>
> Hi Seija,
>
> > -Original Message-
> > From: Gcc-patches  > bounces+kyrylo.tkachov=arm@gcc.gnu.org> On Behalf Of Seija Kijin via
> > Gcc-patches
> > Sent: Thursday, August 11, 2022 2:36 PM
> > To: gcc-patches@gcc.gnu.org
> > Subject: [PATCH] arm: unified syntax for libgcc clear_cache
> >
> > The patch to convert all thumb1 code in libgcc to unified syntax
> > omitted changing all swi instructions to the current name: svc.
> >
> > This patch fixes this case.
>
> This is ok, thanks.
> Do you need someone to commit this for you?
>
> Kyrill
>
> >
> > ---
> >  libgcc/config/arm/lib1funcs.S | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libgcc/config/arm/lib1funcs.S b/libgcc/config/arm/lib1funcs.S
> > index 8c39c9f20a2b..19fa1462ccf3 100644
> > --- a/libgcc/config/arm/lib1funcs.S
> > +++ b/libgcc/config/arm/lib1funcs.S
> > @@ -1522,7 +1522,7 @@ LSYM(Lover12):
> >   add r7, r7, #2
> >  #endif
> >   mov r2, #0
> > - swi 0
> > + svc 0
> >   do_pop {r7}
> >   RET
> >   FUNC_END clear_cache


[PATCH] arm: unified syntax for libgcc clear_cache

2022-08-11 Thread Seija Kijin via Gcc-patches
The patch to convert all thumb1 code in libgcc to unified syntax
omitted changing all swi instructions to the current name: svc.

This patch fixes this case.

---
 libgcc/config/arm/lib1funcs.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgcc/config/arm/lib1funcs.S b/libgcc/config/arm/lib1funcs.S
index 8c39c9f20a2b..19fa1462ccf3 100644
--- a/libgcc/config/arm/lib1funcs.S
+++ b/libgcc/config/arm/lib1funcs.S
@@ -1522,7 +1522,7 @@ LSYM(Lover12):
  add r7, r7, #2
 #endif
  mov r2, #0
- swi 0
+ svc 0
  do_pop {r7}
  RET
  FUNC_END clear_cache


[PATCH] libstdc++: Fixing Error: invalid type argument of unary '*' (have 'int')

2022-08-04 Thread Seija Kijin via Gcc-patches
Had an error compiling tiny-cuda-nn using gcc 12.1. With this minor
patch, I recompiled and the build succeeded.

No behavioral change.

---
 libstdc++-v3/include/bits/locale_facets_nonio.tcc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/include/bits/locale_facets_nonio.tcc
b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
index 17a2c8d4486e..fc35a9e693e7 100644
--- a/libstdc++-v3/include/bits/locale_facets_nonio.tcc
+++ b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
@@ -1474,8 +1474,8 @@ _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11
   // calls.  So e.g. if __fmt is "%p %I:%M:%S", we can't handle it
   // properly, because we first handle the %p am/pm specifier and only
   // later the 12-hour format specifier.
-  if ((void*)(this->*(_get::do_get)) == (void*)(_get::do_get))
- __use_state = true;
+  if ((void*)(this->*(_get::do_get)) == (_get::do_get))
+__use_state = true;
 #pragma GCC diagnostic pop
 #endif
   __time_get_state __state = __time_get_state();


[PATCH] libiberty: Make strstr.c in libiberty ANSI compliant

2020-05-01 Thread Seija Kijin via Gcc-patches
The original code in libiberty says "FIXME" and then says it has not been
validated to be ANSI compliant. However, this patch changes the function to
match implementations that ARE compliant, and such code is in the public
domain.

I ran the test results, and there are no test failures.

--- strstr.c 2020-03-12 07:07:24.0 -0400
+++ strstr_fixed.c 2020-05-01 19:53:13.904340902 -0400
@@ -16,26 +16,20 @@

 */

-
-/* FIXME:  The above description is ANSI compiliant.  This routine has not
-   been validated to comply with it.  -fnf */
-
 #include 

-extern char *strchr (const char *, int);
-extern int strncmp (const void *, const void *, size_t);
+extern int memcmp (const void *, const void *, size_t);
 extern size_t strlen (const char *);

 char *
 strstr (const char *s1, const char *s2)
 {
-  const char *p = s1;
   const size_t len = strlen (s2);
-
-  for (; (p = strchr (p, *s2)) != 0; p++)
-{
-  if (strncmp (p, s2, len) == 0)
- return (char *)p;
-}
+  while (*s1)
+  {
+if (!memcmp (s1, s2, len))
+  return (char *)s1;
+++s1;
+  }
   return (0);
 }