Bug 15207 – [REG2.069.0-b1] Wrong codegen with -inline
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-10-15T15:47:00Z
Last change time
2015-10-23T01:56:49Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
aliloko
Comments
Comment #0 by aliloko — 2015-10-15T15:47:41Z
Compiler: v2.069.0-b2, x86 arch
To reproduce: compile with dmd -inline main.d
This bug disappear when -inline is removed.
---------------------------------------------->8------------
struct vec3f
{
float x, y, z;
this(float x_, float y_, float z_)
{
x = x_;
y = y_;
z = z_;
}
vec3f clone()
{
vec3f res = this;
return res;
}
}
class AnnoyingRegression
{
vec3f a;
this()
{
a = vec3f(1, 2, 3).clone;
// Writes nan nan nan if -inline switch
// Writes 1 2 3 if no -inline switch
import std.stdio;
writefln("%s %s %s", a.x, a.y, a.z);
}
}
void main(string[]args)
{
new AnnoyingRegression();
}
---------------------------------------------->8------------
Comment #1 by dlang-bugzilla — 2015-10-16T13:55:16Z