Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/lib/libunwind PR toolchain/55837



details:   https://anonhg.NetBSD.org/src/rev/72b58b3f1e4d
branches:  trunk
changeset: 1021465:72b58b3f1e4d
user:      rin <rin%NetBSD.org@localhost>
date:      Mon May 31 11:57:28 2021 +0000

description:
PR toolchain/55837

Fix logic error in copyFloatVectorRegister() for arm; copy s0-s31 or
d0-d31, not both.

diffstat:

 sys/lib/libunwind/Registers.hpp |  23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)

diffs (35 lines):

diff -r 0d4ea776aed1 -r 72b58b3f1e4d sys/lib/libunwind/Registers.hpp
--- a/sys/lib/libunwind/Registers.hpp   Mon May 31 11:54:01 2021 +0000
+++ b/sys/lib/libunwind/Registers.hpp   Mon May 31 11:57:28 2021 +0000
@@ -400,19 +400,20 @@
 #endif
       memcpy((uint8_t *)(fpreg + dnum) + part * sizeof(fpreg[0]) / 2,
         addr, sizeof(fpreg[0]) / 2);
-    }
-    if (num <= REGNO_ARM32_D15) {
-      if ((flags & FLAGS_VFPV2_USED) == 0) {
-        lazyVFPv2();
-        flags |= FLAGS_VFPV2_USED;
+    } else {
+      if (num <= REGNO_ARM32_D15) {
+        if ((flags & FLAGS_VFPV2_USED) == 0) {
+          lazyVFPv2();
+          flags |= FLAGS_VFPV2_USED;
+        }
+      } else {
+        if ((flags & FLAGS_VFPV3_USED) == 0) {
+          lazyVFPv3();
+          flags |= FLAGS_VFPV3_USED;
+        }
       }
-    } else {
-      if ((flags & FLAGS_VFPV3_USED) == 0) {
-        lazyVFPv3();
-        flags |= FLAGS_VFPV3_USED;
-      }
+      memcpy(fpreg + (num - REGNO_ARM32_D0), addr, sizeof(fpreg[0]));
     }
-    memcpy(fpreg + (num - REGNO_ARM32_D0), addr, sizeof(fpreg[0]));
   }
 
   __dso_hidden void lazyVFPv2();



Home | Main Index | Thread Index | Old Index