Issue 12900 - REG 2.065: Wrong code in IfStatement condition Expression
Summary: REG 2.065: Wrong code in IfStatement condition Expression
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: Iain Buclaw
URL:
Keywords: wrong-code
Depends on: 8913
Blocks: 7175
  Show dependency treegraph
 
Reported: 2014-06-12 17:10 UTC by Iain Buclaw
Modified: 2014-06-25 20:53 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Iain Buclaw 2014-06-12 17:10:10 UTC
This was fixed once back in 2.062, and now it's back again in 2.065!

See:
https://issues.dlang.org/show_bug.cgi?id=8913
http://bugzilla.gdcproject.org/show_bug.cgi?id=24

This is blocking MinGW port for GDC 2.065 merge.
Comment 1 Iain Buclaw 2014-06-12 17:27:04 UTC
PR that fixed 8913:
https://github.com/D-Programming-Language/dmd/pull/1382

PR that reverted changed and re-introduced this problem:
https://github.com/D-Programming-Language/dmd/pull/2888


Now it's interesting that 7175 was raised before 8913 and the fix that went into 8913.  Oh well, I'll set this as a blocks anyhow.
Comment 2 Iain Buclaw 2014-06-12 17:31:58 UTC
Infact, regardless of whether or not this blocks mingw builds, it is reproducible on all targets.  This is a *serious* bug.
Comment 3 yebblies 2014-06-13 02:29:41 UTC
If it doesn't have a test case or assert in dmd it's probably not going to stay fixed.
Comment 4 Iain Buclaw 2014-06-13 07:25:26 UTC
If there's a way to distinguish between different kinds of type in dmd's backend, you could throw in some tree checking.

Such as:
Assignments, left and right types are compatible.
Comparisons, left and right types are compatible.
Returns, return value type and function return type are compatible.
Conditions, condition is a scalar type.

Of course, you don't need this sort of checking in dmd release builds. :)
Comment 6 Iain Buclaw 2014-06-13 09:49:36 UTC
This is also blocking the next binary release of gdc.
Comment 7 Iain Buclaw 2014-06-13 09:50:33 UTC
(In reply to yebblies from comment #3)
> If it doesn't have a test case or assert in dmd it's probably not going to
> stay fixed.

It's going in the gdc testsuite. :)
Comment 9 github-bugzilla 2014-06-25 20:53:52 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/6dd50d5c296dea9b565a5f2754c249d4f6db5141
fix Issue 12900 - Wrong code in IfStatement condition Expression

https://github.com/D-Programming-Language/dmd/commit/d664daebede34c6bf913af43f26c1d9673203414
Merge pull request #3685 from 9rnsr/fix12900

More conservative fix for issue 12900 - Wrong code in IfStatement condition Expression