-
Notifications
You must be signed in to change notification settings - Fork 165
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
Failed to evaluate constant value #2394
Comments
There are a few parts to this issue:
We should probably be calling build2 instead of fold_build2 when inside a const context to get the constexpr code to do the overflow checking for us might fix this |
We actually need to port over code from c/c-fold.cc to get support for detecting this case the default GCC middle end does not set TREE_OVERFLOW for us. |
Side note, when looking at the precise version from Compiler-Explorer for nightly compilers, do NOT use the tooltip at the bottom. These are pre-computed offline and will not be updated along with the compiler every night. It only gets updated when we release a new version of compiler explorer (can be several times a week, sometimes more, sometimes less...). |
These are ported from the c-family code c-warn.cc and c-typchk.cc Fixes #2394 gcc/rust/ChangeLog: * backend/rust-constexpr.cc (eval_store_expression): check for null (eval_call_expression): formatting (eval_loop_expr): formatting * rust-gcc.cc (arithmetic_or_logical_expression): add warnings gcc/testsuite/ChangeLog: * rust/compile/issue-2394.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
These are ported from the c-family code c-warn.cc and c/c-typchk.cc Fixes #2394 gcc/rust/ChangeLog: * backend/rust-constexpr.cc (eval_store_expression): check for null (eval_call_expression): remove bad warning * rust-gcc.cc (arithmetic_or_logical_expression): add warnings gcc/testsuite/ChangeLog: * rust/compile/issue-2394.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
These are ported from the c-family code c-warn.cc and c/c-typchk.cc Fixes #2394 gcc/rust/ChangeLog: * backend/rust-constexpr.cc (eval_store_expression): check for null (eval_call_expression): remove bad warning * rust-gcc.cc (arithmetic_or_logical_expression): add warnings gcc/testsuite/ChangeLog: * rust/compile/issue-2394.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
These are ported from the c-family code c-warn.cc and c/c-typchk.cc Fixes #2394 gcc/rust/ChangeLog: * backend/rust-constexpr.cc (eval_store_expression): check for null (eval_call_expression): remove bad warning * rust-gcc.cc (arithmetic_or_logical_expression): add warnings gcc/testsuite/ChangeLog: * rust/compile/issue-2394.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
These are ported from the c-family code c-warn.cc and c/c-typchk.cc Fixes Rust-GCC#2394 gcc/rust/ChangeLog: * backend/rust-constexpr.cc (eval_store_expression): check for null (eval_call_expression): remove bad warning * rust-gcc.cc (arithmetic_or_logical_expression): add warnings gcc/testsuite/ChangeLog: * rust/compile/issue-2394.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
These are ported from the c-family code c-warn.cc and c/c-typchk.cc Fixes Rust-GCC#2394 gcc/rust/ChangeLog: * backend/rust-constexpr.cc (eval_store_expression): check for null (eval_call_expression): remove bad warning * rust-gcc.cc (arithmetic_or_logical_expression): add warnings gcc/testsuite/ChangeLog: * rust/compile/issue-2394.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Failed to evaluate constant value
E0080
compiler-explorer
I tried this code from
E0080
:I expected to see this happen:
evaluation of constant value failed
Instead, this happened:
Meta
The text was updated successfully, but these errors were encountered: