D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 17399 - [REG2.071] core.checkedint.addu cannot inline function
Summary: [REG2.071] core.checkedint.addu cannot inline function
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 regression
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2017-05-15 19:21 UTC by thomas.bockman
Modified: 2017-08-07 13:16 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description thomas.bockman 2017-05-15 19:21:46 UTC
core.checkedint is broken with dmd master (2.075):

void main()
{
    import core.checkedint;
    size_t a, b;
    bool over;
    addu(a, b, over);
}

The above program fails to compile in release mode:

    Error: function core.checkedint.addu cannot inline function
Comment 1 Vladimir Panteleev 2017-05-16 06:08:16 UTC
(In reply to thomas.bockman from comment #0)
> The above program fails to compile in release mode:

(here "in release mode" means with -inline)
Comment 2 Vladimir Panteleev 2017-05-16 06:14:24 UTC
Introduced in https://github.com/dlang/dmd/pull/5292
Comment 3 Walter Bright 2017-05-19 18:13:50 UTC
Self-contained test case:
---
pragma(inline, true)
uint addu(uint x, uint y, ref bool overflow) {
    uint r = x + y;
    if (r < x || r < y)
        overflow = true;
    return r;
}

void foo() {
    size_t a, b;
    bool over;
    addu(a, b, over);
}
---
Comment 4 Walter Bright 2017-05-19 19:00:38 UTC
https://github.com/dlang/dmd/pull/6815
Comment 5 safety0ff.bugz 2017-05-23 20:37:01 UTC
Possible duplicate: #16350
Comment 6 github-bugzilla 2017-06-08 18:09:40 UTC
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/8ff0a0a185e0a7d0c04812cf916fbbe6615f792c
fix Issue 17399 - core.checkedint.addu cannot inline function

https://github.com/dlang/dmd/commit/c18a27f5a11912695f0b7a74177bde149427496b
Merge pull request #6815 from WalterBright/fix17399

fix Issue 17399 - core.checkedint.addu cannot inline function
merged-on-behalf-of: unknown
Comment 7 github-bugzilla 2017-08-07 13:16:33 UTC
Commits pushed to newCTFE at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/8ff0a0a185e0a7d0c04812cf916fbbe6615f792c
fix Issue 17399 - core.checkedint.addu cannot inline function

https://github.com/dlang/dmd/commit/c18a27f5a11912695f0b7a74177bde149427496b
Merge pull request #6815 from WalterBright/fix17399