From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,834610f4f567e94b X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.75.39 with SMTP id z7mr471384pav.26.1349261235791; Wed, 03 Oct 2012 03:47:15 -0700 (PDT) Path: g9ni18365pbh.1!nntp.google.com!news.glorb.com!news.musoftware.de!wum.musoftware.de!news.babsi.de!open-news-network.org!news.gnuher.de!news.enyo.de!.POSTED!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: Hi-Lite high integrity showcase and overflow errors Date: Wed, 03 Oct 2012 12:47:15 +0200 Message-ID: <87ehlfomrw.fsf@mid.deneb.enyo.de> References: <5045278b$0$6576$9b4e6d93@newsspool3.arcor-online.net> <9f990735-e6ca-43b3-9be5-930e8184626a@googlegroups.com> Mime-Version: 1.0 X-Trace: news.enyo.de 1349261233 4392 172.17.135.6 (3 Oct 2012 10:47:13 GMT) X-Complaints-To: news@enyo.de Cancel-Lock: sha1:j1iuUTWsK6TDCcs/jdLEGgKNXgo= Content-Type: text/plain; charset=us-ascii Date: 2012-10-03T12:47:15+02:00 List-Id: * yannick moy: > Indeed, the possible overflow in line 7 (the test in Mult) can be > raised at run-time, hence the overflow check failure when compiling > with -gnato. There's recent development in this area. In FSF GCC trunk, there is now an overflow checking mode, enabled with -gnato3, which causes the original program to behave as expected. In this mode, signed integer arithmetic does not result in intermediate overflows, and comparisons between signed integers yield the mathemtically defined result. In some cases, this requires arbitrary precision arithmetic at run time, but it really helps to avoid Constraint_Error exceptions.