GNU bug report logs - #53256
Compiling 3.8 with nvhpc 22.1 : malloca.c 64 bits operations with signed and unsigned operands are currently unsupported by __builtin_add_overflow

Previous Next

Package: diffutils;

Reported by: Olivier Cessenat <cessenat <at> gmail.com>

Date: Fri, 14 Jan 2022 14:00:03 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53256 in the body.
You can then email your comments to 53256 AT debbugs.gnu.org in the normal way.

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#53256; Package diffutils. (Fri, 14 Jan 2022 14:00:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Olivier Cessenat <cessenat <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Fri, 14 Jan 2022 14:00:03 GMT) Full text and rfc822 format available.

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

From: Olivier Cessenat <cessenat <at> gmail.com>
To: bug-diffutils <at> gnu.org
Subject: Compiling 3.8 with nvhpc 22.1 : malloca.c 64 bits operations with
 signed and unsigned operands are currently unsupported by
 __builtin_add_overflow
Date: Fri, 14 Jan 2022 12:33:40 +0100
Hello,

I'm trying to compile diffutils 3.8 with nvc 22.1.

I get an error:

<<

"diffutils-3.8/lib/malloca.c", line 52: error: 64 bits operations with 
signed and unsigned operands are currently unsupported by 
__builtin_add_overflow
    if (!INT_ADD_WRAPV (n, plus, &nplus) && !xalloc_oversized (nplus, 1))
         ^

1 error detected in the compilation of "diffutils-3.8/lib/malloca.c".
>>

It was fine with 3.7.

Thanks for your help.

Olivier Cessenat


Ubuntu 20.04 - compilation still fine with gcc 9.3.0






Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Sat, 15 Jan 2022 03:54:01 GMT) Full text and rfc822 format available.

Notification sent to Olivier Cessenat <cessenat <at> gmail.com>:
bug acknowledged by developer. (Sat, 15 Jan 2022 03:54:01 GMT) Full text and rfc822 format available.

Message #10 received at 53256-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Olivier Cessenat <cessenat <at> gmail.com>
Cc: Gnulib bugs <bug-gnulib <at> gnu.org>, 53256-done <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#53256: Compiling 3.8 with nvhpc 22.1 :
 malloca.c 64 bits operations with signed and unsigned operands are currently
 unsupported by __builtin_add_overflow
Date: Fri, 14 Jan 2022 19:53:39 -0800
[Message part 1 (text/plain, inline)]
On 1/14/22 03:33, Olivier Cessenat wrote:
> "diffutils-3.8/lib/malloca.c", line 52: error: 64 bits operations with 
> signed and unsigned operands are currently unsupported by 
> __builtin_add_overflow

Thanks for the bug report. Although nvc 22.1 defines __GNUC__ to be 11 
which means it supports GNU C as of GCC 11, that's obviously untrue for 
__builtin_add_overflow. That's unfortunate. Perhaps you could report 
this as a bug to NVIDIA, as their compiler shouldn't claim to support 
GNU C features that it lacks. nvc can set __GNUC__ to be the version of 
GNU C that it actually does support.

To work around the bug I installed the attached into Gnulib and this 
should appear in the next diffutils release. In the meantime you can 
compile with gcc.
[0001-intprops-work-around-nvc-22.1-bug.patch (text/x-patch, attachment)]

Information forwarded to bug-diffutils <at> gnu.org:
bug#53256; Package diffutils. (Sat, 15 Jan 2022 08:36:02 GMT) Full text and rfc822 format available.

Message #13 received at 53256-done <at> debbugs.gnu.org (full text, mbox):

From: Olivier Cessenat <cessenat <at> gmail.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Gnulib bugs <bug-gnulib <at> gnu.org>, 53256-done <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#53256: Compiling 3.8 with nvhpc 22.1 :
 malloca.c 64 bits operations with signed and unsigned operands are currently
 unsupported by __builtin_add_overflow
Date: Sat, 15 Jan 2022 09:35:48 +0100
Thanks so much ! It's great.

I will try to report the bug to NVIDIA, but that will be with my words, 
I do not have the full understanding of the problem.

Olivier Cessenat

Le 15/01/2022 à 04:53, Paul Eggert a écrit :
> On 1/14/22 03:33, Olivier Cessenat wrote:
>> "diffutils-3.8/lib/malloca.c", line 52: error: 64 bits operations 
>> with signed and unsigned operands are currently unsupported by 
>> __builtin_add_overflow
>
> Thanks for the bug report. Although nvc 22.1 defines __GNUC__ to be 11 
> which means it supports GNU C as of GCC 11, that's obviously untrue 
> for __builtin_add_overflow. That's unfortunate. Perhaps you could 
> report this as a bug to NVIDIA, as their compiler shouldn't claim to 
> support GNU C features that it lacks. nvc can set __GNUC__ to be the 
> version of GNU C that it actually does support.
>
> To work around the bug I installed the attached into Gnulib and this 
> should appear in the next diffutils release. In the meantime you can 
> compile with gcc.




Information forwarded to bug-diffutils <at> gnu.org:
bug#53256; Package diffutils. (Sat, 15 Jan 2022 10:01:01 GMT) Full text and rfc822 format available.

Message #16 received at 53256-done <at> debbugs.gnu.org (full text, mbox):

From: Olivier Cessenat <cessenat <at> gmail.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Gnulib bugs <bug-gnulib <at> gnu.org>, 53256-done <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#53256: Compiling 3.8 with nvhpc 22.1 :
 malloca.c 64 bits operations with signed and unsigned operands are currently
 unsupported by __builtin_add_overflow
Date: Sat, 15 Jan 2022 11:00:25 +0100
Hello again,

