public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/99376] New: Sanitizer detects undefined behaviour in rtlanal.c compiling ada
@ 2021-03-04  5:49 zeccav at gmail dot com
  2021-03-04  7:52 ` [Bug rtl-optimization/99376] " marxin at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: zeccav at gmail dot com @ 2021-03-04  5:49 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99376
           Summary: Sanitizer detects undefined behaviour in rtlanal.c
                    compiling ada
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zeccav at gmail dot com
  Target Milestone: ---

Needs option -O2

-- /home/vitti/gcc-150221-full-undefined/gcc/xgcc -S
-B/home/vitti/gcc-150221-full-undefined/gcc/
-I/home/vitti/gcc-150221-full-undefined/gcc/testsuite/ada/acats/support
~/f95/ada1.adb -O2

-- ../../gcc-150221/gcc/rtlanal.c:5060:35: runtime error: shift exponent 126 is
too large for 64-bit type 'long unsigned int'

-- rtlanal.c:5060 "nonzero &= ~((HOST_WIDE_INT_1U << result_low) - 1);"

WITH REPORT; USE REPORT;
PROCEDURE ada1 IS

     F : LONG_INTEGER;

     FUNCTION IDENT_LONG(A : LONG_INTEGER) RETURN LONG_INTEGER IS
     BEGIN
          IF EQUAL (3, 3) THEN
               RETURN A;
          ELSE
               RETURN 0;
          END IF;
     END IDENT_LONG;

     FUNCTION LONG_OK (X : LONG_INTEGER) RETURN BOOLEAN IS
     BEGIN
            return true;
     END;

BEGIN

     F := IDENT_LONG(LONG_INTEGER'FIRST);


     BEGIN
          IF LONG_OK (F*F) THEN
           return ;
          END IF;

     END;



END ada1;

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

end of thread, other threads:[~2021-03-05 11:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-04  5:49 [Bug rtl-optimization/99376] New: Sanitizer detects undefined behaviour in rtlanal.c compiling ada zeccav at gmail dot com
2021-03-04  7:52 ` [Bug rtl-optimization/99376] " marxin at gcc dot gnu.org
2021-03-04  9:50 ` [Bug rtl-optimization/99376] Sanitizer detects undefined behaviour in rtlanal.c ebotcazou at gcc dot gnu.org
2021-03-04  9:57 ` ebotcazou at gcc dot gnu.org
2021-03-04 10:04 ` [Bug rtl-optimization/99376] sanitizer " ebotcazou at gcc dot gnu.org
2021-03-05 11:47 ` cvs-commit at gcc dot gnu.org
2021-03-05 11:56 ` ebotcazou 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).