mujs icon indicating copy to clipboard operation
mujs copied to clipboard

clang -O0 and -O1 output differently

Open shao-hua-li opened this issue 3 years ago • 0 comments

Hi there,

  • Version: commit 90a63426ee93d9079a032740e519988e26d1949c (git head)
  • Compiler: clang13

I compiled mujs with clang13 -O0 and clang13 -O1, for the following code snippets, mujs would output differently on stack {}:

-'a' + new String%Function
debugger

For clang13 -O0, the last value in stack {} is -nan, while for clang13 -O1, it's nan.

I'm pretty sure it's a compiler issue, so I tried to reduce mujs sourcecode. Interestingly, for the reduced source code, it triggered a gcc bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103406).

shao-hua-li avatar Nov 24 '21 13:11 shao-hua-li