Bug 12144 - maybe a float computing bug.
Summary: maybe a float computing bug.
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: unspecified
Hardware: Other Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-05-07 18:37 UTC by tangjfn
Modified: 2017-08-28 15:02 UTC (History)
2 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description tangjfn 2013-05-07 18:37:20 UTC
I have install mono-2.11.4 on a powerpc e300c3.

When I try to load an X509Certificate, I get an ArgumentOutOfRangeException at DateTime.cs in function AddMilliseconds.

When I replace the mscorlib.dll with that I have compiled under x86 linux, It works.

So, I am not sure it's a runtime bug or a compiler bug.

Maybe a bootstrap mcs bug.
Comment 1 tangjfn 2013-05-08 11:12:26 UTC
mscorlib.dll compiled use i386

.method public hidebysig instance valuetype System.DateTime 
        AddMilliseconds(float64 'value') cil managed
{
  // 代码大小       82 (0x52)
  .maxstack  2
  .locals init (int64 V_0)
  IL_0000:  ldarg.1
  IL_0001:  ldc.r8     10000.
  IL_000a:  mul
  IL_000b:  ldc.r8     9.2233720368547758e+018
  IL_0014:  bgt        IL_0032
  IL_0019:  ldarg.1
  IL_001a:  ldc.r8     10000.
  IL_0023:  mul
  IL_0024:  ldc.r8     -9.2233720368547758e+018
  IL_002d:  bge.un     IL_0038
  IL_0032:  newobj     instance void System.ArgumentOutOfRangeException::.ctor()
  IL_0037:  throw
  IL_0038:  ldarg.1
  IL_0039:  ldc.r8     10000.
  IL_0042:  mul
  IL_0043:  call       float64 System.Math::Round(float64)
  IL_0048:  conv.i8
  IL_0049:  stloc.0
  IL_004a:  ldarg.0
  IL_004b:  ldloc.0
  IL_004c:  call       instance valuetype System.DateTime System.DateTime::AddTicks(int64)
  IL_0051:  ret
} // end of method DateTime::AddMilliseconds
Comment 2 tangjfn 2013-05-08 11:13:24 UTC
mscorlib.dll compiled use powerpc e300c3

.method public hidebysig instance valuetype System.DateTime 
        AddMilliseconds(float64 'value') cil managed
{
  // 代码大小       82 (0x52)
  .maxstack  2
  .locals init (int64 V_0)
  IL_0000:  ldarg.1
  IL_0001:  ldc.r8     3600000.
  IL_000a:  mul
  IL_000b:  ldc.r8     3600000.
  IL_0014:  bgt        IL_0032
  IL_0019:  ldarg.1
  IL_001a:  ldc.r8     3600000.
  IL_0023:  mul
  IL_0024:  ldc.r8     3600000.
  IL_002d:  bge.un     IL_0038
  IL_0032:  newobj     instance void System.ArgumentOutOfRangeException::.ctor()
  IL_0037:  throw
  IL_0038:  ldarg.1
  IL_0039:  ldc.r8     3600000.
  IL_0042:  mul
  IL_0043:  call       float64 System.Math::Round(float64)
  IL_0048:  conv.i8
  IL_0049:  stloc.0
  IL_004a:  ldarg.0
  IL_004b:  ldloc.0
  IL_004c:  call       instance valuetype System.DateTime System.DateTime::AddTicks(int64)
  IL_0051:  ret
} // end of method DateTime::AddMilliseconds

Note You need to log in before you can comment on or make changes to this bug.