Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BETA] Mir-algorithm compiler segmentation failure #2729

Closed
9il opened this issue Jun 7, 2018 · 4 comments
Closed

[BETA] Mir-algorithm compiler segmentation failure #2729

9il opened this issue Jun 7, 2018 · 4 comments
Milestone

Comments

@9il
Copy link

9il commented Jun 7, 2018

Hi
LDC beta fails in MirAlgorithm's Travis https://travis-ci.org/libmir/mir-algorithm/jobs/389055282

@JohanEngelen JohanEngelen added this to the 1.10.0 milestone Jun 7, 2018
@kinke
Copy link
Member

kinke commented Jun 7, 2018

Thx for the report. Reduced, failing with ldc2 -c -mtriple=x86_64-linux-gnu:

struct ExtMulResult
{
    ulong low;
    ulong high;
}

ExtMulResult extMul(in ulong a, in ulong b) @nogc nothrow pure @safe
{
    import ldc.simd;
    auto r = inlineIR!(`
        %agg1 = insertvalue [2 x i64] undef, i64 %0, 0
        %agg2 = insertvalue [2 x i64] %agg1, i64 %1, 1
        ret [2 x i64] %agg2`, ulong[2])(a, b);

    return ExtMulResult(r[0], r[1]);
}

@kinke
Copy link
Member

kinke commented Jun 7, 2018

This apparently regressed (v1.9 works) because of a 2.080 Posix x86_64 ABI fix - ulong[2] is now returned in registers, not via sret.

kinke added a commit to kinke/ldc that referenced this issue Jun 7, 2018
@kinke
Copy link
Member

kinke commented Jun 7, 2018

[Btw, using return inlineIR!(..., ExtMulResult); directly would be nicer and work around it for the time being. That doesn't compile, sorry. ;)]

@kinke
Copy link
Member

kinke commented Jun 8, 2018

Fixed by #2732.

@kinke kinke closed this as completed Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants