[clang] [clang] Emitting a warning if optimizations are enabled with sanitizers (PR #95934)

2024-07-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay requested changes to this pull request. . https://github.com/llvm/llvm-project/pull/95934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Emitting a warning if optimizations are enabled with sanitizers (PR #95934)

2024-06-29 Thread Fangrui Song via cfe-commits
MaskRay wrote: I agree that we should not add a driver diagnostic. Using sanitizers with -O2/-O3 is pretty common, especially when user programs are so large that -O0 is too slow or does not build at all. I think msan is the most affected sanitizer which will detect fewer bugs. https://github.

[clang] [clang] Emitting a warning if optimizations are enabled with sanitizers (PR #95934)

2024-06-27 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: I'm not certain we should issue a diagnostic when optimizations are enabled with sanitizers. For example, there is [explicit documentation that users *should* use `-O1` with address sanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer

[clang] [clang] Emitting a warning if optimizations are enabled with sanitizers (PR #95934)

2024-06-27 Thread via cfe-commits
Ritanya-B-Bharadwaj wrote: ping https://github.com/llvm/llvm-project/pull/95934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Emitting a warning if optimizations are enabled with sanitizers (PR #95934)

2024-06-27 Thread Sandeep Kosuri via cfe-commits
@@ -477,6 +477,8 @@ def warn_drv_disabling_vptr_no_rtti_default : Warning< def warn_drv_object_size_disabled_O0 : Warning< "the object size sanitizer has no effect at -O0, but is explicitly enabled: %0">, InGroup, DefaultWarnNoWerror; +def warn_sanitizer_with_optimization

[clang] [clang] Emitting a warning if optimizations are enabled with sanitizers (PR #95934)

2024-06-27 Thread Sandeep Kosuri via cfe-commits
@@ -1038,3 +1038,10 @@ // RUN: not %clang --target=aarch64-none-elf -fsanitize=dataflow %s -### 2>&1 | FileCheck %s -check-prefix=UNSUPPORTED-BAREMETAL // RUN: not %clang --target=arm-arm-none-eabi -fsanitize=shadow-call-stack %s -### 2>&1 | FileCheck %s -check-prefix=UNSUPPOR

[clang] [clang] Emitting a warning if optimizations are enabled with sanitizers (PR #95934)

2024-06-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-clang Author: None (Ritanya-B-Bharadwaj) Changes Sanitizers achieve better accuracy with lower optimization levels, and it is generally recommended to use `-O0` (the default optimization level) when using sanitizers fo

[clang] [clang] Emitting a warning if optimizations are enabled with sanitizers (PR #95934)

2024-06-18 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] [clang] Emitting a warning if optimizations are enabled with sanitizers (PR #95934)

2024-06-18 Thread via cfe-commits
https://github.com/Ritanya-B-Bharadwaj created https://github.com/llvm/llvm-project/pull/95934 Sanitizers achieve better accuracy with lower optimization levels, and it is generally recommended to use `-O0` (the default optimization level) when using sanitizers for the most accurate results. H