]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/32912 (ICE with vector code)
authorJakub Jelinek <jakub@redhat.com>
Fri, 24 Aug 2007 17:21:42 +0000 (19:21 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 24 Aug 2007 17:21:42 +0000 (19:21 +0200)
PR middle-end/32912
* fold-const.c (fold_binary): Only optimize X | ~X and X ^ ~X for
integral types.

* gcc.dg/pr32912-1.c: New test.
* gcc.dg/pr32912-2.c: New test.

From-SVN: r127781

gcc/cp/ChangeLog
gcc/cp/error.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/crash37.C [new file with mode: 0644]

index 3d66b0ef992987969a937fc57b65185f9f1c1319..3285436a6fcf2f161a01ad1447e9cb54d6a4ba15 100644 (file)
@@ -1,3 +1,9 @@
+2007-08-24  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/31941
+       * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
+       TARGET_VTABLE_USES_DESCRIPTORS targets properly.
+
 2007-08-20  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/32992
index 58ebe42250f4c1ee72a34c82a86e168703813703..1953d7de3d91a78ce310485e1d9386ce7f8ff3ac 100644 (file)
@@ -1291,10 +1291,14 @@ static tree
 resolve_virtual_fun_from_obj_type_ref (tree ref)
 {
   tree obj_type = TREE_TYPE (OBJ_TYPE_REF_OBJECT (ref));
-  int index = tree_low_cst (OBJ_TYPE_REF_TOKEN (ref), 1);
+  HOST_WIDE_INT index = tree_low_cst (OBJ_TYPE_REF_TOKEN (ref), 1);
   tree fun = BINFO_VIRTUALS (TYPE_BINFO (TREE_TYPE (obj_type)));
-    while (index--)
+  while (index)
+    {
       fun = TREE_CHAIN (fun);
+      index -= (TARGET_VTABLE_USES_DESCRIPTORS
+               ? TARGET_VTABLE_USES_DESCRIPTORS : 1);
+    }
 
   return BV_FN (fun);
 }
index 68aec998e280e4e55ce45d064cfe513e48eda038..a9651e69c8b7349e5f2d42d43a40160dccd4728d 100644 (file)
@@ -1,3 +1,8 @@
+2007-08-24  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/31941
+       * g++.dg/parse/crash37.C: New test.
+
 2007-08-22  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/33142
diff --git a/gcc/testsuite/g++.dg/parse/crash37.C b/gcc/testsuite/g++.dg/parse/crash37.C
new file mode 100644 (file)
index 0000000..8320dfa
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/31941
+// { dg-do compile }
+
+struct S
+{
+  S() throw () { }
+  virtual ~S () throw ();
+  virtual const char* what () const throw ();
+};
+
+const char *
+foo (S &e)
+{
+  return e.what ().c_str ();   // { dg-error "c_str.*S::what.*which is of non-class type" }
+}