[Issue 16381] Wrapping a float4 array leads to segfault.
https://issues.dlang.org/show_bug.cgi?id=16381 Basile-z changed: What|Removed |Added CC|b2.t...@gmx.com | --
[Issue 16381] Wrapping a float4 array leads to segfault.
https://issues.dlang.org/show_bug.cgi?id=16381 --- Comment #12 from github-bugzi...@puremagic.com --- Commits pushed to newCTFE at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/1429da40f6bd24c702eb4a5c0685faa0addfcb39 fix Issue 16381 - Wrapping a float4 array leads to segfault https://github.com/dlang/dmd/commit/2210757dfdcf637022cec835dbbc6cbb5deca73d Merge pull request #6268 from WalterBright/fix16381 --
[Issue 16381] Wrapping a float4 array leads to segfault.
https://issues.dlang.org/show_bug.cgi?id=16381 --- Comment #11 from github-bugzi...@puremagic.com --- Commits pushed to scope at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/1429da40f6bd24c702eb4a5c0685faa0addfcb39 fix Issue 16381 - Wrapping a float4 array leads to segfault https://github.com/dlang/dmd/commit/2210757dfdcf637022cec835dbbc6cbb5deca73d Merge pull request #6268 from WalterBright/fix16381 --
[Issue 16381] Wrapping a float4 array leads to segfault.
https://issues.dlang.org/show_bug.cgi?id=16381 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --
[Issue 16381] Wrapping a float4 array leads to segfault.
https://issues.dlang.org/show_bug.cgi?id=16381 --- Comment #10 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/1429da40f6bd24c702eb4a5c0685faa0addfcb39 fix Issue 16381 - Wrapping a float4 array leads to segfault https://github.com/dlang/dmd/commit/2210757dfdcf637022cec835dbbc6cbb5deca73d Merge pull request #6268 from WalterBright/fix16381 fix Issue 16381 - Wrapping a float4 array leads to segfault --
[Issue 16381] Wrapping a float4 array leads to segfault.
https://issues.dlang.org/show_bug.cgi?id=16381 --- Comment #9 from Walter Bright--- https://github.com/dlang/dmd/pull/6268 --
[Issue 16381] Wrapping a float4 array leads to segfault.
https://issues.dlang.org/show_bug.cgi?id=16381 --- Comment #8 from Walter Bright--- Simpler test case: __vector(float[4]) foo(); void bar() { float g = foo().ptr[0]; } --
[Issue 16381] Wrapping a float4 array leads to segfault.
https://issues.dlang.org/show_bug.cgi?id=16381 Walter Brightchanged: What|Removed |Added Keywords||SIMD CC||bugzi...@digitalmars.com --
[Issue 16381] Wrapping a float4 array leads to segfault.
https://issues.dlang.org/show_bug.cgi?id=16381 --- Comment #7 from b2.t...@gmx.com --- (In reply to b2.temp from comment #6) > (In reply to Bartek Siudeja from comment #5) > > does not help. So this seems about the return value of a function. > > Yes that's also what I said: return value == copy because float[4] doesn't > fit in a CPU register. when ref is used it's actually the address of the > first float that's returned. > > Anyway it's clearly a front-end error, because even LDC returns a run-time > error: > > > Invalid bitcast > > %63 = bitcast [4 x float] %62 to float > > LLVM ERROR: Broken function found, compilation aborted! "compile-time error" is what I really meant... --
[Issue 16381] Wrapping a float4 array leads to segfault.
https://issues.dlang.org/show_bug.cgi?id=16381 --- Comment #6 from b2.t...@gmx.com --- (In reply to Bartek Siudeja from comment #5) > does not help. So this seems about the return value of a function. Yes that's also what I said: return value == copy because float[4] doesn't fit in a CPU register. when ref is used it's actually the address of the first float that's returned. Anyway it's clearly a front-end error, because even LDC returns a run-time error: > Invalid bitcast > %63 = bitcast [4 x float] %62 to float > LLVM ERROR: Broken function found, compilation aborted! --
[Issue 16381] Wrapping a float4 array leads to segfault.
https://issues.dlang.org/show_bug.cgi?id=16381 ag0ae...@gmail.com changed: What|Removed |Added Keywords||ice CC||ag0ae...@gmail.com --
[Issue 16381] Wrapping a float4 array leads to segfault.
https://issues.dlang.org/show_bug.cgi?id=16381 --- Comment #5 from Bartek Siudeja--- If you do know a workaround I could use, I would be really grateful. Was checking some other options. Even changing opIndex into something like: float4 test(size_t idx) { float4 temp = arr[idx]; return temp; } does not help. So this seems about the return value of a function. --
[Issue 16381] Wrapping a float4 array leads to segfault.
https://issues.dlang.org/show_bug.cgi?id=16381 --- Comment #4 from b2.t...@gmx.com --- (In reply to Bartek Siudeja from comment #3) > True, but: > > My wrapper is a superclass of an abstract storage class, and not all > implementations can return a reference to float4. Another superclass looks > more or less like std.container.Array!bool, so the common interface/base > class can't use ref. I don't suggest you do to do like this. I've added the extra info for the person who'll fix it. The information added by "it works with ref" is that the copy is not valid since any access to ".ptr" leads to an AV. --
[Issue 16381] Wrapping a float4 array leads to segfault.
https://issues.dlang.org/show_bug.cgi?id=16381 --- Comment #3 from Bartek Siudeja--- True, but: My wrapper is a superclass of an abstract storage class, and not all implementations can return a reference to float4. Another superclass looks more or less like std.container.Array!bool, so the common interface/base class can't use ref. --
[Issue 16381] Wrapping a float4 array leads to segfault.
https://issues.dlang.org/show_bug.cgi?id=16381 b2.t...@gmx.com changed: What|Removed |Added Hardware|x86 |All OS|Mac OS X|All --
[Issue 16381] Wrapping a float4 array leads to segfault.
https://issues.dlang.org/show_bug.cgi?id=16381 b2.t...@gmx.com changed: What|Removed |Added CC||b2.t...@gmx.com --- Comment #2 from b2.t...@gmx.com --- If the opIndex header is changed to ref float4 opIndex(size_t idx) then no segfault. --
[Issue 16381] Wrapping a float4 array leads to segfault.
https://issues.dlang.org/show_bug.cgi?id=16381 Bartek Siudejachanged: What|Removed |Added Severity|enhancement |major --
[Issue 16381] Wrapping a float4 array leads to segfault.
https://issues.dlang.org/show_bug.cgi?id=16381 --- Comment #1 from Bartek Siudeja--- dmd: 2.068, 2.069 and 2.071 --