From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10882 invoked by alias); 22 Feb 2015 12:06:05 -0000 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 Received: (qmail 10819 invoked by uid 48); 22 Feb 2015 12:06:01 -0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/64432] [5 Regression] SYSTEM_CLOCK(COUNT_RATE=rate) wrong result for integer(4)::rate Date: Sun, 22 Feb 2015 12:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: NEW X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: fxcoudert at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-02/txt/msg02419.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64432 --- Comment #29 from Dominique d'Humieres --- Clean patch to avoid the errors: variable '*' set but not used --- ../_clean/gcc/fortran/trans-intrinsic.c 2015-01-17 21:48:17.000000000 +0100 +++ gcc/fortran/trans-intrinsic.c 2015-02-22 13:02:40.000000000 +0100 @@ -2670,23 +2670,15 @@ conv_intrinsic_system_clock (gfc_code *c { stmtblock_t block; gfc_se count_se, count_rate_se, count_max_se; - tree arg1 = NULL_TREE, arg2 = NULL_TREE, arg3 = NULL_TREE; - tree type, tmp; - int kind; + tree arg1 = NULL_TREE, arg2 = NULL_TREE, arg3 = NULL_TREE, + arg4 = NULL_TREE; + tree tmp; + int least, most; gfc_expr *count = code->ext.actual->expr; gfc_expr *count_rate = code->ext.actual->next->expr; gfc_expr *count_max = code->ext.actual->next->next->expr; - /* The INTEGER(8) version has higher precision, it is used if both COUNT - and COUNT_MAX can hold 64-bit values, or are absent. */ - if ((!count || count->ts.kind >= 8) - && (!count_max || count_max->ts.kind >= 8)) - kind = 8; - else - kind = gfc_default_integer_kind; - type = gfc_get_int_type (kind); - /* Evaluate our arguments. */ if (count) { For the test don't forget that real(10) are not available on some platforms and that real(16) may have different formats (I won't have access to my G5 until the end of the coming week -> no testing on powerpc).