Sorry for the noise but I failed to apply the patch to 3.8 both for 
ChangeLog and lib/intprops.h

Could you make sure it works for 3.8 ?

Thanks

Le 15/01/2022 à 09:35, Olivier Cessenat a écrit :
> Thanks so much ! It's great.
>
> I will try to report the bug to NVIDIA, but that will be with my 
> words, I do not have the full understanding of the problem.
>
> Olivier Cessenat
>
> Le 15/01/2022 à 04:53, Paul Eggert a écrit :
>> On 1/14/22 03:33, Olivier Cessenat wrote:
>>> "diffutils-3.8/lib/malloca.c", line 52: error: 64 bits operations 
>>> with signed and unsigned operands are currently unsupported by 
>>> __builtin_add_overflow
>>
>> Thanks for the bug report. Although nvc 22.1 defines __GNUC__ to be 
>> 11 which means it supports GNU C as of GCC 11, that's obviously 
>> untrue for __builtin_add_overflow. That's unfortunate. Perhaps you 
>> could report this as a bug to NVIDIA, as their compiler shouldn't 
>> claim to support GNU C features that it lacks. nvc can set __GNUC__ 
>> to be the version of GNU C that it actually does support.
>>
>> To work around the bug I installed the attached into Gnulib and this 
>> should appear in the next diffutils release. In the meantime you can 
>> compile with gcc.




Information forwarded to bug-diffutils <at> gnu.org:
bug#53256; Package diffutils. (Sat, 15 Jan 2022 12:25:01 GMT) Full text and rfc822 format available.

Message #19 received at 53256-done <at> debbugs.gnu.org (full text, mbox):

From: Jeffrey Walton <noloader <at> gmail.com>
To: 53256-done <at> debbugs.gnu.org
Cc: Gnulib bugs <bug-gnulib <at> gnu.org>
Subject: Re: [bug-diffutils] bug#53256: Compiling 3.8 with nvhpc 22.1 :
 malloca.c 64 bits operations with signed and unsigned operands are currently
 unsupported by __builtin_add_overflow
Date: Sat, 15 Jan 2022 07:24:38 -0500
On Fri, Jan 14, 2022 at 10:53 PM Paul Eggert <eggert <at> cs.ucla.edu> wrote:
> ...
> Thanks for the bug report. Although nvc 22.1 defines __GNUC__ to be 11
> which means it supports GNU C as of GCC 11, that's obviously untrue for
> __builtin_add_overflow. That's unfortunate. Perhaps you could report
> this as a bug to NVIDIA, as their compiler shouldn't claim to support
> GNU C features that it lacks. nvc can set __GNUC__ to be the version of
> GNU C that it actually does support.

The GCC folks don't approve of other compilers setting __GNUC__. It's
a GCC define, and other compilers should not be defining it. The GCC
folks recommend filing a bug with the other compiler for defining
__GNUC__. [1]

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61146#c2

Jeff




Information forwarded to bug-diffutils <at> gnu.org:
bug#53256; Package diffutils. (Sat, 15 Jan 2022 21:04:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Olivier Cessenat <cessenat <at> gmail.com>
Cc: 53256 <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#53256: Compiling 3.8 with nvhpc 22.1 :
 malloca.c 64 bits operations with signed and unsigned operands are currently
 unsupported by __builtin_add_overflow
Date: Sat, 15 Jan 2022 13:03:07 -0800
On 1/15/22 02:00, Olivier Cessenat wrote:
> Could you make sure it works for 3.8 ?

Backporting would be some work and I've got other things on my plate.

Can you compile with gcc instead? That would be easiest.

If you can't use gcc for some reason (what is it?), then you can try 
building from git, like this:

git clone https://git.savannah.gnu.org/git/diffutils.git
cd diffutils
./bootstrap
./configure CC=nvc
make WERROR_CFLAGS= check

Ignore all the bogus warnings that nvc generates.

For this latter approach you will need developer tools; see 
README-hacking and README-prereq.




Information forwarded to bug-diffutils <at> gnu.org:
bug#53256; Package diffutils. (Mon, 17 Jan 2022 17:09:02 GMT) Full text and rfc822 format available.

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

From: Olivier Cessenat <cessenat <at> gmail.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 53256 <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#53256: Compiling 3.8 with nvhpc 22.1 :
 malloca.c 64 bits operations with signed and unsigned operands are currently
 unsupported by __builtin_add_overflow
Date: Mon, 17 Jan 2022 18:08:13 +0100
Hello Paul,

Thanks again for your help. Thanks to your indications for bootstrap, I 
made a very basic patch to 3.8 which I'm submitting to spack

https://github.com/spack/spack/pull/28451

I could as you suggest compile with gcc, but now that it runs smoothly I 
prefer to stick to nvc for the whole chain.

Cheers,

Olivier Cessenat

Le 15/01/2022 à 22:03, Paul Eggert a écrit :
> On 1/15/22 02:00, Olivier Cessenat wrote:
>> Could you make sure it works for 3.8 ?
>
> Backporting would be some work and I've got other things on my plate.
>
> Can you compile with gcc instead? That would be easiest.
>
> If you can't use gcc for some reason (what is it?), then you can try 
> building from git, like this:
>
> git clone https://git.savannah.gnu.org/git/diffutils.git
> cd diffutils
> ./bootstrap
> ./configure CC=nvc
> make WERROR_CFLAGS= check
>
> Ignore all the bogus warnings that nvc generates.
>
> For this latter approach you will need developer tools; see 
> README-hacking and README-prereq.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 15 Feb 2022 12:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 43 days ago.

Previous Next


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