Skip to content
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

clang -O0 and -O1 output differently #154

Open
shao-hua-li opened this issue Nov 24, 2021 · 0 comments
Open

clang -O0 and -O1 output differently #154

shao-hua-li opened this issue Nov 24, 2021 · 0 comments

Comments

@shao-hua-li
Copy link

shao-hua-li commented Nov 24, 2021

Hi there,

  • Version: commit 90a6342 (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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant