OSDN Git Service

* fold-const.c (size_binop): Don't asert inputs are the same and
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 Mar 2000 00:54:49 +0000 (00:54 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 Mar 2000 00:54:49 +0000 (00:54 +0000)
have TYPE_IS_SIZETYPE set.
(size_diffop): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32273 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/g++.old-deja/g++.other/crash13.C [new file with mode: 0644]

index a325ef4..c65598e 100644 (file)
@@ -1,3 +1,9 @@
+2000-02-29  Mark Mitchell  <mark@codesourcery.com>
+
+       * fold-const.c (size_binop): Don't asert inputs are the same and
+       have TYPE_IS_SIZETYPE set.
+       (size_diffop): Likewise.
+
 2000-02-29  Jason Merrill  <jason@casey.cygnus.com>
 
        * dwarfout.c (output_block): Output abstract blocks even if they
index 24bf6f1..097650f 100644 (file)
@@ -1868,8 +1868,8 @@ size_binop (code, arg0, arg1)
 {
   tree type = TREE_TYPE (arg0);
 
-  if (type != TREE_TYPE (arg1)
-      || TREE_CODE (type) != INTEGER_TYPE || ! TYPE_IS_SIZETYPE (type))
+  if (TREE_CODE (type) != INTEGER_TYPE 
+      || TREE_CODE (TREE_TYPE (arg1)) != INTEGER_TYPE)
     abort ();
 
   /* Handle the special case of two integer constants faster.  */
@@ -1905,8 +1905,8 @@ size_diffop (arg0, arg1)
   tree type = TREE_TYPE (arg0);
   tree ctype;
 
-  if (TREE_TYPE (arg1) != type || TREE_CODE (type) != INTEGER_TYPE
-      || ! TYPE_IS_SIZETYPE (type))
+  if (TREE_CODE (type) != INTEGER_TYPE 
+      || TREE_CODE (TREE_TYPE (arg1)) != INTEGER_TYPE)
     abort ();
 
   /* If the type is already signed, just do the simple thing.  */
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash13.C b/gcc/testsuite/g++.old-deja/g++.other/crash13.C
new file mode 100644 (file)
index 0000000..7593f43
--- /dev/null
@@ -0,0 +1,11 @@
+struct Base_bitset {
+  unsigned M_w[2];
+  void M_do_right_shift();
+};
+
+
+void Base_bitset::M_do_right_shift ()
+{
+  unsigned n = 0;
+  M_w[0] =  M_w[n + 1]  ;
+}