From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7051E386102B; Sat, 27 Feb 2021 09:21:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7051E386102B From: "zeccav at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/81986] sanitizer detects negation of large number in string.c Date: Sat, 27 Feb 2021 09:21:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Version: 8.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zeccav at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: component Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2021 09:21:58 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D81986 Vittorio Zecca changed: What |Removed |Added ---------------------------------------------------------------------------- Component|sanitizer |libfortran --- Comment #4 from Vittorio Zecca --- On current trunk with sanitized libgfortran.so.5 I get gfortran gfbug142.f ldd ./a.out ........ libgfortran.so.5 =3D> /home/vitti/gcc-150221-undefined/x86_64-pc-linux-gnu/libgfortran/.libs/libg= fortran.so.5 (0x000014a739133000) libubsan.so.1 =3D> /home/vitti/local/gcc-150221-undefined/lib/../lib64/libubsan.so.1 (0x000014a738293000) libstdc++.so.6 =3D> /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=