July 31, 2013
On 31 Jul 2013, at 22:53, bearophile wrote:
> I think I have found another small bug:

Again, please consider creating a GitHub account and reporting this and any other issues on our bug tracker. It literally takes just one minute, and your excellent reports are only in danger of being overlooked here.

Thanks,
David
August 05, 2013
Recently I have added to bug reports to LLVM (from D code compiled with ldc2), I am not fully sure they are caused by the back-end:

http://llvm.org/bugs/show_bug.cgi?id=16723
http://llvm.org/bugs/show_bug.cgi?id=16726

So far I have received no answers, I don't know why. LLVM people used to answer me quickly :-)

Bye,
bearophile
August 06, 2013
If I compile this little program:

void main() {
    align(4) double[1600] a;
    align(8) double[1600] b;
    align(16) double[1600] c;
}


With:

ldmd2 -output-ll test.d


I see no warnings nor errors, and the main is:


define i32 @_Dmain({ i32, { i32, i8* }* } %unnamed) {
entry:
  %a = alloca [1600 x double], align 8
  %arrayinit.itr = alloca i32, align 4
  %b = alloca [1600 x double], align 8
  %arrayinit.itr8 = alloca i32, align 4
  %c = alloca [1600 x double], align 8
  %arrayinit.itr19 = alloca i32, align 4
  %tmp = getelementptr [1600 x double]* %a, i32 0, i32 0
  store i32 0, i32* %arrayinit.itr
  br label %arrayinit.cond


So it silently ignores the align(). Is this a bug?

Bye,
bearophile
August 06, 2013
import core.simd;
float bar1(float4 data) pure nothrow {
    return data.array[0];
}
struct Foo {
    float4 data;
    alias data this;
}
float bar2(Foo data) pure nothrow {
    return data.array[0];
}
void main() {
    float4 f = [1.5, 2.5, 3.5, 4.5];
    bar1(f);
    bar2(Foo(f));
}


Produces this asm for the bar1 and bar2 functions:

__D4test4bar1FNaNbNhG4fZf:
    pushl   %eax
    vmovss  %xmm0, (%esp)
    flds    (%esp)
    popl    %eax
    ret

__D4test4bar2FNaNbS4test3FooZf:
    pushl   %ebp
    movl    %esp, %ebp
    andl    $-16, %esp
    subl    $16, %esp
    flds    8(%ebp)
    movl    %ebp, %esp
    popl    %ebp
    ret $16

Is that good enough?

Bye,
bearophile
August 07, 2013
On Monday, 5 August 2013 at 21:06:51 UTC, bearophile wrote:
> http://llvm.org/bugs/show_bug.cgi?id=16723
> http://llvm.org/bugs/show_bug.cgi?id=16726
>
> So far I have received no answers, I don't know why. LLVM people used to answer me quickly :-)

Well, you can send them patches :)
August 10, 2013
On 5 Aug 2013, at 23:06, bearophile wrote:
> http://llvm.org/bugs/show_bug.cgi?id=16723
> http://llvm.org/bugs/show_bug.cgi?id=16726
>
> So far I have received no answers, I don't know why. LLVM people used to answer me quickly :-)

When reporting codegen problems (other than for Clang) to the LLVM bug tracker, you should post LLVM IR instead of/in addition to the source language code. Otherwise, it is very cumbersome for the LLVM optimizer devs to even just have a first look at the issue, at least if they don't happen to have an LDC installation lying around.

David
August 10, 2013
David Nadlinger:

> When reporting codegen problems (other than for Clang) to the LLVM bug tracker, you should post LLVM IR instead of/in addition to the source language code. Otherwise, it is very cumbersome for the LLVM optimizer devs to even just have a first look at the issue, at least if they don't happen to have an LDC installation lying around.

OK, I will add the IR.

Bye,
bearophile
September 15, 2013
On Wednesday, 31 July 2013 at 20:53:14 UTC, bearophile wrote:
> But if I compile that program with those switches, it should turn the assert(0) into a HALT instruction, that I think has nothing to do with runtime calls.

Yep: https://github.com/ldc-developers/ldc/pull/475

The MinGW floating point related issues you reported are fixed in Git master as well.

David
September 16, 2013
David Nadlinger:

> The MinGW floating point related issues you reported are fixed in Git master as well.

Good, this encourages me to look for more problems.

If I compile this:


import std.bigint: BigInt;
void main() {
    BigInt(1) + 1;
}


With:
ldmd2 -O -release test.d

Using the LDC 0.11.0 I receive many errors like:

test.obj:fake:(.text$_D3std8internal4math11biguintcore7BigUint19__T11addOrSubIntTmZ11addOrSubIntFxS3std8internal4math11biguintcor...


I compile DMD more than once every week, but I don't look forward to compiling LDC2 by myself on Windows. So I'd like LDC2 to release pre-compiled binaries for Windows once in a while, like once every month.

Bye,
bearophile
October 03, 2013
I don't remember if the round() function was already fixed:


import std.stdio: writeln;
import std.math: round;
void main() {
    writeln(round(1.5));
}



I have also found a little performance bug, take a look at the timings below the second version of this Rosettacode task:

http://rosettacode.org/wiki/Zebra_puzzle#Alternative_Version

Bye,
bearophile
Next ›   Last »
1 2 3