public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>
To: law@cygnus.com
Cc: egcs@cygnus.com
Subject: egcs, fold-const.c warning fixes
Date: Tue, 17 Feb 1998 13:54:00 -0000	[thread overview]
Message-ID: <199802171746.MAA28296@caip.rutgers.edu> (raw)

	This one fixes warnings in fold-const.c.  

Please double check the parentheses I added around arithmetic inside shifts. 

		thanks,
		--Kaveh




Mon Feb 16 16:04:53 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

        * fold-const.c: Include "system.h" to get stdlib.h and stdio.h.
        (lshift_double): Add parentheses around + or - inside shift.
        (rshift_double): Likewise.
        (size_int_wide): Explicitly set type of `bit_p' to `int'.
        (optimize_bit_field_compare): Initialize variables `rnbitpos' and
        `rnbitsize' to 0, and `rinner' to NULL_TREE.
        (make_range): Initialize variable `type' to NULL_TREE.
        (fold): Initialize variables `arg0', `arg1' and `varop' to NULL_TREE.

        * Makefile.in (fold-const.o): Depend on system.h.


--- gcc/Makefile.in~	Wed Feb 11 17:26:23 1998
+++ gcc/Makefile.in	Tue Feb 17 11:40:13 1998
@@ -1318,7 +1318,7 @@
 tree.o : tree.c $(CONFIG_H) $(TREE_H) flags.h function.h
 print-tree.o : print-tree.c $(CONFIG_H) $(TREE_H)
 stor-layout.o : stor-layout.c $(CONFIG_H) $(TREE_H) flags.h function.h
-fold-const.o : fold-const.c $(CONFIG_H) $(TREE_H) flags.h 
+fold-const.o : fold-const.c $(CONFIG_H) $(TREE_H) flags.h system.h
 toplev.o : toplev.c $(CONFIG_H) $(TREE_H) $(RTL_H) \
    flags.h input.h insn-attr.h xcoffout.h defaults.h output.h \
    $(lang_options_files)
--- gcc/fold-const.c~	Mon Feb 16 15:51:21 1998
+++ gcc/fold-const.c	Mon Feb 16 15:51:19 1998
@@ -43,7 +43,7 @@
    forces the value to fit the type.  It returns an overflow indicator.  */
 
 #include "config.h"
-#include <stdio.h>
+#include "system.h"
 #include <setjmp.h>
 #include "flags.h"
 #include "tree.h"
@@ -356,13 +356,13 @@
 
   if (count >= HOST_BITS_PER_WIDE_INT)
     {
-      *hv = (unsigned HOST_WIDE_INT) l1 << count - HOST_BITS_PER_WIDE_INT;
+      *hv = (unsigned HOST_WIDE_INT) l1 << (count - HOST_BITS_PER_WIDE_INT);
       *lv = 0;
     }
   else
     {
       *hv = (((unsigned HOST_WIDE_INT) h1 << count)
-	     | ((unsigned HOST_WIDE_INT) l1 >> HOST_BITS_PER_WIDE_INT - count - 1 >> 1));
+	     | ((unsigned HOST_WIDE_INT) l1 >> (HOST_BITS_PER_WIDE_INT - count - 1) >> 1));
       *lv = (unsigned HOST_WIDE_INT) l1 << count;
     }
 }
@@ -392,14 +392,14 @@
   if (count >= HOST_BITS_PER_WIDE_INT)
     {
       *hv = signmask;
-      *lv = ((signmask << 2 * HOST_BITS_PER_WIDE_INT - count - 1 << 1)
-	     | ((unsigned HOST_WIDE_INT) h1 >> count - HOST_BITS_PER_WIDE_INT));
+      *lv = ((signmask << (2 * HOST_BITS_PER_WIDE_INT - count - 1) << 1)
+	     | ((unsigned HOST_WIDE_INT) h1 >> (count - HOST_BITS_PER_WIDE_INT)));
     }
   else
     {
       *lv = (((unsigned HOST_WIDE_INT) l1 >> count)
-	     | ((unsigned HOST_WIDE_INT) h1 << HOST_BITS_PER_WIDE_INT - count - 1 << 1));
-      *hv = ((signmask << HOST_BITS_PER_WIDE_INT - count)
+	     | ((unsigned HOST_WIDE_INT) h1 << (HOST_BITS_PER_WIDE_INT - count - 1) << 1));
+      *hv = ((signmask << (HOST_BITS_PER_WIDE_INT - count))
 	     | ((unsigned HOST_WIDE_INT) h1 >> count));
     }
 }
@@ -1429,6 +1429,7 @@
 tree
 size_int_wide (number, high, bit_p)
      unsigned HOST_WIDE_INT number, high;
+     int bit_p;
 {
   register tree t;
   /* Type-size nodes already made for small sizes.  */
@@ -2379,7 +2380,7 @@
      tree lhs, rhs;
 {
   int lbitpos, lbitsize, rbitpos, rbitsize;
-  int lnbitpos, lnbitsize, rnbitpos, rnbitsize;
+  int lnbitpos, lnbitsize, rnbitpos = 0, rnbitsize = 0;
   tree type = TREE_TYPE (lhs);
   tree signed_type, unsigned_type;
   int const_p = TREE_CODE (rhs) == INTEGER_CST;
@@ -2387,7 +2388,7 @@
   int lunsignedp, runsignedp;
   int lvolatilep = 0, rvolatilep = 0;
   int alignment;
-  tree linner, rinner;
+  tree linner, rinner = NULL_TREE;
   tree mask;
   tree offset;
 
@@ -2775,7 +2776,7 @@
      tree *plow, *phigh;
 {
   enum tree_code code;
-  tree arg0, arg1, type;
+  tree arg0, arg1, type = NULL_TREE;
   int in_p, n_in_p;
   tree low, high, n_low, n_high;
 
@@ -3707,7 +3708,7 @@
   tree t1 = NULL_TREE;
   tree tem;
   tree type = TREE_TYPE (expr);
-  register tree arg0, arg1;
+  register tree arg0 = NULL_TREE, arg1 = NULL_TREE;
   register enum tree_code code = TREE_CODE (t);
   register int kind;
   int invert;
@@ -5097,7 +5098,7 @@
 	 First, see if one arg is constant; find the constant arg
 	 and the other one.  */
       {
-	tree constop = 0, varop;
+	tree constop = 0, varop = NULL_TREE;
 	int constopnum = -1;
 
 	if (TREE_CONSTANT (arg1))
--
Kaveh R. Ghazi			Project Manager / Custom Development
ghazi@caip.rutgers.edu		ICon CMT Corp.

             reply	other threads:[~1998-02-17 13:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-02-17 13:54 Kaveh R. Ghazi [this message]
1998-02-18  1:53 ` Jeffrey A Law

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=199802171746.MAA28296@caip.rutgers.edu \
    --to=ghazi@caip.rutgers.edu \
    --cc=egcs@cygnus.com \
    --cc=law@cygnus.com \
    /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).