public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/81986] sanitizer detects negation of large number in string.c
       [not found] <bug-81986-4@http.gcc.gnu.org/bugzilla/>
@ 2021-02-27  9:21 ` zeccav at gmail dot com
  2021-02-28 11:04 ` dominiq at lps dot ens.fr
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: zeccav at gmail dot com @ 2021-02-27  9:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81986

Vittorio Zecca <zeccav at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|sanitizer                   |libfortran

--- Comment #4 from Vittorio Zecca <zeccav at gmail dot com> ---
On current trunk with sanitized libgfortran.so.5 I get

gfortran gfbug142.f
ldd ./a.out
        ........
        libgfortran.so.5 =>
/home/vitti/gcc-150221-undefined/x86_64-pc-linux-gnu/libgfortran/.libs/libgfortran.so.5
(0x000014a739133000)
        libubsan.so.1 =>
/home/vitti/local/gcc-150221-undefined/lib/../lib64/libubsan.so.1
(0x000014a738293000)
        libstdc++.so.6 =>
/home/vitti/local/gcc-150221-undefined/lib/../lib64/libstdc++.so.6
        ................

./a.out
../../../gcc-150221/libgfortran/io/write.c:835:7: runtime error: negation of
0x80000000000000000000000000000000 cannot be represented in type '__int128';
cast to an unsigned type to negate this value to itself
../../../gcc-150221/libgfortran/runtime/string.c:199:11: runtime error:
negation of 0x80000000000000000000000000000000 cannot be represented in type
'__int128'; cast to an unsigned type to negate this value to itself
80000000000000000000000000000000

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libfortran/81986] sanitizer detects negation of large number in string.c
       [not found] <bug-81986-4@http.gcc.gnu.org/bugzilla/>
  2021-02-27  9:21 ` [Bug libfortran/81986] sanitizer detects negation of large number in string.c zeccav at gmail dot com
@ 2021-02-28 11:04 ` dominiq at lps dot ens.fr
  2021-03-03  7:08 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: dominiq at lps dot ens.fr @ 2021-02-28 11:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81986

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-02-28
             Status|UNCONFIRMED                 |NEW

--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libfortran/81986] sanitizer detects negation of large number in string.c
       [not found] <bug-81986-4@http.gcc.gnu.org/bugzilla/>
  2021-02-27  9:21 ` [Bug libfortran/81986] sanitizer detects negation of large number in string.c zeccav at gmail dot com
  2021-02-28 11:04 ` dominiq at lps dot ens.fr
@ 2021-03-03  7:08 ` cvs-commit at gcc dot gnu.org
  2021-03-03 11:03 ` dominiq at lps dot ens.fr
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-03  7:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81986

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tobias Burnus <burnus@gcc.gnu.org>:

https://gcc.gnu.org/g:006693a59f7cd1310aed53a2816020bedf1fb742

commit r11-7470-g006693a59f7cd1310aed53a2816020bedf1fb742
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Wed Mar 3 08:05:45 2021 +0100

    libgfortran: Fix negation for largest integer [PR81986]

    libgfortran/ChangeLog:
    2021-03-01  Vittorio Zecca  <zeccav@gmail.com>
                Tobias Burnus  <tobias@codesourcery.com>

            PR libfortran/81986
            * runtime/string.c (gfc_itoa): Cast to unsigned before
            negating.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libfortran/81986] sanitizer detects negation of large number in string.c
       [not found] <bug-81986-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-03-03  7:08 ` cvs-commit at gcc dot gnu.org
@ 2021-03-03 11:03 ` dominiq at lps dot ens.fr
  2021-12-25 13:04 ` fxcoudert at gcc dot gnu.org
  2021-12-25 14:57 ` fxcoudert at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: dominiq at lps dot ens.fr @ 2021-03-03 11:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81986

--- Comment #7 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
r11-7470 fixes the first runtime error, but I still see

../../../work/libgfortran/io/write.c:835:7: runtime error: negation of
0x80000000000000000000000000000000 cannot be represented in type '__int128';
cast to an unsigned type to negate this value to itself

This is in

  sign = calculate_sign (dtp, n < 0);
  if (n < 0)
    n = -n;
  nsign = sign == S_NONE ? 0 : 1;

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libfortran/81986] sanitizer detects negation of large number in string.c
       [not found] <bug-81986-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-03-03 11:03 ` dominiq at lps dot ens.fr
@ 2021-12-25 13:04 ` fxcoudert at gcc dot gnu.org
  2021-12-25 14:57 ` fxcoudert at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2021-12-25 13:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81986

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu.org

--- Comment #8 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Will be fixed by patch at
https://gcc.gnu.org/pipermail/fortran/2021-December/057218.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libfortran/81986] sanitizer detects negation of large number in string.c
       [not found] <bug-81986-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2021-12-25 13:04 ` fxcoudert at gcc dot gnu.org
@ 2021-12-25 14:57 ` fxcoudert at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2021-12-25 14:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81986

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|---                         |12.0
             Status|NEW                         |RESOLVED

--- Comment #9 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-25 14:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-81986-4@http.gcc.gnu.org/bugzilla/>
2021-02-27  9:21 ` [Bug libfortran/81986] sanitizer detects negation of large number in string.c zeccav at gmail dot com
2021-02-28 11:04 ` dominiq at lps dot ens.fr
2021-03-03  7:08 ` cvs-commit at gcc dot gnu.org
2021-03-03 11:03 ` dominiq at lps dot ens.fr
2021-12-25 13:04 ` fxcoudert at gcc dot gnu.org
2021-12-25 14:57 ` fxcoudert at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).