[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 Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. In D154696#4525100 , @nathanchance wrote: > 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: > > driv

[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] D154696: [Clang] Diagnose jumps into statement expressions

2023-07-21 Thread Corentin Jabot 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 rG202191060602: [Clang] Diagnose jumps into statement expressions (authored by cor3ntin). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST AC

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

2023-07-21 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. LG! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154696/new/ https://reviews.llvm.org/D154696 ___ cfe-commits mailing list cfe-commit

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

2023-07-21 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 542813. cor3ntin added a comment. Rebase + add test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154696/new/ https://reviews.llvm.org/D154696 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/

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

2023-07-20 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. In D154696#4513510 , @cor3ntin wrote: > FYI, this can be relanded after https://reviews.llvm.org/D155342 is merged D155342 is all merged up Repository: rG LLVM Github Monorepo CHANG

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

2023-07-19 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. FYI, this can be relanded after https://reviews.llvm.org/D155342 is merged Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154696/new/ https://reviews.llvm.org/D154696 ___ cfe-com

[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] D154696: [Clang] Diagnose jumps into statement expressions

2023-07-12 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. 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 kind of brittle, what prevent incorrect jumps to be ill-formed is that we looked if a label

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

2023-07-12 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin reopened this revision. cor3ntin added a comment. This revision is now accepted and ready to land. @nathanchance Thanks for letting me know. I did revert the patch and plan to investigate later this week Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews

[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] D154696: [Clang] Diagnose jumps into statement expressions

2023-07-11 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. Thanks for the review :D Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154696/new/ https://reviews.llvm.org/D154696 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

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

2023-07-11 Thread Corentin Jabot via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. cor3ntin marked 2 inline comments as done. Closed by commit rGb0cc947b5d0a: [Clang] Diagnose jumps into statement expressions (authored by cor3ntin). Changed prior to

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

2023-07-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM though there might be a minor typo with a test comment. Comment at: clang/test/Sema/asm-goto.cpp:56 + // expected-note@+1 {{jump enters a statement expres

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

2023-07-07 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin marked 2 inline comments as done. cor3ntin added inline comments. Comment at: clang/docs/ReleaseNotes.rst:571 (`#61758 `_) +- Correcly diagnose jumps into statement expressions. + (`#63682

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

2023-07-07 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 538252. cor3ntin marked an inline comment as done. cor3ntin added a comment. Fix test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154696/new/ https://reviews.llvm.org/D154696 Files: clang/docs/ReleaseNote

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

2023-07-07 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 538250. cor3ntin marked an inline comment as done. cor3ntin added a comment. Missed a comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154696/new/ https://reviews.llvm.org/D154696 Files: clang/docs/Rel

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

2023-07-07 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 538249. cor3ntin added a comment. Address Shafik's feedback. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154696/new/ https://reviews.llvm.org/D154696 Files: clang/docs/ReleaseNotes.rst clang/include/cla

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

2023-07-07 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added inline comments. Comment at: clang/docs/ReleaseNotes.rst:571 (`#61758 `_) +- Correcly diagnose jumps into statement expressions. + (`#63682 `_)

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

2023-07-07 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin created this revision. Herald added a project: All. cor3ntin requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Such jumps are not allowed by GCC and allowing them can lead to situations where we jumps into unevaluated statements. Fi