Skip to content

Commit

Permalink
Disable strict aliasing (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
antoyo committed Oct 25, 2021
1 parent 863cfb2 commit 1d064f1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/base.rs
Expand Up @@ -77,7 +77,10 @@ pub fn compile_codegen_unit<'tcx>(tcx: TyCtxt<'tcx>, cgu_name: Symbol) -> (Modul
for arg in &tcx.sess.opts.cg.llvm_args {
context.add_command_line_option(arg);
}
// NOTE: an optimization (https://github.com/rust-lang/rustc_codegen_gcc/issues/53).
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");
if env::var("CG_GCCJIT_DUMP_CODE").as_deref() == Ok("1") {
context.set_dump_code_on_compile(true);
}
Expand Down

0 comments on commit 1d064f1

Please sign in to comment.