-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixes #22286; enforce Non-var T destructors by nimPreviewNonVarDestructor
#22975
Conversation
nimPreviewNonVarDestructor
Ops, forgot to add test cases, will push them tomorrow |
The failure of tests/arc/thard_alignment.nim seems to be quite nasty... I'm debugging it on my local branch. |
It seems that my change may not be the culprit of the failure of This is a reduced case: {.passC: "-march=native".}
proc isAlignedCheck(p: pointer, alignment: int) =
doAssert (cast[uint](p) and uint(alignment - 1)) == 0
proc isAlignedCheck[T](p: ref T, alignment: int) =
isAlignedCheck(cast[pointer](p), alignment)
type
m256d {.importc: "__m256d", header: "immintrin.h".} = object
proc set1(x: float): m256d {.importc: "_mm256_set1_pd", header: "immintrin.h".}
func `+`(a,b: m256d): m256d {.importc: "_mm256_add_pd", header: "immintrin.h".}
proc toString(a: m256d): string = discard
var xx = new(m256d)
xx[] = set1(10)
isAlignedCheck(xx, alignOf(m256d))
echo toString(xx[]) When defining a non-var function for So It could cause problems for the non-var destructor that is lifted for |
As https://discord.com/channels/371759389889003530/768367394547957761/1177513506610880542 said, the varness change of destructors might affect alignments with |
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Thanks for your hard work on this PR! Hint: mm: orc; opt: speed; options: -d:release |
…uctor` (#22975) fixes #22286 ref https://forum.nim-lang.org/t/10642 For backwards compatibilities, we might need to keep the changes under a preview compiler flag. Let's see how many packags it break. **TODO** in the following PRs - [ ] Turn the `var T` destructors warning into an error with `nimPreviewNonVarDestructor` --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de> (cherry picked from commit 379299a)
…uctor` (#22975) fixes #22286 ref https://forum.nim-lang.org/t/10642 For backwards compatibilities, we might need to keep the changes under a preview compiler flag. Let's see how many packags it break. **TODO** in the following PRs - [ ] Turn the `var T` destructors warning into an error with `nimPreviewNonVarDestructor` --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de> (cherry picked from commit 379299a)
…uctor` (#22975) fixes #22286 ref https://forum.nim-lang.org/t/10642 For backwards compatibilities, we might need to keep the changes under a preview compiler flag. Let's see how many packags it break. **TODO** in the following PRs - [ ] Turn the `var T` destructors warning into an error with `nimPreviewNonVarDestructor` --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de> (cherry picked from commit 379299a)
…uctor` (#22975) fixes #22286 ref https://forum.nim-lang.org/t/10642 For backwards compatibilities, we might need to keep the changes under a preview compiler flag. Let's see how many packags it break. **TODO** in the following PRs - [ ] Turn the `var T` destructors warning into an error with `nimPreviewNonVarDestructor` --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de> (cherry picked from commit 379299a)
fixes #22286
ref https://forum.nim-lang.org/t/10642
For backwards compatibilities, we might need to keep the changes under a preview compiler flag. Let's see how many packags it break.
TODO in the following PRs
var T
destructors warning into an error withnimPreviewNonVarDestructor