[llvm-branch-commits] [compiler-rt-branch] r245110 - Merging r243384:

Daniel Sanders via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Aug 14 15:33:07 PDT 2015


Author: dsanders
Date: Fri Aug 14 17:33:06 2015
New Revision: 245110

URL: http://llvm.org/viewvc/llvm-project?rev=245110&view=rev
Log:
Merging r243384:
------------------------------------------------------------------------
r243384 | slthakur | 2015-07-28 06:51:51 +0100 (Tue, 28 Jul 2015) | 9 lines

[UBSan][MIPS] Fix cast-overflow tests for mips big endian

This fixes the bug https://llvm.org/bugs/show_bug.cgi?id=24152
The float value resides in the first 4 bytes of ValueHandle for both mips and mipsel.

Reviewers: dsanders, samsonov
Subscibers: rsmith, hans, mohit.bhakkad, jaydeep, llvm-commits
Differential: http://reviews.llvm.org/D11448

------------------------------------------------------------------------

Modified:
    compiler-rt/branches/release_37/   (props changed)
    compiler-rt/branches/release_37/lib/ubsan/ubsan_value.cc

Propchange: compiler-rt/branches/release_37/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 14 17:33:06 2015
@@ -1 +1 @@
-/compiler-rt/trunk:242350,242424,242444,242449,242539-242540,242647,242651,243170,243604,243615,243686,244002
+/compiler-rt/trunk:242350,242424,242444,242449,242539-242540,242647,242651,243170,243384,243604,243615,243686,244002

Modified: compiler-rt/branches/release_37/lib/ubsan/ubsan_value.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_37/lib/ubsan/ubsan_value.cc?rev=245110&r1=245109&r2=245110&view=diff
==============================================================================
--- compiler-rt/branches/release_37/lib/ubsan/ubsan_value.cc (original)
+++ compiler-rt/branches/release_37/lib/ubsan/ubsan_value.cc Fri Aug 14 17:33:06 2015
@@ -83,10 +83,11 @@ FloatMax Value::getFloatValue() const {
 #endif
       case 32: {
         float Value;
-#if defined(__BIG_ENDIAN__)
-       // For big endian the float value is in the second 4 bytes
-       //  instead of the first 4 bytes.
-       internal_memcpy(&Value, ((const char*)&Val)+4, 4);
+#if defined(__BIG_ENDIAN__) && !defined(__mips__)
+       // For big endian the float value is in the highest addressed 4 bytes
+       // (the least significant bits) but we must also consider that we might
+       // have a 32-bit type.
+       internal_memcpy(&Value, ((const char*)&Val + 1) - 4, 4);
 #else 
        internal_memcpy(&Value, &Val, 4);
 #endif




More information about the llvm-branch-commits mailing list