Open ReimuNotMoe opened 1 year ago
-Ofast
you built using options documented to break the standard, and you're surprised something broke?
you built using options documented to break the standard, and you're surprised something broke?
I'm not the only one with fault here since many incorrect coding practises can be discovered with high optimization levels. So it's a problem worth discussing about.
Isn't mips officially abandoned? Maybe unmaintained compiler tools cause issues.
So it's a problem worth discussing about.
sure- but only insofar as something being wrong because it is wrong based on some level of correctness, not related to Ofast itself.
Isn't mips officially abandoned? Maybe unmaintained compiler tools cause issues.
maybe, maybe not, but for a simple test, i couldn't reproduce this on x86_64-linux-musl with either gcc12.2 or clang15 with -Ofast.
(that, of course, doesn't rule out a correctness issue- UB code does not always fail all the time on every platform, but it's possible everything is correct and this is purely a bad compiler/platform issue, as noted above)
@zherczeg
Isn't mips officially abandoned? Maybe unmaintained compiler tools cause issues.
No it's not. Waves sold all MIPS IPs to CIP United and the development is being continued. Nowadays the latest 5G basebands in Mediatek chipsets still uses MIPS architecture.
The gcc version is 11.3.0, which should be up-to-date enough.
What's your opinion about using double
in for loops? Do you think they're necessary or should be replaced with integers?
Do you have a link for that? It probably depends on the case.
Do you have a link for that? It probably depends on the case.
One example: ecma-builtin-helpers.c#L492
And there are more.
This one can be changed. Though it should not cause any issues.
indexOf
has the same problem, most likely they use the same mechanism for indexing
When JerryScript is compiled with
-Ofast
,String.startsWith
won't work correctly anymore.This problem doesn't happen with lower optimization levels.
I noticed some functions in
ecma-builtin-helpers.c
are usingecma_number_t
in for loops. Is this really necessary? Sinceecma_number_t
is defined asdouble
, this can cause some problems. I'm not sure if it's the case but I suspect it's related.JerryScript revision
1a2c04763aba49f52b1537acd3730098c873511c
Build platform
uname -a
/proc/cpuinfo
gcc -v
Build steps
Test case
Output
false
Expected behavior
true