GNU bug report logs - #78019
LTO build fails with diffutils 3.12

Previous Next

Package: diffutils;

Reported by: Christian Hesse <list <at> eworm.de>

Date: Wed, 23 Apr 2025 17:58:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Christian Hesse <list <at> eworm.de>
To: 78019 <at> debbugs.gnu.org
Subject: bug#78019: LTO build fails with diffutils 3.12
Date: Wed, 23 Apr 2025 19:56:17 +0200
[Message part 1 (text/plain, inline)]
Hello everybody,

I am building diffutils 3.12 in a clean build environment for Arch Linux. That
fails when building with link time optimization is enabled:

In function 'diag',
    inlined from 'compareseq' at ../lib/diffseq.h:515:7:
../lib/diffseq.h:426:36: error: 'fxbest' may be used uninitialized [-Werror=maybe-uninitialized]
  426 |               part->ymid = fxybest - fxbest;
      |                                    ^
../lib/diffseq.h: In function 'compareseq':
../lib/diffseq.h:387:32: note: 'fxbest' was declared here
  387 |           OFFSET fxybest = -1, fxbest;
      |                                ^
In function 'diag',
    inlined from 'compareseq' at ../lib/diffseq.h:515:7:
../lib/diffseq.h:433:36: error: 'bxbest' may be used uninitialized [-Werror=maybe-uninitialized]
  433 |               part->ymid = bxybest - bxbest;
      |                                    ^
../lib/diffseq.h: In function 'compareseq':
../lib/diffseq.h:405:40: note: 'bxbest' was declared here
  405 |           OFFSET bxybest = OFFSET_MAX, bxbest;
      |                                        ^
sdiff.c: In function 'edit':
sdiff.c:957:11: error: 'cmd1' may be used uninitialized [-Werror=maybe-uninitialized]
  957 |           switch (cmd1)
      |           ^
sdiff.c:861:11: note: 'cmd1' was declared here
  861 |       int cmd1;
      |           ^
lto1: all warnings being treated as errors

The build succeed as soon as I disable link time optimization. Would be nice
to have a fix for this to reenable lto. Let me know if I can provide more
information on this. Thanks!
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}
[Message part 2 (application/pgp-signature, inline)]

This bug report was last modified 150 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.