nathanchance wrote:
This change introduces a crash with `-fsanitize=array-bounds`. A reproducer
from `cvise`:
```c
struct irq_data {
struct irq_domain *domain;
} irq_domain_fix_revmap_d;
struct irq_domain {
struct irq_domain *parent;
int revmap_size;
struct irq_data *revmap[] __attribut
nathanchance wrote:
For what it's worth, I see a new crash on the latest version of this PR, in
case it is not known.
```
$ make -skj"$(nproc)" ARCH=arm64 LLVM=1 mrproper allmodconfig
net/ipv4/udp_tunnel_nic.o
clang: /home/nathan/cbl/src/llvm-project/llvm/lib/IR/Instructions.cpp:3342:
static
nathanchance wrote:
The latest version of this change causes test failures for me:
```
$ cmake \
-B build \
-G Ninja \
-S llvm \
--log-level=NOTICE \
-Wno-dev \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COM
nathanchance wrote:
> @nathanchance can you test this please to verify it's unbreaking the linux
> kernel builds?
A quick initial test shows this resolves the two cases that I found in
https://github.com/llvm/llvm-project/issues/73168. I can do a fuller set of
builds if necessary but since th
nathanchance wrote:
For what it's worth, this resolves both the issues that I reported at
https://github.com/llvm/llvm-project/issues/73168, at least when building the
full two files that I noticed had a problem before. I can do more builds later
if necessary.
https://github.com/llvm/llvm-pro
nathanchance wrote:
I see a crash from an unreachable statement while building the Linux kernel
with debug info enabled after this change. A trivial reproducer from `cvise`:
```c
struct {
int num_counters;
long value[] __attribute__((__counted_by__(num_counters)));
} agent_send_response_por
nathanchance wrote:
Thanks, this resolves my reported issue!
https://github.com/llvm/llvm-project/pull/86017
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
nathanchance wrote:
This seems reasonable to me. From the perspective of the Linux kernel, this
seems like it should be a no-op, as we enable `-Wcast-function-type` and
disable `-Wcast-function-type-strict` (under a normal build, it is on with
`W=1`) explicitly:
```
$ rg 'cast-function-type(-
nathanchance wrote:
For what it's worth, this change adds several instances of
`-Wenum-enum-conversion` for the Linux kernel:
https://github.com/ClangBuiltLinux/linux/issues/2002. I assume this is
intentional given the nature of the change as a whole but neither the tests nor
the release note
nathanchance wrote:
> But due to I can't reproduce the failure, @nathanchance would you like to
> make this? I don't want to make something that I can't test.
I don't mind submitting something if I have some guidance around how this
should be handled (I am a little lost in this thread at the m
@@ -0,0 +1,31 @@
+// UNSUPPORTED: system-aix
+//
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+// RUN: split-file %s %t
+//
+// RUN: %clang -std=c++20 %t/mod.cppm --precompile \
+// RUN: -o %t/mod.pcm
+// RUN: %clang %t/mod.pcm -c -o %t/mod.o
+// RUN: %clang -shared %t/mod.o -o %t/
@@ -0,0 +1,31 @@
+// UNSUPPORTED: system-aix
+//
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+// RUN: split-file %s %t
+//
+// RUN: %clang -std=c++20 %t/mod.cppm --precompile \
+// RUN: -o %t/mod.pcm
+// RUN: %clang %t/mod.pcm -c -o %t/mod.o
+// RUN: %clang -shared %t/mod.o -o %t/
nathanchance wrote:
For what it's worth, this test appears to fail when
`LLVM_DEFAULT_TARGET_TRIPLE` is changed (my script sets it to the output of my
Linux distribution's `clang -print-target-triple`)
```
error: PCH file was compiled for the target 'x86_64-pc-linux-gnu' but the
current trans
nathanchance wrote:
This is out of my wheelhouse to debug to be honest but it seems to me that
`clang-repl` does not respect `LLVM_DEFAULT_TARGET_TRIPLE` somehow? This test
does the same thing as other tests to build modules but this appears to be the
only one that uses `clang-repl` to consume
nathanchance wrote:
@vgvassilev Yes, it appears so, I tried one of the examples from [the
documentation](https://clang.llvm.org/docs/ClangRepl.html) since I have no
prior experience with `clang-repl`.
```
$ clang-repl --version
LLVM (http://llvm.org/):
LLVM version 19.0.0git
Optimized buil
Author: Nathan Chancellor
Date: 2021-08-16T17:14:55-07:00
New Revision: 9ed4a94d6451046a51ef393cd62f00710820a7e8
URL:
https://github.com/llvm/llvm-project/commit/9ed4a94d6451046a51ef393cd62f00710820a7e8
DIFF:
https://github.com/llvm/llvm-project/commit/9ed4a94d6451046a51ef393cd62f00710820a7e8.d
Author: Nathan Chancellor
Date: 2023-07-21T15:57:03-07:00
New Revision: 17f4f262fc5c4361cf43e91f2137ff7b2dcadc62
URL:
https://github.com/llvm/llvm-project/commit/17f4f262fc5c4361cf43e91f2137ff7b2dcadc62
DIFF:
https://github.com/llvm/llvm-project/commit/17f4f262fc5c4361cf43e91f2137ff7b2dcadc62.d
Author: Nathan Chancellor
Date: 2023-08-08T13:41:21-07:00
New Revision: a22d385f9656c95f5ce4155ea705aab6f8ef6d82
URL:
https://github.com/llvm/llvm-project/commit/a22d385f9656c95f5ce4155ea705aab6f8ef6d82
DIFF:
https://github.com/llvm/llvm-project/commit/a22d385f9656c95f5ce4155ea705aab6f8ef6d82.d
https://github.com/nathanchance review_requested
https://github.com/llvm/llvm-project/pull/65657
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nathanchance created
https://github.com/llvm/llvm-project/pull/65657:
When building the LoongArch Linux kernel without `CONFIG_DYNAMIC_FTRACE`, the
build fails to link because the mcount symbol is `mcount`, not `_mcount` like
GCC generates and the kernel expects:
```
ld.lld
https://github.com/nathanchance review_requested
https://github.com/llvm/llvm-project/pull/65657
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nathanchance review_requested
https://github.com/llvm/llvm-project/pull/65657
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
nathanchance wrote:
cc @xen0n
https://github.com/llvm/llvm-project/pull/65657
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nathanchance closed
https://github.com/llvm/llvm-project/pull/65657
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Author: Nathan Chancellor
Date: 2023-06-05T10:54:47-07:00
New Revision: 877210faa447f4cc7db87812f8ed80e398fedd61
URL:
https://github.com/llvm/llvm-project/commit/877210faa447f4cc7db87812f8ed80e398fedd61
DIFF:
https://github.com/llvm/llvm-project/commit/877210faa447f4cc7db87812f8ed80e398fedd61.d
Author: Nathan Chancellor
Date: 2023-06-05T12:14:51-07:00
New Revision: deecf89a1361cf3407f0fe32e7085127ec0865dc
URL:
https://github.com/llvm/llvm-project/commit/deecf89a1361cf3407f0fe32e7085127ec0865dc
DIFF:
https://github.com/llvm/llvm-project/commit/deecf89a1361cf3407f0fe32e7085127ec0865dc.d
nathanchance wrote:
For what it's worth, this breaks building the Linux kernel for `ARCH=arm64`
pretty badly, with errors in several drivers:
```
$ make -skj"$(nrpoc)" ARCH=arm64 LLVM=1 mrproper defconfig all
...
drivers/clk/qcom/gcc-ipq6018.c:896:2: error: expression requires 'double' type
su
nathanchance wrote:
This does not appear to drop `clang/test/Driver/aarch64-soft-float-abi.c` which
was added by that change, do the tests pass with that test still present? I am
guessing there was a conflict because of the forward fix in
5b8e7ed787f6e537876c4fdafd070eba9681f343.
Regardless,
nathanchance wrote:
I am seeing a lot of
```
'-3dnow' is not a recognized feature for this target (ignoring feature)
'-3dnowa' is not a recognized feature for this target (ignoring feature)
```
while building the Linux kernel (which has `-mno-3dnow` in
`arch/x86/Makefile`), is this intentional
nathanchance wrote:
I see a crash in `drivers/thermal/thermal_core.c` in Linux kernels without
commit
[daeeb032f42d](https://git.kernel.org/linus/daeeb032f42d066a49e07b7f6effc9f51b7a5479)
("thermal: core: Move threshold out of struct thermal_trip") after this
change. `cvise` spits out:
```c
Author: Nathan Chancellor
Date: 2021-12-23T12:36:42-07:00
New Revision: be8180af5854806a343c3dd334d97ba2c4bfadfa
URL:
https://github.com/llvm/llvm-project/commit/be8180af5854806a343c3dd334d97ba2c4bfadfa
DIFF:
https://github.com/llvm/llvm-project/commit/be8180af5854806a343c3dd334d97ba2c4bfadfa.d
Author: Nathan Chancellor
Date: 2021-03-24T18:11:37-07:00
New Revision: ef58ae86ba778ed7d01cd3f6bd6d08f943abab44
URL:
https://github.com/llvm/llvm-project/commit/ef58ae86ba778ed7d01cd3f6bd6d08f943abab44
DIFF:
https://github.com/llvm/llvm-project/commit/ef58ae86ba778ed7d01cd3f6bd6d08f943abab44.d
nathanchance wrote:
With [my series to fix
`arch/powerpc`](https://git.kernel.org/pub/scm/linux/kernel/git/nathan/linux.git/log/?h=b4/powerpc-fix-stackprotector-test-clang)
for this implementation applied to Linux, `CONFIG_HAVE_STACKPROTECTOR` is
properly set and the Linux kernel dump test mod
nathanchance wrote:
Is it expected that this warns for C code? I only see `cxx` in this change but
I see a new instance of this warning in my Linux kernel builds:
```
drivers/net/ethernet/netronome/nfp/nfdk/rings.c:60:18: warning: first argument
in call to '__builtin_memset' is a pointer to no
nathanchance wrote:
> @nathanchance could you share your preprocessed source so that I can get a
> reproducer? Thanks!
Sure thing!
```
$ clang --target=x86_64-linux-gnu -fcf-protection -fsyntax-only
-Wno-{address-of-packed-member,constant-logical-operand,gnu,unused-value}
-Wnontrivial-memacc
@@ -3605,7 +3605,8 @@ static void RenderSSPOptions(const Driver &D, const
ToolChain &TC,
StringRef Value = A->getValue();
if (!EffectiveTriple.isX86() && !EffectiveTriple.isAArch64() &&
!EffectiveTriple.isARM() && !EffectiveTriple.isThumb() &&
-!Effecti
nathanchance wrote:
This breaks `ARCH=arm64 allmodconfig` for me.
```
$ echo CONFIG_WERROR=n >kernel/configs/no-werror.config
$ make -skj"$(nproc)" ARCH=arm64 LLVM=1 mrproper {allmod,no-werror.}config
drivers/net/ethernet/sfc/falcon/falcon.o
PLEASE submit a bug report to https://github.com/llv
@@ -0,0 +1,85 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 5
+// RUN: %clang_cc1 -triple aarch64-unknown-linux-gnu -DCOUNTED_BY -O2 -Wall
-Wno-int-conversion -fsanitize=array-bounds,object-size,local-bounds
-fstrict-flex-
nathanchance wrote:
This tentatively looks good to me. Do you need a reduced test case for this?
`cvise` gave me:
```c
typedef struct {
char __padding[0];
} spinlock_t;
struct {
int priv_len;
spinlock_t addr_list_lock;
char *dev_addr;
char priv[] __attribute__((__counted_by__(priv_len
nathanchance wrote:
@nikic I noticed your comment on #118472 (the motivator for this change AFAICT):
> `-fwrapv` should already cover pointers
but it does not seem like this warning takes that into account (see the last
example below)? I noticed a few instances of this warning in the Linux ker
https://github.com/nathanchance updated
https://github.com/llvm/llvm-project/pull/120480
>From 0eb68a5e438701a92dcedefc26a99c8dd48d0bed Mon Sep 17 00:00:00 2001
From: Nathan Chancellor
Date: Wed, 18 Dec 2024 14:03:14 -0700
Subject: [PATCH 1/3] [Sema] Fix tautological bounds check warning with -
https://github.com/nathanchance closed
https://github.com/llvm/llvm-project/pull/120480
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nathanchance created
https://github.com/llvm/llvm-project/pull/120480
The tautological bounds check warning added in #120222 does not take into
account whether signed integer overflow is well defined or not, which could
result in a developer removing a bounds check that may
nathanchance wrote:
> @nathanchance You are correct, this warning should indeed respect
> `-fwrapv`/`-fno-strict-overflow`. Your patch looks reasonable to me as well.
Thanks for the confirmation, I have submitted
https://github.com/llvm/llvm-project/pull/120480 for this.
https://github.com/ll
https://github.com/nathanchance updated
https://github.com/llvm/llvm-project/pull/120480
>From 0eb68a5e438701a92dcedefc26a99c8dd48d0bed Mon Sep 17 00:00:00 2001
From: Nathan Chancellor
Date: Wed, 18 Dec 2024 14:03:14 -0700
Subject: [PATCH 1/2] [Sema] Fix tautological bounds check warning with -
@@ -1,40 +1,72 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -DFWRAPV -fwrapv -verify %s
nathanchance wrote:
Ah yes, that is much cleaner. Done in 8504a0d758c06fa9f3b95117fdb05021d75afe8d.
https://github.com/llvm/llvm-project/
46 matches
Mail list logo