- Sep 01, 2023
-
-
Ying Yi authored
An execute-only target disallows data access to code sections. -fsanitize=function and -fsanitize=kcfi instrument indirect function calls to load a type hash before the function label. This results in a non-execute access to the code section and a runtime error. To solve the issue, -fsanitize=function should not be included in any check group (e.g. undefined) on an execute-only target. If a user passes -fsanitize=undefined, there is no error and no warning. However, if the user explicitly passes -fsanitize=function or -fsanitize=kcfi on an execute-only target, an error will be emitted. Fixes: https://github.com/llvm/llvm-project/issues/64931. Reviewed By: MaskRay, probinson, simon_tatham Differential Revision: https://reviews.llvm.org/D158614
-
Phoebe Wang authored
Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D158952 (cherry picked from commit b667e9c2)
-
Phoebe Wang authored
Split from D158952. (cherry picked from commit 30ec9473)
-
Haojian Wu authored
see the issue https://github.com/llvm/llvm-project/issues/64191 Differential Revision: https://reviews.llvm.org/D156650 (cherry picked from commit dcb28244)
-
Craig Topper authored
This disables the transform if the branch does not have the kill flag set for the AND we want to delete. Ideally we'd be able to share the AND with the AND we create in the expansion, but that's a more complex transform. So this starts with the simple approach to fix miscompile. This should be backported to LLVM 17. Fixes PR65025.ll Reviewed By: asb Differential Revision: https://reviews.llvm.org/D158962 (cherry picked from commit ff6d3338)
-
Amy Kwan authored
[PowerPC][lld] Account for additional X-Forms -> D-Form/DS-Forms load/stores when relaxing initial-exec to local-exec D153645 added additional X-Form load/stores that can be generated for TLS accesses. However, these added instructions have not been accounted for in lld. As a result, lld does not know how to handle them and cannot relax initial-exec to local-exec when the initial-exec sequence contains these additional load/stores. This patch aims to resolve https://github.com/llvm/llvm-project/issues/64424. Differential Revision: https://reviews.llvm.org/D158197 (cherry picked from commit 698b45aa)
-
- Aug 31, 2023
-
-
Simon Tatham authored
The `STGloop` family of pseudo-instructions all expand to a loop which iterates over a region of memory setting all its MTE tags to a given value. The loop writes to the flags in order to check termination. But the unexpanded pseudo-instructions were not marked as modifying the flags. Therefore it was possible for one to end up in a location where the flags were live, and then the loop would corrupt them. We spotted the effect of this in a libc++ test involving a lot of complicated inlining, and haven't been able to construct a smaller test case that demonstrates actual incorrect output code. So my test here is just checking that `implicit-def $nzcv` shows up on the pseudo-instructions as they're output from isel. Reviewed By: DavidSpickett Differential Revision: https://reviews.llvm.org/D158262 (cherry picked from commit b09c5759)
-
Mark de Wever authored
Fixes https://llvm.org/PR65011 Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D158940 (cherry picked from commit 8930d04d)
-
Yuxuan Shui authored
When sending file from a Linux host to a Windows remote, Linux host will try to copy the source file's permission bits, which will contain `_S_I?GRP` and `_S_I?OTH` bits. Those bits are rejected by `_wsopen_s`, causing it to return EINVAL. This patch masks out the rejected bits. GitHub issue: #64313 Reviewed By: jasonmolenda, DavidSpickett Differential Revision: https://reviews.llvm.org/D156817 (cherry picked from commit 9a4b3fdb)
-
Garvit Gupta authored
Before accessing "getOpcode" thorugh machine instruction, check if the iterator has reached the end of Machine basic block otherwise we will crash at the assertion `!NodePtr->isKnownSentinel()`. The above assertion is hit in "Prologue/Epilogue Insertion & Frame Finalization pass". Reviewed By: craig.topper, wangpc Differential Revision: https://reviews.llvm.org/D158256 (cherry picked from commit fdef7952)
-
Markus Böck authored
The alias initializer keeps a list of child indices around. When an alias is then marked as non-deferrable, all children are also marked non-deferrable. This is currently done naively which leads to an infinite recursion if using mutable types or attributes containing a cycle. This patch fixes this by adding an early return if the alias is already marked non-deferrable. Since this function is the only way to mark an alias as non-deferrable, it is guaranteed that if it is marked non-deferrable, all its children are as well, and it is not required to walk all the children. This incidentally makes the non-deferrable marking also `O(n)` instead of `O(n^2)` (although not performance sensitive obviously). Differential Revision: https://reviews.llvm.org/D158932
-
Matthias Springer authored
A dialect extension can add additional dialect extensions in its `apply` function. This used to crash when the vector of `extensions` was internally reallocated while it is being iterated over. Differential Revision: https://reviews.llvm.org/D158838
-
Balaji V. Iyer authored
Powf expansion currently returns NaN when the base is negative. This is because taking natural log of a negative number gives NaN. This patch will square the base and half the exponent, thereby getting around the negative base problem. Reviewed By: rsuderman Differential Revision: https://reviews.llvm.org/D158797
-
Matthias Springer authored
`SubViewReturnTypeCanonicalizer` is used by `OpWithOffsetSizesAndStridesConstantArgumentFolder`, which folds constant SSA value (dynamic) sizes into static sizes. The previous implementation crashed when a dynamic size was folded into a static `1` dimension, which was then mistaken as a rank reduction. Differential Revision: https://reviews.llvm.org/D158721
-
Lei Huang authored
-
- Aug 30, 2023
-
-
Serge Pavlov authored
A check pattern in clang/test/SemaCXX/template-64605.cpp contains template specialization kind (the text "implicit_instantiation"). It does not need to be checked and can be safely removed. Presence of this text in the check pattern prevents from backporting some commits to the release branch: https://github.com/llvm/llvm-project/issues/64605. It has only recently been printed and the relevant commit is not present in the release/17.x branch. (cherry picked from commit 8859c644)
-
Serge Pavlov authored
The test clang/test/SemaCXX/template-64605.cpp uses pragma FENV_ACCESS, which is not supported on all targets. Restrict it to x86_64 only. (cherry picked from commit 73e5a70e)
-
Serge Pavlov authored
When an expression is instantiated, TreeTransform skips ImplicitCastExpr nodes, assuming they are recreated when the instantiated expression is built. It breaks functions that use non-default floating-point options, because they are kept in these ImplicitCastExprs. In this case the recreated ImplicitCastExpr takes FP options from the current Sema state and not from AST node. To fix this issue the FP options in Sema object are set when a compound statement is cloned in TreeTransform. This change fixes https://github.com/llvm/llvm-project/issues/64605 ([Regression 16 -> 17] Template instantiation ignores FENV_ACCESS being ON for both definition and instantiation). Differential Revision: https://reviews.llvm.org/D158158 (cherry picked from commit 0baf85c3)
-
Tom Stellard authored
workflows: Fix libclang-abi test after update to use download-artifact v3
-
Aaron Ballman authored
https://github.com/llvm/llvm-project/commit/5d8aaad4452f60ba8902e921d9bed606713a8f26 removed the warning group as the functionality is no longer a GNU extension. However, users have asked for the warning group to be supported so that code transitioning from Clang 16 to Clang 17 has an easier migration path when compiling with -Werror. This patch restores the warning group, but as an ignored warning group because the functionality is now always considered to be a C extension rather than a GNU extension. This allows users to do: -Werror -pedantic -Wno-gnu-empty-intializer -Wno-c2x-extensions to silence the diagnostics in both Clang 16 and Clang 17. Fixes https://github.com/llvm/llvm-project/issues/64357 Differential Revision: https://reviews.llvm.org/D157503 (cherry picked from commit 151214b4)
-
Jon Roelofs authored
This often breaks modules-enabled bootstrap builds. (cherry picked from commit 1e4d6122)
-
Owen Pan authored
From https://en.cppreference.com/w/cpp/language/decltype: Note that if the name of an object is parenthesized, it is treated as an ordinary lvalue expression, thus decltype(x) and decltype((x)) are often different types. Fixes #64786. Differential Revision: https://reviews.llvm.org/D158155 (cherry picked from commit e3a79503)
-
Luke Lau authored
When folding a vmerge into its operands, if the resulting VL is smaller than what the vmerge had originally then what was previously in its body then gets moved to the tail. In that case, we can't relax the tail policy to agnostic when the merge operand is undefined, since we need to preserve these elements past the new VL. Fixes https://github.com/llvm/llvm-project/issues/64754 Reviewed By: craig.topper, reames Differential Revision: https://reviews.llvm.org/D158161 (cherry picked from commit 007b41b3)
-
Luke Lau authored
Reviewed By: reames Differential Revision: https://reviews.llvm.org/D158160 (cherry picked from commit 6e532f94)
-
Fangrui Song authored
Generalize D127933 (Fuchsia special case) to other ELF targets. Ensure that musl, NetBSD, OpenBSD, etc do not get ifunc codegen which is unsupported in their rtld. Link: https://discourse.llvm.org/t/does-ifunc-use-from-llvm-require-os-support/67628 Close: https://github.com/llvm/llvm-project/issues/64631 (cherry picked from commit 0c3a02b8)
-
Brooks Davis authored
SANITIZER_GLIBC is always defined so should be tested with an if not an ifdef. Fixes: ad7e2501 Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D159041 (cherry picked from commit 692344d8)
-
Martin Storsjö authored
80332312 made this test pass in MinGW environments, even if it still is failing in MSVC environments. (cherry picked from commit 277fc947)
-
Fangrui Song authored
`strtol("0b1", 0, 0)` can be (pre-C23) 0 or (C23) 1. `sscanf("0b10", "%i", &x)` is similar. glibc 2.38 introduced `__isoc23_strtol` and `__isoc23_scanf` family functions for binary compatibility. When `_ISOC2X_SOURCE` is defined (implied by `_GNU_SOURCE`) or `__STDC_VERSION__ > 201710L`, `__GLIBC_USE_ISOC2X` is defined to 1 and these `__isoc23_*` symbols are used. Add `__isoc23_` versions for the following interceptors: * sanitizer_common_interceptors.inc implements strtoimax/strtoumax. Remove incorrect FIXME about https://github.com/google/sanitizers/issues/321 * asan_interceptors.cpp implements just strtol and strtoll. The default `replace_str` mode checks `nptr` is readable and `endptr` is writable. atoi reuses the existing strtol interceptor. * msan_interceptors.cpp implements strtol family functions and their `_l` versions. Tested by lib/msan/tests/msan_test.cpp * sanitizer_common_interceptors.inc implements scanf family functions. The strtol family functions are spreaded, which is not great, but the patch (intended for release/17.x) does not attempt to address the issue. Add symbols to lib/sanitizer_common/symbolizer/scripts/global_symbols.txt to support both glibc pre-2.38 and 2.38. When build bots migrate to glibc 2.38+, we will lose test coverage for non-isoc23 versions since the existing C++ unittests imply `_GNU_SOURCE`. Add test/sanitizer_common/TestCases/{strtol.c,scanf.c}. They catch msan false positive in the absence of the interceptors. Fix https://github.com/llvm/llvm-project/issues/64388 Fix https://github.com/llvm/llvm-project/issues/64946 Link: https://lists.gnu.org/archive/html/info-gnu/2023-07/msg00010.html ("The GNU C Library version 2.38 is now available") Reviewed By: #sanitizers, vitalybuka, mgorny Differential Revision: https://reviews.llvm.org/D158943 (cherry picked from commit ad7e2501) -
Fangrui Song authored
`_MSC_VER>=1800` (Visual Studio 2013) supports atoll/strtoll. Remove the obsoleted workaround ASAN_INTERCEPT_ATOLL_AND_STRTOLL. test/asan/TestCases/atoll_strict.c passes but test/asan/TestCases/strtoll_strict.c doesn't. (cherry picked from commit 80332312)
-
dingfei authored
NumFunctionDeclBits is not updated when DeductionCandidateKind is incremented. Fixes https://github.com/llvm/llvm-project/issues/64171 Reviewed By: cor3ntin, balazske, aaron.ballman Differential Revision: https://reviews.llvm.org/D158145 (cherry picked from commit 91c4b555)
-
Galen Elias authored
Fixes #64134. Differential Revision: https://reviews.llvm.org/D156705 (cherry picked from commit 400da115)
-
Takuya Shimizu authored
This patch fixes the reported regression caused by D146358 through adding notes about an uninitialized base class when we diagnose uninitialized constructor. This also changes the wording from the old one in order to make it clear that the uninitialized subobject is a base class and its constructor is not called. Wording changes: BEFORE: `subobject of type 'Base' is not initialized` AFTER: `constructor of base class 'Base' is not called` Fixes https://github.com/llvm/llvm-project/issues/63496 Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D153969
-
Vassil Vassilev authored
Original commit message:" ORC splits into separate dylibs symbols coming from the process and symbols materialized in the Jit. This patch adapts intent of the existing interface and adds a regression test to make sure both Jit'd and compiled symbols can be found. Differential revision: https://reviews.llvm.org/D159115 " This patch disables the test statement on windows as it seems we might have a bug in the way we model dllimports. (cherry picked from commit 452cb7f2)
-
Phoebe Wang authored
Fixes #64460 Reviewed By: RKSimon, skan Differential Revision: https://reviews.llvm.org/D158950 (cherry picked from commit 66887014)
-
Erik Desjardins authored
I forgot to do this in 66ec5df3 / https://reviews.llvm.org/D158810. Since this is testing for an assertion failure, the test checks don't matter, but we might as well avoid unnecessary churn the next time someone modifies this test. (cherry picked from commit df112cba)
-
Erik Desjardins authored
Another case of https://github.com/llvm/llvm-project/issues/55085. The added test would trip an assertion due to calling `getSExtValue()` on a value that doesn't fit in int64_t. Differential Revision: https://reviews.llvm.org/D158810 (cherry picked from commit 66ec5df3)
-
Khem Raj authored
Some 32-bit architectures don't have mmap and define mmap2 instead. E.g. on riscv32 we may get ``` | /mnt/b/yoe/master/build/tmp/work-shared/llvm-project-source-17.0.0-r0/git/llvm/tools/llvm-exegesis/lib/X86/Target.cpp:1116:19: error: use of undeclared identifier 'SYS_mmap' | 1116 | generateSyscall(SYS_mmap, MmapCode); | | ^ | /mnt/b/yoe/master/build/tmp/work-shared/llvm-project-source-17.0.0-r0/git/llvm/tools/llvm-exegesis/lib/X86/Target.cpp:1134:19: error: use of undeclared identifier 'SYS_mmap' | 1134 | generateSyscall(SYS_mmap, GeneratedCode); | | ^ | 1 warning and 2 errors generated. ``` Co-Authored-By:
Fangrui Song <i@maskray.me> Differential Revision: https://reviews.llvm.org/D158375 (cherry picked from commit 01a92f06)
-
Aaron Ballman authored
-
- Aug 29, 2023
-
-
Amy Huang authored
In internal google builds, MainExecPath doesn't go to the directory with `clang`. Fall back to using Argv0 if MainExecPath doesn't find any clangs. Differential Revision: https://reviews.llvm.org/D158901 (cherry picked from commit e4eb8d97)
-
Fangrui Song authored
Some options are only claimed in AddX86TargetArgs/etc (called by Clang::RenderTargetOptions). For assembler input, `Add*TargetArgs` is not called. If an option is unclaimed, it either leads to a -Wunused-command-line-argument warning or an error (if `TargetSpecific` is set) ``` // clang '-###' --target=x86_64 -mfpmath=sse -c a.s clang: error: unsupported option '-mfpmath=sse' for target 'x86_64' ``` For -mfpmath=, it's actually claimed by RenderFloatingPointOptions, which should be moved to AddARMTargetArgs/AddX86TargetArgs later (non-AArch32-non-x86 targets give a frontend error). This change is localized and similar to D153691, for release/17.x backporting. Fix https://github.com/llvm/llvm-project/issues/65023 Reviewed By: thesamesam Differential Revision: https://reviews.llvm.org/D159010 (cherry picked from commit 081afa3d)
-