Fix signed integer overflow

This commit is contained in:
Antoni Boucher 2023-01-22 21:22:49 -05:00
parent e6024f3bf3
commit 41f5e701e6
2 changed files with 4 additions and 1 deletions

View File

@ -104,7 +104,8 @@ jobs:
- name: Run tests
run: |
./test.sh --release --clean --release-sysroot --build-sysroot --mini-tests --std-tests # --test-libcore # FIXME(antoyo): libcore tests fail.
./test.sh --release --clean --release-sysroot --build-sysroot --mini-tests --std-tests --test-libcore
# TODO(antoyo): also run the rustc's test suite.
- name: Run stdarch tests
run: |

View File

@ -124,6 +124,8 @@ fn module_codegen(tcx: TyCtxt<'_>, (cgu_name, supports_128bit_integers): (Symbol
context.add_command_line_option("-fno-semantic-interposition");
// NOTE: Rust relies on LLVM not doing TBAA (https://github.com/rust-lang/unsafe-code-guidelines/issues/292).
context.add_command_line_option("-fno-strict-aliasing");
// NOTE: Rust relies on LLVM doing wrapping on overflow.
context.add_command_line_option("-fwrapv");
if tcx.sess.opts.unstable_opts.function_sections.unwrap_or(tcx.sess.target.function_sections) {
context.add_command_line_option("-ffunction-sections");