Re: Reason for -fno-strict-aliasing?

2017-08-26 Thread cblake
I did a little searching and compiling and I'd have to say Jehan is right here about "absence of evidence". See, [this stackoverflow thread](https://stackoverflow.com/questions/21214875/gcc-accuracy-of-strict-aliasing-warnings) for a very simple example to people that is (still in 2017) too

Re: Reason for -fno-strict-aliasing?

2017-08-25 Thread Jehan
> Also, in my opinion, violating the strict aliasing rule is a code smell, and > so I think we should avoid accommodating bad code with the > "-fno-strict-aliasing" flag. All the major OS kernels (Linux, FreeBSD, and OpenBSD) have strict aliasing disabled, and for good reasons. So do a

Re: Reason for -fno-strict-aliasing?

2017-08-25 Thread cblake
@Tiberium, in the `csources/build.sh` context you should only need to remove the `-w` and change the `-fno-strict-aliasing` in `COMP_FLAGS` since it's just a shell script with a zillion gcc invocations. Compiling other nim code, I only had to change my nim.cfg's `gcc.options.always = "-Wall

Re: Reason for -fno-strict-aliasing?

2017-08-25 Thread Tiberium
I've even changed -fno-strict-aliasing to "-fstrict-aliasing -Wstrict-aliasing" in build.sh (in csources), and nim compiler compiled without any issues!

Re: Reason for -fno-strict-aliasing?

2017-08-25 Thread cblake
This may be obvious, but has anyone else tried changing `-fno-strict-aliasing` to `-fstrict-aliasing -Wstrict-aliasing` in their `nim.cfg` and seeing if any gcc warnings arise? When I try this on Linux with gcc-6.3 and gcc-7.2 and devel nim I don't see any warnings at all. You may also need to

Re: Reason for -fno-strict-aliasing?

2017-08-25 Thread pwernersbach
Also, in my opinion, violating the strict aliasing rule is a code smell, and so I think we should avoid accommodating bad code with the "-fno-strict-aliasing" flag.

Re: Reason for -fno-strict-aliasing?

2017-08-24 Thread Araq
Well the C standard solution nowadays is that the cast must go through a union type and the code generator already can do that. PRs are welcome.

Re: Reason for -fno-strict-aliasing?

2017-08-24 Thread cdome
Actually, I just have found this thread [https://forum.nim-lang.org/t/2921](https://forum.nim-lang.org/t/2921) Araq, I think what you can do for casts to comply with strict aliasing rules is: (target_type *)(void *) instead_of (target_type *) Would you accept such pull

Reason for -fno-strict-aliasing?

2017-08-24 Thread cdome
I have question which is likely addressed to Araq. I have spent a couple of days investigating the reason why my Nim code is somewhat slower than similar C implementation. I have traced it down to the fact that Nim invokes gcc with "-fno-strict-aliasing" flag. In my case it reduces level of