-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #69665 - tmiasko:new-pass-manager-thin-lto-opt, r=nikic
Invoke OptimizerLastEPCallbacks in PreLinkThinLTO The default ThinLTO pre-link pipeline does not include optimizer last extension points. Thus, when using the new LLVM pass manager & ThinLTO & sanitizers on any opt-level different from zero, the sanitizer function passes would be omitted from the pipeline. Add optimizer last extensions points manually to the pipeline, but guard registration with stage check in the case this behaviour changes in the future.
- Loading branch information
Showing
4 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Regression test for sanitizer function instrumentation passes not | ||
// being run when compiling with new LLVM pass manager and ThinLTO. | ||
// Note: The issue occured only on non-zero opt-level. | ||
// | ||
// min-llvm-version 9.0 | ||
// needs-sanitizer-support | ||
// only-x86_64 | ||
// | ||
// no-prefer-dynamic | ||
// revisions: opt0 opt1 | ||
// compile-flags: -Znew-llvm-pass-manager=yes -Zsanitizer=address -Clto=thin | ||
//[opt0]compile-flags: -Copt-level=0 | ||
//[opt1]compile-flags: -Copt-level=1 | ||
// run-fail | ||
// error-pattern: ERROR: AddressSanitizer: stack-use-after-scope | ||
|
||
static mut P: *mut usize = std::ptr::null_mut(); | ||
|
||
fn main() { | ||
unsafe { | ||
{ | ||
let mut x = 0; | ||
P = &mut x; | ||
} | ||
std::ptr::write_volatile(P, 123); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters