From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30565 invoked by alias); 12 Dec 2008 15:17:22 -0000 Received: (qmail 28272 invoked by uid 48); 12 Dec 2008 15:15:37 -0000 Date: Fri, 12 Dec 2008 15:17:00 -0000 Message-ID: <20081212151537.28270.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/38504] double minus sign when printing integer? In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "kargl at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-12/txt/msg01342.txt.bz2 ------- Comment #3 from kargl at gcc dot gnu dot org 2008-12-12 15:15 ------- (In reply to comment #1) > Sort of confirmed. You are aware that 'value-1' corresponds to > '-HUGE(value)-1', which is out of range for integer numbers of that kind? > ( Ihaven't had my morning coffe, but ...) No. It is in range. It is the only way (other than TRANSFER) to get the most negative integer value in a simple assignment. Now, if you write value = 9223372036854775807_i8_ + 1 write(*, FMT="(i22)") value, HUGE(value)+1 This results in out of range values, and wrap around semantics still gives --9223372036854775808 --9223372036854775808 Also, note that if one uses integer(4), you get the right output. -2147483647 -2147483647 -2147483648 -2147483648 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38504