x64 JIT incorrectly optimizes "cond ? -0.0 : 0.0" to 0.0 constant - by Jeroen Frijters

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


2
0
Sign in
to vote
ID 276714 Comments
Status Closed Workarounds
Type Bug Repros 2
Opened 5/11/2007 1:00:36 AM
Access Restriction Public

Description

On x64 the following program incorrectly prints "Infinity" twice:

using System;

class Repro
{
	public static void Main(string[] args)
	{
		double v1 = args.Length == 0 ? -0.0 : 0.0;
		double v2 = args.Length != 0 ? -0.0 : 0.0;
		Console.WriteLine(1 / v1);
		Console.WriteLine(1 / v2);
	}
}
Sign in to post a comment.