[Issue 17197] Link failure with -m64 on Windows

2017-03-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17197

--- Comment #2 from Rainer Schuetze  ---
-msmode now passed for links with the MS Linker by
https://github.com/dlang/visuald/releases/tag/v0.44-rc2

--


[Issue 17210] DMD's Failure to Inline Calls in std.array.Appender.put Cause 3x Slowdown

2017-03-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17210

--- Comment #2 from Jack Stouffer  ---
BTW, making this @safe by changing the manual code to

static if (isBasicType!U)
{
auto d = (() @trusted => _data.arr.ptr[0 .. len + 1])();
d[len] = cast(Unqual!T) item;
_data.arr = d;
}

makes the code twice as slow as the other manual version

--


[Issue 17242] Specialized templates defined inside functions fail lookup, moving them outside makes them work

2017-03-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17242

Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com

--- Comment #1 from Walter Bright  ---
It also is the case with nested functions:

  int foo(int i)
  {
int bar(int a) { return a; }
int bar(uint b) { return b; }
return bar(i);
  }

Name lookup is different inside functions. Overloading function definitions is
not allowed, neither are forward references:

  int foo(int i)
  {
return bar(i);
int bar(int a) { return a; }
  }

--


[Issue 17242] New: Specialized templates defined inside functions fail lookup, moving them outside makes them work

2017-03-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17242

  Issue ID: 17242
   Summary: Specialized templates defined inside functions fail
lookup, moving them outside makes them work
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: and...@erdani.com

This code causes a compilation error:

void main ()
{
template Floating1(T)
if (is(T == cfloat) || is(T == cdouble) || is(T == creal))
{
}

template Floating1(T)
if (is(T == float) || is(T == double) || is(T == real))
{
}
}

Error: declaration Floating1(T) if (is(T == float) || is(T == double) || is(T
== real)) is already defined

Obviously moving the two templates to top level works. This is a violation of
the "turtles all the way down" principle.

--


[Issue 5323] std.math: struct FloatingPointControl, duplicate code and assumes X86

2017-03-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5323

Guillaume Chatelet  changed:

   What|Removed |Added

 CC||chatelet.guilla...@gmail.co
   ||m

--- Comment #5 from Guillaume Chatelet  ---
It seems to me that setting rounding mode and testing for inexact does not work
correctly on x86_64.

Correct code using the C bindings:
void main() {
import core.stdc.fenv;
fesetround(FE_UPWARD);
float x = 1.0f;
x += float.min_normal;
writefln("%.32g, inexact: %s", x, fetestexcept(FE_INEXACT) > 0);
}

> Output: 1.0011920928955078125, inexact: true

The same code using FloatingPointControl and IeeeFlags does not work at all
(neither set round nor test except)
void main() {
resetIeeeFlags();
FloatingPointControl fpctrl;
fpctrl.rounding = FloatingPointControl.roundUp;
float x = 1.0f;
x += float.min_normal;
writefln("%.32g, inexact: %s", x, ieeeFlags.inexact);
}

> Output: 1, inexact: false

Linked discussion:
http://forum.dlang.org/post/qybweycrifqgtcsse...@forum.dlang.org

--