public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dominiq at lps dot ens.fr" <gcc-bugzilla@gcc.gnu.org>
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:06:00 -0000	[thread overview]
Message-ID: <bug-64432-4-ajb7Sg8LvC@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-64432-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #28 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Bootstrapping with the patch in comment 26 fails with

/opt/gcc/build_w/./prev-gcc/xg++ -B/opt/gcc/build_w/./prev-gcc/
-B/opt/gcc/gcc4.10w/x86_64-apple-darwin14.1.0/bin/ -nostdinc++
-B/opt/gcc/build_w/prev-x86_64-apple-darwin14.1.0/libstdc++-v3/src/.libs
-B/opt/gcc/build_w/prev-x86_64-apple-darwin14.1.0/libstdc++-v3/libsupc++/.libs 
-I/opt/gcc/build_w/prev-x86_64-apple-darwin14.1.0/libstdc++-v3/include/x86_64-apple-darwin14.1.0
 -I/opt/gcc/build_w/prev-x86_64-apple-darwin14.1.0/libstdc++-v3/include 
-I/opt/gcc/work/libstdc++-v3/libsupc++
-L/opt/gcc/build_w/prev-x86_64-apple-darwin14.1.0/libstdc++-v3/src/.libs
-L/opt/gcc/build_w/prev-x86_64-apple-darwin14.1.0/libstdc++-v3/libsupc++/.libs
-c  -DIN_GCC_FRONTEND -g -O2  -gtoggle -DIN_GCC    -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common
 -DHAVE_CONFIG_H -I. -Ifortran -I../../work/gcc -I../../work/gcc/fortran
-I../../work/gcc/../include -I./../intl -I../../work/gcc/../libcpp/include
-I/opt/mp-new/include  -I../../work/gcc/../libdecnumber
-I../../work/gcc/../libdecnumber/dpd -I../libdecnumber
-I../../work/gcc/../libbacktrace -I/opt/mp-new/include  -o
fortran/trans-intrinsic.o -MT fortran/trans-intrinsic.o -MMD -MP -MF
fortran/.deps/trans-intrinsic.TPo ../../work/gcc/fortran/trans-intrinsic.c
../../work/gcc/fortran/trans-intrinsic.c: In function 'tree_node*
conv_intrinsic_system_clock(gfc_code*)':
../../work/gcc/fortran/trans-intrinsic.c:2675:8: error: variable 'type' set but
not used [-Werror=unused-but-set-variable]
   tree type, tmp;
        ^
cc1plus: all warnings being treated as errors

../../work/gcc/fortran/trans-intrinsic.c: In function 'tree_node*
conv_intrinsic_system_clock(gfc_code*)':
../../work/gcc/fortran/trans-intrinsic.c:2676:7: error: variable 'kind' set but
not used [-Werror=unused-but-set-variable]
   int kind, least, most;
       ^
cc1plus: all warnings being treated as errors

The following patch (code commented) fixes bootstrap

--- ../_clean/gcc/fortran/trans-intrinsic.c    2015-01-17 21:48:17.000000000
+0100
+++ gcc/fortran/trans-intrinsic.c    2015-02-22 11:48:14.000000000 +0100
@@ -2670,9 +2670,10 @@ 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;
@@ -2680,12 +2681,12 @@ conv_intrinsic_system_clock (gfc_code *c

   /* 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)
+  /* 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);
+    kind = gfc_default_integer_kind; */
+  /* type = gfc_get_int_type (kind); */

   /* Evaluate our arguments.  */
   if (count)


  parent reply	other threads:[~2015-02-22 11:01 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-29 10:44 [Bug fortran/64432] New: " anlauf at gmx dot de
2014-12-29 11:14 ` [Bug fortran/64432] " anlauf at gmx dot de
2014-12-29 11:18 ` anlauf at gmx dot de
2014-12-29 11:20 ` janus at gcc dot gnu.org
2014-12-29 11:21 ` janus at gcc dot gnu.org
2014-12-29 14:13 ` fxcoudert at gcc dot gnu.org
2014-12-29 15:04 ` anlauf at gmx dot de
2014-12-29 15:23 ` anlauf at gmx dot de
2014-12-30  9:48 ` Joost.VandeVondele at mat dot ethz.ch
2014-12-30 10:05 ` Joost.VandeVondele at mat dot ethz.ch
2015-01-04 21:47 ` anlauf at gmx dot de
2015-01-04 21:56 ` anlauf at gmx dot de
2015-01-04 22:04 ` fxcoudert at gcc dot gnu.org
2015-01-04 22:53 ` anlauf at gmx dot de
2015-01-09 11:20 ` rguenth at gcc dot gnu.org
2015-01-09 14:12 ` jakub at gcc dot gnu.org
2015-01-19 20:49 ` anlauf at gmx dot de
2015-02-11 21:20 ` jvdelisle at gcc dot gnu.org
2015-02-13 22:31 ` anlauf at gmx dot de
2015-02-15  4:59 ` jvdelisle at gcc dot gnu.org
2015-02-16  3:14 ` jvdelisle at gcc dot gnu.org
2015-02-16 12:04 ` anlauf at gmx dot de
2015-02-16 20:04 ` jvdelisle at gcc dot gnu.org
2015-02-18  4:21 ` jvdelisle at gcc dot gnu.org
2015-02-18 20:04 ` anlauf at gmx dot de
2015-02-18 20:12 ` anlauf at gmx dot de
2015-02-19 16:32 ` jvdelisle at gcc dot gnu.org
2015-02-20 17:11 ` jvdelisle at gcc dot gnu.org
2015-02-20 22:14 ` anlauf at gmx dot de
2015-02-22 12:06 ` dominiq at lps dot ens.fr [this message]
2015-02-22 12:56 ` dominiq at lps dot ens.fr
2015-02-22 17:11 ` jvdelisle at gcc dot gnu.org
2015-02-26 17:44 ` jvdelisle at gcc dot gnu.org
2015-03-15 21:29 ` anlauf at gmx dot de
2015-03-17  1:02 ` jvdelisle at gcc dot gnu.org
2015-03-17  1:05 ` jvdelisle at gcc dot gnu.org
2015-03-17  1:22 ` jvdelisle at gcc dot gnu.org
2015-03-17 21:16 ` anlauf at gmx dot de
2015-03-17 22:33 ` jvdelisle at gcc dot gnu.org
2015-03-18  1:47 ` jvdelisle at gcc dot gnu.org
2015-03-20  7:38 ` jvdelisle at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-64432-4-ajb7Sg8LvC@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).