D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 13251 - std.array.split gives different results with specific compiler flags
Summary: std.array.split gives different results with specific compiler flags
Status: RESOLVED DUPLICATE of issue 13237
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Windows
: P1 regression
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-03 21:59 UTC by Ola Østtveit
Modified: 2014-08-06 08:06 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 Ola Østtveit 2014-08-03 21:59:54 UTC
Using dmd 2.066.0-rc1

Test with the following code:
-- splittest.d --
import std.stdio : writeln;
import std.array : split;

void main()
{
  writeln("one,two,three".split(","));
}
 -- splittest.d --

Compiled with 'rdmd splittest.d' outputs ["one", "two", "three"] as expected.
Compiled with 'rdmd -inline -O splittest.d' outputs ["one,two,three"], an array with one element instead of three.

It is the combination of the -inline and -O flags that causes the issue, on their own it works.

Works fine in dmd 2.065.
Comment 1 Peter Alexander 2014-08-03 22:59:46 UTC
Confirmed on OS X. Increasing status to regression.
Comment 2 Vladimir Panteleev 2014-08-04 11:44:34 UTC
Introduced by same pull request as issue 13237, looks like a duplicate.
Comment 3 sinkuupump 2014-08-06 08:06:28 UTC

*** This issue has been marked as a duplicate of issue 13237 ***