Open nathanchance opened 1 month ago
static void dispc_restore_context(struct dispc_device *dispc) {
int i, j;
for (i = 0;; i++) {
for (j = 0; j; j++)
;
{
Is it over-reduced? It looks like an infinite loop :(
It looks like it :/ The original code seems to have proper terminating conditions. Is there a way I can avoid this with cvise
(or something I could look for in the output to add to an interestingness test)?
With godbolt, it seems the problem is present with clang-18.0.1
on if we add a i < N
to the loop for N a constant lower or equal to 1 << 16
. With 17.0.1
, N
is rather 3
. That happens too with a non-constant i < n
.
The problematic IR is produced by SimplifyCFGPass
. The CFG looks like:
Then, the register allocator produce too many spills, although going to the copy BB should kill the corresponding subset of values. Maybe liveness analysis do not grasp it.
Our continuous integration noticed two new instances of
-Wframe-larger-than
when building forARCH=loongarch
although it does not appear to be LoongArch specific after reducing the file down withcvise
.With this reproducer, the stack usage is much higher than compared to GCC (which appears to use no stack at all):
The Linux kernel uses
-Wframe-larger-than=2048
. This warning appears not to occur with-Os
.