digitalmars.D.learn - DMD CTFE Bug?
- David (19/19) Aug 17 2012 I have this code: http://dpaste.dzfl.pl/dbe2a07f
- Dmitry Olshansky (5/24) Aug 17 2012 It's not thousands of lines either. But where does Vertex type comes fro...
- David (16/43) Aug 17 2012 struct Vertex {
- Dmitry Olshansky (6/52) Aug 17 2012 Well then I think all you have to do is to put together the complete
I have this code: http://dpaste.dzfl.pl/dbe2a07f It works perfectly fine, except for `t!(2, 10)` and `t!(1, 10)`: // Expected: [Vertex(-0.5, 0.5, 0.5, 0, 1, 0, 2, 10, 2, 10, 0, 0), Vertex(0.5, 0.5, 0.5, 0, 1, 0, 3, 10, 3, 10, 0, 0), Vertex(0.5, 0.5, -0.5, 0, 1, 0, 3, 9, 3, 9, 0, 0), Vertex(-0.5, 0.5, 0.5, 0, 1, 0, 2, 10, 2, 10, 0, 0), Vertex(0.5, 0.5, -0.5, 0, 1, 0, 3, 9, 3, 9, 0, 0), Vertex(-0.5, 0.5, -0.5, 0, 1, 0, 2, 9, 2, 9, 0, 0)] // Actual result: [Vertex(-0.5, 0.5, 0.5, 0, 1, 0, 2, 10, 2, 10, 0, 0), Vertex(0.5, 0.5, 0.5, 0, 1, 0, 3, 10, 3, 10, 0, 0), Vertex(0.5, -0.5, 0.5, 0, -1, 0, 6, 3, 6, 3, 0, 0), Vertex(-0.5, 0.5, 0.5, 0, 1, 0, 2, 10, 2, 10, 0, 0), Vertex(0.5, 0.5, -0.5, 0, 1, 0, 3, 9, 3, 9, 0, 0), Vertex(-0.5, 0.5, -0.5, 0, 1, 0, 2, 9, 2, 9, 0, 0)] If I change `enum` in line 117 to `auto` it produces the expected result. Any ideas why this happens? (Btw. I wasn't able produce a smaller testcase)
Aug 17 2012
On 17-Aug-12 20:27, David wrote:I have this code: http://dpaste.dzfl.pl/dbe2a07f It works perfectly fine, except for `t!(2, 10)` and `t!(1, 10)`: // Expected: [Vertex(-0.5, 0.5, 0.5, 0, 1, 0, 2, 10, 2, 10, 0, 0), Vertex(0.5, 0.5, 0.5, 0, 1, 0, 3, 10, 3, 10, 0, 0), Vertex(0.5, 0.5, -0.5, 0, 1, 0, 3, 9, 3, 9, 0, 0), Vertex(-0.5, 0.5, 0.5, 0, 1, 0, 2, 10, 2, 10, 0, 0), Vertex(0.5, 0.5, -0.5, 0, 1, 0, 3, 9, 3, 9, 0, 0), Vertex(-0.5, 0.5, -0.5, 0, 1, 0, 2, 9, 2, 9, 0, 0)] // Actual result: [Vertex(-0.5, 0.5, 0.5, 0, 1, 0, 2, 10, 2, 10, 0, 0), Vertex(0.5, 0.5, 0.5, 0, 1, 0, 3, 10, 3, 10, 0, 0), Vertex(0.5, -0.5, 0.5, 0, -1, 0, 6, 3, 6, 3, 0, 0), Vertex(-0.5, 0.5, 0.5, 0, 1, 0, 2, 10, 2, 10, 0, 0), Vertex(0.5, 0.5, -0.5, 0, 1, 0, 3, 9, 3, 9, 0, 0), Vertex(-0.5, 0.5, -0.5, 0, 1, 0, 2, 9, 2, 9, 0, 0)] If I change `enum` in line 117 to `auto` it produces the expected result. Any ideas why this happens?Bug. There is no excuse for compiler to get different result during CTFE.(Btw. I wasn't able produce a smaller testcase)It's not thousands of lines either. But where does Vertex type comes from? -- Olshansky Dmitry
Aug 17 2012
Am 17.08.2012 18:36, schrieb Dmitry Olshansky:On 17-Aug-12 20:27, David wrote:Great ...I have this code: http://dpaste.dzfl.pl/dbe2a07f It works perfectly fine, except for `t!(2, 10)` and `t!(1, 10)`: // Expected: [Vertex(-0.5, 0.5, 0.5, 0, 1, 0, 2, 10, 2, 10, 0, 0), Vertex(0.5, 0.5, 0.5, 0, 1, 0, 3, 10, 3, 10, 0, 0), Vertex(0.5, 0.5, -0.5, 0, 1, 0, 3, 9, 3, 9, 0, 0), Vertex(-0.5, 0.5, 0.5, 0, 1, 0, 2, 10, 2, 10, 0, 0), Vertex(0.5, 0.5, -0.5, 0, 1, 0, 3, 9, 3, 9, 0, 0), Vertex(-0.5, 0.5, -0.5, 0, 1, 0, 2, 9, 2, 9, 0, 0)] // Actual result: [Vertex(-0.5, 0.5, 0.5, 0, 1, 0, 2, 10, 2, 10, 0, 0), Vertex(0.5, 0.5, 0.5, 0, 1, 0, 3, 10, 3, 10, 0, 0), Vertex(0.5, -0.5, 0.5, 0, -1, 0, 6, 3, 6, 3, 0, 0), Vertex(-0.5, 0.5, 0.5, 0, 1, 0, 2, 10, 2, 10, 0, 0), Vertex(0.5, 0.5, -0.5, 0, 1, 0, 3, 9, 3, 9, 0, 0), Vertex(-0.5, 0.5, -0.5, 0, 1, 0, 2, 9, 2, 9, 0, 0)] If I change `enum` in line 117 to `auto` it produces the expected result. Any ideas why this happens?Bug. There is no excuse for compiler to get different result during CTFE.struct Vertex { float x; float y; float z; float nx; float ny; float nz; byte u_terrain; byte v_terrain; byte u_mask; byte v_mask; float u_biome; float v_biome; }(Btw. I wasn't able produce a smaller testcase)It's not thousands of lines either. But where does Vertex type comes from?
Aug 17 2012
On 17-Aug-12 20:40, David wrote:Am 17.08.2012 18:36, schrieb Dmitry Olshansky:Well then I think all you have to do is to put together the complete sample and file it as CTFE bug here: http://d.puremagic.com/issues/ -- Olshansky DmitryOn 17-Aug-12 20:27, David wrote:Great ...I have this code: http://dpaste.dzfl.pl/dbe2a07f It works perfectly fine, except for `t!(2, 10)` and `t!(1, 10)`: // Expected: [Vertex(-0.5, 0.5, 0.5, 0, 1, 0, 2, 10, 2, 10, 0, 0), Vertex(0.5, 0.5, 0.5, 0, 1, 0, 3, 10, 3, 10, 0, 0), Vertex(0.5, 0.5, -0.5, 0, 1, 0, 3, 9, 3, 9, 0, 0), Vertex(-0.5, 0.5, 0.5, 0, 1, 0, 2, 10, 2, 10, 0, 0), Vertex(0.5, 0.5, -0.5, 0, 1, 0, 3, 9, 3, 9, 0, 0), Vertex(-0.5, 0.5, -0.5, 0, 1, 0, 2, 9, 2, 9, 0, 0)] // Actual result: [Vertex(-0.5, 0.5, 0.5, 0, 1, 0, 2, 10, 2, 10, 0, 0), Vertex(0.5, 0.5, 0.5, 0, 1, 0, 3, 10, 3, 10, 0, 0), Vertex(0.5, -0.5, 0.5, 0, -1, 0, 6, 3, 6, 3, 0, 0), Vertex(-0.5, 0.5, 0.5, 0, 1, 0, 2, 10, 2, 10, 0, 0), Vertex(0.5, 0.5, -0.5, 0, 1, 0, 3, 9, 3, 9, 0, 0), Vertex(-0.5, 0.5, -0.5, 0, 1, 0, 2, 9, 2, 9, 0, 0)] If I change `enum` in line 117 to `auto` it produces the expected result. Any ideas why this happens?Bug. There is no excuse for compiler to get different result during CTFE.struct Vertex { float x; float y; float z; float nx; float ny; float nz; byte u_terrain; byte v_terrain; byte u_mask; byte v_mask; float u_biome; float v_biome; }(Btw. I wasn't able produce a smaller testcase)It's not thousands of lines either. But where does Vertex type comes from?
Aug 17 2012