[PATCH] D156565: Diagnose use of VLAs in C++ by default

2023-10-21 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. Is it expected that this introduces a warning for C code, as the commit message and tests appear to only affect C++? A trivial example from the Linux kernel: https://elixir.bootlin.com/linux/v6.5.8/source/tools/lib/bpf/btf_dump.c#L1678 #include #include #in

[PATCH] D157435: [Sema] Do not emit -Wmissing-variable-declarations for register variables

2023-08-08 Thread Nathan Chancellor via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGa22d385f9656: [Sema] Do not emit -Wmissing-variable-declarations for register variables (authored by nathanchance). Repository: rG LLVM Github Mo

[PATCH] D157435: [Sema] Do not emit -Wmissing-variable-declarations for register variables

2023-08-08 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance updated this revision to Diff 548337. nathanchance added a comment. - Update formatting in release notes - Add GCC bug link to commit message - Remove unnecessary REQUIRES: in test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157435/ne

[PATCH] D157435: [Sema] Do not emit -Wmissing-variable-declarations for register variables

2023-08-08 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance created this revision. nathanchance added reviewers: aaron.ballman, nickdesaulniers. Herald added a subscriber: pengfei. Herald added a project: All. nathanchance requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. When building th

[PATCH] D76096: [clang] allow const structs/unions/arrays to be constant expressions for C

2023-08-07 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. In D76096#4564855 , @DavidSpickett wrote: > One of the kernel tests now fails to build for AArch64 and Arm: > > 00:00:48 ++ make > CC=/home/tcwg-buildslave/workspace/tcwg_kernel_0/bin/aarch64-cc > LD=/home/tcwg-buildslave

[PATCH] D154696: [Clang] Diagnose jumps into statement expressions

2023-07-22 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. In D154696#4525254 , @cor3ntin wrote: > Can you let me know what the linux folks think? Thanks a lot! Sure thing, you should be able to follow along on the web as well: https://lore.kernel.org/2023070637.GA138486@dev-ar

[PATCH] D154696: [Clang] Diagnose jumps into statement expressions

2023-07-22 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. The error added by this patch triggers on some recently added code to the Linux kernel's -next tree, which I failed to test above due to its generally unstable nature: drivers/gpu/drm/tests/drm_exec_test.c:41:3: error: cannot jump from this indirect goto stateme

[PATCH] D155342: [clang][JumpDiagnostics] ignore non-asm goto target scopes

2023-07-19 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. Thanks, I can confirm that the `__attribute__((__cleanup__(...)))` errors that we observed with Peter's work-in-progress guards series are resolved and that all the errors I observed when building the kernel after https://reviews.llvm.org/D154696 was merged are no

[PATCH] D142609: [Clang] Fix -Wconstant-logical-operand when LHS is a constant

2023-07-19 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. For the record, I have sent https://lore.kernel.org/20230718-nsecs_to_jiffies_timeout-constant-logical-operand-v1-0-36ed8fc8f...@kernel.org/ to address those warnings for the kernel. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[PATCH] D142609: [Clang] Fix -Wconstant-logical-operand when LHS is a constant

2023-07-18 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. In D142609#4511579 , @nickdesaulniers wrote: > In D142609#4507696 , @nathanchance > wrote: > >> but I see a new one along a similar line as those: >> >> https://elixir.bootlin.com/l

[PATCH] D142609: [Clang] Fix -Wconstant-logical-operand when LHS is a constant

