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

To reply to this bug, email your comments to 78019 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-diffutils <at> gnu.org:
bug#78019; Package diffutils. (Wed, 23 Apr 2025 17:58:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christian Hesse <list <at> eworm.de>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Wed, 23 Apr 2025 17:58:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christian Hesse <list <at> eworm.de>
To: bug-diffutils <at> gnu.org
Subject: 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)]

Information forwarded to bug-diffutils <at> gnu.org:
bug#78019; Package diffutils. (Wed, 23 Apr 2025 18:58:04 GMT) Full text and rfc822 format available.

Message #8 received at 78019 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Christian Hesse <list <at> eworm.de>
Cc: 78019 <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#78019: LTO build fails with diffutils 3.12
Date: Wed, 23 Apr 2025 11:56:54 -0700
These are false positives from GCC. I worked around the last one by 
installing the attached patch. The others are due to GCC bug 80922 
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80922>.

How are you invoking 'configure' and 'make', to enable -flto? Perhaps 
diffutils can work around the other GCC bugs by looking at the arguments 
to 'configure' and 'make' and disabling -Wmaybe-uninitialized if you're 
using -flto.




This bug report was last modified 1 day ago.

Previous Next


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