2023-07-17 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. I took the most recent version for a spin against the Linux kernel. The couple of issues that a previous revision of the warning flagged (https://github.com/ClangBuiltLinux/linux/issues/1806, https://github.com/ClangBuiltLinux/linux/issues/1807) are no longer visib

[PATCH] D154696: [Clang] Diagnose jumps into statement expressions

2023-07-13 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. I suspect this is the same issue but our CI pointed out another instance of this error in some x86 code (https://storage.tuxsuite.com/public/clangbuiltlinux/continuous-integration2/builds/2SW8BY7moEweMJC6DJpzidlGYt8/build.log), which does not appear to use local la

[PATCH] D154696: [Clang] Diagnose jumps into statement expressions

2023-07-12 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. In D154696#4494899 , @cor3ntin wrote: > The issue is that `VerifyIndirectOrAsmJumps` does not consider that label > may be local label at all, I'm not exactly sure how to improve that. > The fact it works currently seems ki

[PATCH] D153989: [compiler-rt] Move crt into builtins

2023-07-12 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. This change appears to break `-DCOMPILER_RT_BUILD_CRT=OFF`: $ cmake -B build -S llvm -DCMAKE_BUILD_TYPE=Release -DCOMPILER_RT_BUILD_CRT=OFF -DLLVM_ENABLE_PROJECTS='clang;compiler-rt;lld' ... CMake Error at cmake/modules/AddLLVM.cmake:1935 (add_dependencies):

[PATCH] D154696: [Clang] Diagnose jumps into statement expressions

2023-07-12 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added subscribers: nickdesaulniers, nathanchance. nathanchance added a comment. This patch breaks building the Linux kernel for PowerPC, which uses `asm goto` with a local label in a statement expression for the WARN macro. It seems like something with the scoping is going wrong. I

[PATCH] D152186: [Clang] Add release note for 877210faa447

2023-06-05 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. Thanks, I landed it with those nits addressed. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152186/new/ https://reviews.llvm.org/D152186 ___ cfe-commits mailing list cfe-co

[PATCH] D152186: [Clang] Add release note for 877210faa447

2023-06-05 Thread Nathan Chancellor via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGdeecf89a1361: [Clang] Add release note for 877210faa447 (authored by nathanchance). Changed prior to commit: https://reviews.llvm.org/D152186?vs=5

[PATCH] D152186: [Clang] Add release note for 877210faa447

2023-06-05 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance created this revision. nathanchance added reviewers: erichkeane, nickdesaulniers. Herald added a project: All. nathanchance requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.

[PATCH] D152180: [Sema] Do not emit -Wunused-variable for variables declared with cleanup attribute

2023-06-05 Thread Nathan Chancellor via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG877210faa447: [Sema] Do not emit -Wunused-variable for variables declared with cleanup… (authored by nathanchance). Repository: rG LLVM Github Mon

[PATCH] D152180: [Sema] Do not emit -Wunused-variable for variables declared with cleanup attribute

2023-06-05 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance updated this revision to Diff 528510. nathanchance added a comment. Change `f4()`'s return type to `void` (Nick) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152180/new/ https://reviews.llvm.org/D152180 Files: clang/lib/Sema/SemaDecl.cpp clang/test/Sema/warn-unused-va

[PATCH] D152180: [Sema] Do not emit -Wunused-variable for variables declared with cleanup attribute

2023-06-05 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance created this revision. nathanchance added reviewers: aaron.ballman, nickdesaulniers, erichkeane. Herald added a project: All. nathanchance requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. A variable declared with `__attribute__(

[PATCH] D151741: [Lex] Only warn on defining or undefining language-defined builtins

2023-05-30 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. This patch cleared up all the warnings I reported, thank you for the fix! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151741/new/ https://reviews.llvm.org/D151741 ___ cfe-

[PATCH] D144654: [Lex] Warn when defining or undefining any builtin macro

2023-05-26 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added subscribers: nickdesaulniers, nathanchance. nathanchance added a comment. For what it's worth, this change is quite noisy for the Linux kernel, as there are certain macros undefined in header files that are included in many other headers. Additionally, at least one new instanc

[PATCH] D144967: [PowerPC] Recognize long CPU name for -mtune in Clang

2023-03-03 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. @amyk thank you so much! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144967/new/ https://reviews.llvm.org/D144967 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[PATCH] D144967: [PowerPC] Recognize long CPU name for -mtune in Clang

2023-03-02 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. Could this be merged into `main` and backported to `release/16.x`? If this makes 16.0.0 final, I think the kernel can avoid working around this issue altogether, as `-mtune` was only wired up to do something on PowerPC in during the 16 development cycle; in prior v

[PATCH] D144967: [PowerPC] Recognize long CPU name for -mtune in Clang

2023-02-28 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. Thanks for the fix, it appears to work fine for me against the kernel's `powernv_defconfig` target. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144967/new/ https://reviews.llvm.org/D144967 _

[PATCH] D140270: MIPS: fix build from IR files, nan2008 and FpAbi

2023-01-30 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. I tested this against the kernel and left my feedback above (no issues) so this can be merged. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140270/new/ https://reviews.llvm.org/D140270 __

[PATCH] D139114: [Clang][Sema] Enabled implicit conversion warning for CompoundAssignment operator.

2023-01-17 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. > I’ll have to filter the warnings to see if there are any other instances with > other operators that appear problematic. I count a single warning that triggers for an arithmetic operator (which might be a bug): ../drivers/net/wireless/ralink/rt2x00/rt2800lib.c

[PATCH] D139114: [Clang][Sema] Enabled implicit conversion warning for CompoundAssignment operator.

2023-01-14 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. > In D139114#4053166 , @nathanchance > wrote: > >> For what it’s worth, this triggers a LOT in the Linux kernel for the pattern >> that @MaskRay pointed out: > > Out of curiosity, has it found any true positives that you can

[PATCH] D139114: [Clang][Sema] Enabled implicit conversion warning for CompoundAssignment operator.

2023-01-13 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. For what it’s worth, this triggers a LOT in the Linux kernel for the pattern that @MaskRay pointed out: https://gist.github.com/nathanchance/a76c2ba0a22dda3251c4ec5ee9e3f285 $ rg -c -- -Wconstant-conversion $TMP_FOLDER/4c37671a7c946ac246b52fa44a6a649b89d6310b-bu

[PATCH] D140270: MIPS: fix build from IR files, nan2008 and FpAbi

2023-01-01 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. This does not show any issues with any of the MIPS configurations that I build in the Linux kernel, thanks for fixing the problems I reported! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140270/new/ https://reviews.

[PATCH] D138179: MIPS: fix build from IR files, nan2008 and FpAbi

2022-12-16 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added subscribers: nickdesaulniers, nathanchance. nathanchance added a comment. For what it's worth, this breaks building the Linux kernel's `ARCH=mips 32r1_defconfig` with clang and GNU as, with thousands of messages along the line of: /tmp/mmc_ops-d329c3.s: Assembler messages:

[PATCH] D136790: [Clang][Sema] Add -Wincompatible-function-pointer-types-strict

2022-11-02 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:8217 + err_typecheck_convert_incompatible_function_pointer.Text>, + InGroup>, DefaultIgnore; def ext_typecheck_convert_discards_qualifiers : ExtWarn< samitolvanen

[PATCH] D136790: [Clang][Sema] Add -Wincompatible-function-pointer-types-strict

2022-11-02 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:8217 + err_typecheck_convert_incompatible_function_pointer.Text>, + InGroup>, DefaultIgnore; def ext_typecheck_convert_discards_qualifiers : ExtWarn< aaron.ballma

[PATCH] D136790: [Clang][Sema] Add -Wincompatible-function-pointer-types-strict

2022-11-01 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:8217 + err_typecheck_convert_incompatible_function_pointer.Text>, + InGroup>, DefaultIgnore; def ext_typecheck_convert_discards_qualifiers : ExtWarn< aaron.ballma

[PATCH] D134671: [Driver] Prevent Mips specific code from claiming -mabi argument on other targets.

2022-10-03 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. In D134671#3828197 , @craig.topper wrote: > In D134671#3824644 , > @nickdesaulniers wrote: > >> I don't think it's an issue for us to work around downstream, but this did >> regres

[PATCH] D134831: [Clang][Sema] Add -Wcast-function-type-strict

2022-09-30 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. In D134831#3827790 , @samitolvanen wrote: > In D134831#3827730 , > @nickdesaulniers wrote: > >> Please get the patch disabling this warning for the kernel in flight before >> landi

[PATCH] D134831: [Clang][Sema] Add -Wcast-function-type-strict

2022-09-29 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:8686 +def warn_cast_function_type_strict : Warning, + InGroup, DefaultIgnore; def err_cast_pointer_to_non_pointer_int : Error< kees wrote: > aaron.ballman wrote: >

[PATCH] D134702: [Clang] Don't warn if deferencing void pointers in unevaluated context

2022-09-27 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. Thanks a lot for fixing this! I took it for a spin against the Linux kernel and all instances of `-Wvoid-ptr-dereference` disappeared :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134702/new/ https://reviews.llvm.o

[PATCH] D133574: [C2x] reject type definitions in offsetof

2022-09-27 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. Diff 463063 looks good against the Linux kernel with https://lore.kernel.org/20220925153151.2467884-1...@inclyc.cn/ applied. I see no additional errors/warnings and the `drivers/media/platform/nvidia/tegra-vde/v4l2.c` did disappear. Once that patch has been fully

[PATCH] D133574: [C2x] reject type definitions in offsetof

2022-09-26 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. In D133574#3815951 , @aaron.ballman wrote: > LGTM, thank you! Please don't land until you have some indication from the > kernel folks that this won't be super disruptive for them. CC > @nickdesaulniers and @nathanchance f

[PATCH] D134461: [Clang] Warn when trying to deferencing void pointers in C

2022-09-26 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. In D134461#3815458 , @aaron.ballman wrote: > What do folks think of that idea? I think that all sounds reasonable to me (although I am far from an authority on these matters). As far as I understand it, the kernel cannot u

[PATCH] D134461: [Clang] Warn when trying to deferencing void pointers in C

2022-09-26 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added subscribers: nickdesaulniers, nathanchance. nathanchance added a comment. This warning is quite noisy for the Linux kernel due to a couple of places where a `void *` is dereferenced as part of compile time checking. My original commentary is available on our GitHub issue track

[PATCH] D130586: [cmake] Use `CMAKE_INSTALL_LIBDIR` too

2022-08-18 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. I can no longer do a two stage build on Fedora after this change. $ cmake \ -B build/stage1 \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_COMPILER=$(command -v clang) \ -DCMAKE_CXX_COMPILER=$(command -v clang++) \ -DLLVM_ENABLE_PROJECTS="clang;lld" \ -DLLVM_

[PATCH] D129709: [clang][CodeGen] add fn_ret_thunk_extern to synthetic fns

2022-07-14 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. This cleans up the objtool warnings I initially reported and does not introduce any other regressions in my Linux kernel build and QEMU boot tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129709/new/ https://rev

[PATCH] D124159: [SimplifyCFG] Thread branches on same condition in more cases (PR54980)

2022-07-05 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. I ended up reducing something down anyways. At the parent commit of dc969061c68e62328607d68215ed8b9ef4a1e4b1 , there is no crash. _Bool fpsimd_context_busy; enum { false, true } arch_static_b

[PATCH] D124159: [SimplifyCFG] Thread branches on same condition in more cases (PR54980)

2022-07-05 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. Should dc969061c68e62328607d68215ed8b9ef4a1e4b1 be reverted as well? I just bisected an assertion failure while building the Linux kernel for arm64 to that change: clang: /home/nathan/cbl/src

[PATCH] D125506: [PowerPC] Implement XL compat __fnabs and __fnabss builtins.

2022-05-24 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. @amyk Thank you a lot for the fix! I'll pull it down and verify everything is fixed tonight. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125506/new/ https://reviews.llvm.org/D125506

[PATCH] D125506: [PowerPC] Implement XL compat __fnabs and __fnabss builtins.

2022-05-20 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added subscribers: nickdesaulniers, nathanchance. nathanchance added a comment. I bisected a crash when compiling the Linux kernel to this change. A reduced C reproducer: enum { OP_CB_GETATTR = 3, OP_CB_RECALL, OP_CB_RECALL_ANY = 8, OP_CB_RECALL_SLOT = 10, OP_C

[PATCH] D124726: Suggest typoed directives in preprocessor conditionals

2022-05-16 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added subscribers: nickdesaulniers, nathanchance. nathanchance added a comment. I see an instance of this warning in the Linux kernel due to the "Now, for unknown directives inside a skipped conditional block, we diagnose the unknown directive as a warning if it is sufficiently simi

[PATCH] D122189: [Clang][NeonEmitter] emit ret decl first for -Wdeclaration-after-statement

2022-03-21 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. This passes through all my `ARCH=arm` and `ARCH=arm64` build and boot tests on `next-20220321` with the instances of `-Wdeclaration-after-statement` resolved and no new instances of any other warnings. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTI

[PATCH] D110869: [X86] Implement -fzero-call-used-regs option

2022-02-07 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. In D110869#3302625 , @nickdesaulniers wrote: > All built+boot. I know @nathanchance pointed out an issue with some already > complex code, but I'm of the opinion that fn should be attributed in kernel > sources. Aside fro

[PATCH] D110869: [X86] Implement -fzero-call-used-regs option

2022-02-03 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. It looks like `_paravirt_ident_64()` is the problematic function. This diff on top of v5.17-rc2 allows me to boot: diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index 4420499f7bb4..c1b68504136c 100644 --- a/arch/x86/kernel/paravirt.c +

[PATCH] D110869: [X86] Implement -fzero-call-used-regs option

2022-02-03 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. In D110869#3295012 , @void wrote: > In D110869#3294696 , @nathanchance > wrote: > >> This diff allows me to boot on bare metal as of v5.17-rc2: >> >> diff --git a/arch/x86/kernel/M

[PATCH] D110869: [X86] Implement -fzero-call-used-regs option

2022-02-03 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. This diff allows me to boot on bare metal as of v5.17-rc2: diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 6aef9ee28a39..8ee176dac669 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -125,6 +125,7 @@ obj-$(CONFI

[PATCH] D110869: [X86] Implement -fzero-call-used-regs option

2022-02-03 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. The latest revision allows me to boot a kernel in QEMU now but that same kernel does not boot on bare metal. I'll see if I can narrow down the problematic translation unit with Nick's `subdir-ccflags-y` trick. Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D117717: [clang] Ignore -fconserve-stack

2022-01-27 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance abandoned this revision. nathanchance added a comment. As discussed, this is not the right fix for the issue. I have just gone ahead and told the original reporter to use `scan-build` with the `--use-cc=clang` flag to avoid these issues. Repository: rG LLVM Github Monorepo CHAN

[PATCH] D117717: [clang] Ignore -fconserve-stack

2022-01-19 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. In D117717#3256293 , @MaskRay wrote: > Assuming scan-build is clang/tools/scan-build, which is in tree and can be > fixed instead. Yes, that is the one. > I am not familiar with it, but from > >> However, this caused issue

[PATCH] D117717: [clang] Ignore -fconserve-stack

2022-01-19 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. In D117717#3256180 , @MaskRay wrote: > Clang has a long list of ignored options but most were added during the > catch-up phase when Clang strove to be a competitor compiler. > I think for new ignored options there needs to

[PATCH] D117717: [clang] Ignore -fconserve-stack

2022-01-19 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance created this revision. nathanchance added reviewers: aaron.ballman, MaskRay, srhines. Herald added a subscriber: dang. nathanchance requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This flag is used when building the Linux kerne

[PATCH] D105169: [Clang/Test]: Rename enable_noundef_analysis to disable-noundef-analysis and turn it off by default

2022-01-15 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. In D105169#3246378 , @nlopes wrote: > In D105169#3244624 , @nathanchance > wrote: > >> I can reduce all of these down for you and/or I can start an email thread >> with the `objtool

[PATCH] D105169: [Clang/Test]: Rename enable_noundef_analysis to disable-noundef-analysis and turn it off by default

2022-01-14 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a subscriber: nickdesaulniers. nathanchance added a comment. In D105169#3242949 , @hyeongyukim wrote: > @nathanchance Hi, I analyzed all four warnings. Thanks a lot for doing this! > Warning #1: can be handled by x86-backend. filled

[PATCH] D105169: [Clang/Test]: Rename enable_noundef_analysis to disable-noundef-analysis and turn it off by default

2022-01-12 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. In D105169#3236484 , @hyeongyukim wrote: > @nathanchance > > I tried to reproduce the last warning (intelfbhw_validate_mode), but I failed > to produce it. > I think my reproducer is correct, but it does not make any warnin

[PATCH] D116059: [Clang][CFG] check children statements of asm goto

2022-01-07 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. The two false positive warnings in the kernel are fixed with this patch and there were no new warnings introduced. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116059/new/ https://reviews.llvm.org/D116059 __

[PATCH] D105169: [Clang/Test]: Rename enable_noundef_analysis to disable-noundef-analysis and turn it off by default

2021-12-29 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. @hyeongyukim I hand reduced a couple of the translation units that I see issues in so apologies if they are a little verbose. The full set of warnings: drivers/net/ethernet/renesas/ravb.lto.o: warning: objtool: .text.ravb_set_gti: unexpected end of section dri

[PATCH] D105169: [Clang/Test]: Rename enable_noundef_analysis to disable-noundef-analysis and turn it off by default

2021-12-28 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. @hyeongyukim I am currently offline for the evening but it seems like my reduction might have been too aggressive. It looks like this code comes from `ravb_set_gti()` (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/ethernet/rene

[PATCH] D116128: [clang][driver] Warn when '-mno-outline-atomics' is used with a non-AArch64 triple

2021-12-23 Thread Nathan Chancellor via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGbe8180af5854: [clang][driver] Warn when '-mno-outline-atomics' is used with a non-AArch64… (authored by nathanchance). Repository: rG LLVM Github

[PATCH] D116128: [clang][driver] Warn when '-mno-outline-atomics' is used with a non-AArch64 triple

2021-12-22 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance updated this revision to Diff 395879. nathanchance added a comment. Herald added subscribers: luke957, s.egerton, simoncook. - Move test from x86-outline-atomics.c to unsupported-outline-atomics.c (Marco). - Add a test for riscv64 to ensure it works with multiple architectures (Marco

[PATCH] D116128: [clang][driver] Warn when '-mno-outline-atomics' is used with a non-AArch64 triple

2021-12-21 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added inline comments. Comment at: clang/test/Driver/x86-outline-atomics.c:1-7 +// RUN: %clang -target x86_64 -moutline-atomics -S %s -### 2>&1 | FileCheck %s -check-prefix=CHECK-OUTLINE-ATOMICS +// CHECK-OUTLINE-ATOMICS: warning: 'x86_64' does not support '-moutli

[PATCH] D116128: [clang][driver] Warn when '-mno-outline-atomics' is used with a non-AArch64 triple

2021-12-21 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. If there are more qualified people to review and accept this, please add them, I was unsure of who else to add. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116128/new/ https://reviews.llvm.org/D116128 _

[PATCH] D116128: [clang][driver] Warn when '-mno-outline-atomics' is used with a non-AArch64 triple

2021-12-21 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance created this revision. nathanchance added reviewers: melver, nickdesaulniers, t.p.northover. Herald added subscribers: pengfei, kristof.beyls. nathanchance requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The Linux kernel has a

[PATCH] D114848: [Analysis] Ignore casts and unary ops for uninitialized values

2021-12-01 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. I tested the problematic Linux kernel configuration that uncovered this issue with this patch and the issue was resolved. I tested an x86_64 allmodconfig build and did not see any warnings. Comment at: clang/lib/Analysis/UninitializedValues.cpp:5

[PATCH] D105169: [Clang/Test]: Rename enable_noundef_analysis to disable-noundef-analysis and turn it off by default

2021-11-08 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. Prior to the latest revert (fd9b099906c61e46574d1ea2d99b973321fe1d21 ), the Linux kernel's binary verifier (`objtool`) points out an issue when building with ThinLTO and `-fsanitize=integer-divide

[PATCH] D111199: [Clang][LLVM][Attr] support btf_type_tag attribute

2021-11-06 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. I bisected a crash in the Linux kernel down to the reland commit (and it is not fixed as of https://github.com/llvm/llvm-project/commit/2249ecee8d9a6237f51485bd39f01ba031575987): $ git bisect log # bad: [bdaa181007a46d317a1665acb8234eddeee82815] [TwoAddressInst

[PATCH] D112600: [ARM] Use hardware TLS register in Thumb2 mode when -mtp=cp15 is passed

2021-10-27 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a subscriber: peter.smith. nathanchance added a comment. I tested this against `next-20211027`, where it resolved the build error and boots in QEMU master without any visible issues. Disassembly between GCC and clang seems to be good. I'll leave it up to @nickdesaulniers and @

[PATCH] D110869: [X86] Implement -fzero-call-used-regs option

2021-10-26 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. `check-llvm` does not pass with this revision nor does it resolve the boot failure that Nick mentioned, just in case that was the intention of the revision :) I ran the kernel through `gdb` and it still does not appear to get to `start_kernel`. Repository: rG L

[PATCH] D110656: [clang][Sema] Warn on uninitialized array elments

2021-10-01 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. In D110656#3034181 , @nathanchance wrote: > I can test this on the Linux kernel tonight and report the results tomorrow > morning. My apologies, I did not have time to get to this last night or today and I am going to be

[PATCH] D110656: [clang][Sema] Warn on uninitialized array elments

2021-09-30 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. I can test this on the Linux kernel tonight and report the results tomorrow morning. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110656/new/ https://reviews.llvm.org/D110656

[PATCH] D108003: [Clang] Extend -Wbool-operation to warn about bitwise and of bools with side effects

2021-09-30 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. As far as I am aware, this iteration of the patch has no instances in the Linux kernel now. The instances I found with the first iteration of the patch only had a right hand side with side effects, not both sides, so this warning is effectively a no-op now (not tha

[PATCH] D108003: [Clang] Extend -Wbool-operation to warn about bitwise and of bools with side effects

2021-08-19 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. I am still running a series of builds against the Linux kernel but I already see one instance of this warning where the suggestion would change the meaning of the code in an incorrect way: drivers/input/touchscreen.c:81:17: warning: use of bitwise '|' with boolea

[PATCH] D107933: [clang] Expose unreachable fallthrough annotation warning

2021-08-16 Thread Nathan Chancellor via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9ed4a94d6451: [clang] Expose unreachable fallthrough annotation warning (authored by nathanchance). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107933/new/

[PATCH] D107933: [clang] Expose unreachable fallthrough annotation warning

2021-08-16 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance updated this revision to Diff 366733. nathanchance marked an inline comment as not done. nathanchance edited the summary of this revision. nathanchance added a comment. - Update commit message (forgot to use `arc diff --edit --verbatim`) [David] Repository: rG LLVM Github Monorepo

[PATCH] D108003: [Clang] Extend -Wbool-operation to warn about bitwise and of bools with side effects

2021-08-14 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. I have sent the following patches for the Linux kernel. These were the only instances of the warning that I found across the code base in all of the configurations that we usually test so thank you for the heads up so I could send fixes before this lands. https://

[PATCH] D107933: [clang] Expose unreachable fallthrough annotation warning

2021-08-13 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance marked an inline comment as done. nathanchance added inline comments. Comment at: clang/test/SemaCXX/switch-implicit-fallthrough.cpp:211-214 +case 224: + n += 400; +case 225: // expected-warning{{unannotated fall-through between switch labels}} expected

[PATCH] D107933: [clang] Expose unreachable fallthrough annotation warning

2021-08-13 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance updated this revision to Diff 366363. nathanchance added a comment. - -Wimplicit-fallthrough-unreachable -> -Wunreachable-code-fallthrough, enabled under -Wunreachable-code (Dávid, Aaron). - Drop "case 225" from new test, as it does not add to test coverage (Nick). - Add -Wunreacha

[PATCH] D108003: [Clang] Extend -Wbool-operation to warn about bitwise and of bools with side effects

2021-08-13 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. In D108003#2944413 , @Quuxplusone wrote: > FWIW, all three of @nathanchance's detected lines look like good true > positives to me: even if they're not //bugs//, they all look like places the > programmer //meant// to writ

[PATCH] D107933: [clang] Expose unreachable fallthrough annotation warning

2021-08-13 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. In D107933#2942430 , @xbolva00 wrote: > Yes, something like that, plus I think you want put > UnreachableCodeFallthrough into group UnreachableCode as well. So you would recommend adding it to `UnreachableCode` rather than

[PATCH] D108003: [Clang] Extend -Wbool-operation to warn about bitwise and of bools with side effects

2021-08-13 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. With several Linux kernel `defconfig` builds, I see the following instances of the warning: drivers/net/wireless/intel/iwlwifi/mvm/scan.c:835:3: warning: bitwise and of boolean expressions; did you mean logical and? [-Wbool-operation-and] drivers/staging/rtl819

[PATCH] D107933: [clang] Expose unreachable fallthrough annotation warning

2021-08-12 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. So something more along the lines of diff diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index 1555a9ee2465..0aa9a82e3d11 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/inc

[PATCH] D107933: [clang] Expose unreachable fallthrough annotation warning

2021-08-12 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. > In D107933#2942023 , @xbolva00 > wrote: > >> > > GCC does not warn (with common -Wall) for this case, right? I think Clang > should not as well. Correct, GCC does not warn at all about unreachable fallthrough annotations

[PATCH] D107933: [clang] Expose unreachable fallthrough annotation warning

2021-08-11 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance created this revision. nathanchance added reviewers: dblaikie, rsmith, nickdesaulniers. nathanchance requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The Linux kernel has a macro called IS_ENABLED(), which evaluates to a constan

[PATCH] D100581: [Clang] -Wunused-but-set-parameter and -Wunused-but-set-variable

2021-04-28 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. In D100581#2721430 , @nickdesaulniers wrote: > Huh, maybe not: https://godbolt.org/z/PnE1fMGWo This difference has caused some confusion already for the Linux kernel: https://lore.kernel.org/r/202104280827.lsczw8xg-...@int

[PATCH] D94355: [Passes] Add relative lookup table converter pass

2021-04-27 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. In D94355#2717958 , @gulfem wrote: > @nathanchance do you prefer me to revert the patch first as it might take me > a while to investigate it? > Btw, I was able to reproduce the issue by following your steps. I would say if

[PATCH] D94355: [Passes] Add relative lookup table converter pass

2021-04-26 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. In D94355#2717813 , @gulfem wrote: > Thanks for the report @nathanchance, and I'm looking at it now. Thanks! > Is this failure from one of the bots? No, this was discovered by a user of my LLVM build script: https://github

[PATCH] D94355: [Passes] Add relative lookup table converter pass

2021-04-26 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. This patch breaks a two stage build with LTO: $ git bisect log # bad: [f0bc2782f281ca05221d2f1735bbaff6c4b81ebb] [TTI] NFC: Remove unused 'OptSize' parameter from shouldMaximizeVectorBandwidth # good: [9829f5e6b1bca9b61efc629770d28bb9014dec45] [CVP] @llvm.[us

[PATCH] D98881: [RISCV] Fix mcount name

2021-03-24 Thread Nathan Chancellor via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGef58ae86ba77: [RISCV] Fix mcount name (authored by nathanchance). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews

[PATCH] D98881: [RISCV] Fix mcount name

2021-03-24 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance updated this revision to Diff 333185. nathanchance added a comment. Drop "riscv32" and "riscv64" from list of checked triples (thanks to Fangrui for catching it with a good explanation). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98

[PATCH] D98881: [RISCV] Fix mcount name

2021-03-23 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance updated this revision to Diff 332811. nathanchance retitled this revision from "[RISCV] Fix mcount name for Linux" to "[RISCV] Fix mcount name". nathanchance edited the summary of this revision. nathanchance added a comment. Herald added subscribers: frasercrmck, apazos, jocewei, the_

[PATCH] D99220: [RISCV] Fix mcount name

2021-03-23 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance created this revision. Herald added subscribers: vkmr, frasercrmck, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncoo

[PATCH] D98881: [RISCV] Fix mcount name for Linux

2021-03-18 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment. Such a diff does not look too bad: diff --git a/clang/lib/Basic/Targets/OSTargets.h b/clang/lib/Basic/Targets/OSTargets.h index 539466c4f678..c32972c1e04e 100644 --- a/clang/lib/Basic/Targets/OSTargets.h +++ b/clang/lib/Basic/Targets/OSTargets.h @@ -256,6

  1   2   >