re PR ipa/62121 (ICE: Segmentation fault in ipa-devirt.c:997)
authorJan Hubicka <hubicka@ucw.cz>
Sat, 27 Sep 2014 00:19:06 +0000 (02:19 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 27 Sep 2014 00:19:06 +0000 (00:19 +0000)
PR ipa/62121
* ipa-polymorphic-call.c (ipa_polymorphic_call_context::restrict_to_inner_class):
fix pasto in checking array size.

* g++.dg/torture/pr62121.C: New testcase.

From-SVN: r215655

gcc/ChangeLog
gcc/ipa-polymorphic-call.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr62121.C [new file with mode: 0644]

index e3a62f5..203e1f5 100644 (file)
@@ -1,5 +1,11 @@
 2014-09-26  Jan Hubicka  <hubicka@ucw.cz>
 
+       PR ipa/62121
+       * ipa-polymorphic-call.c (ipa_polymorphic_call_context::restrict_to_inner_class):
+       fix pasto in checking array size.
+
+2014-09-26  Jan Hubicka  <hubicka@ucw.cz>
+
        PR middle-end/35545
        * passes.def (pass_tracer): Move before last dominator pass.
 
index 23f14ac..e682b2b 100644 (file)
@@ -327,7 +327,7 @@ ipa_polymorphic_call_context::restrict_to_inner_class (tree expected_type)
              && (cur_offset
                  + (expected_type ? tree_to_uhwi (TYPE_SIZE (expected_type))
                     : 0)
-                 > tree_to_uhwi (TYPE_SIZE (type))))
+                 > tree_to_uhwi (TYPE_SIZE (subtype))))
            goto no_useful_type_info;
 
          cur_offset = new_offset;
index dd76fa5..e3396c5 100644 (file)
@@ -1,5 +1,10 @@
 2014-09-26  Jan Hubicka  <hubicka@ucw.cz>
 
+       PR ipa/62121
+       * g++.dg/torture/pr62121.C: New testcase.
+
+2014-09-26  Jan Hubicka  <hubicka@ucw.cz>
+
        PR middle-end/35545
        * g++.dg/tree-prof/pr35545.C: New testcase.
 
diff --git a/gcc/testsuite/g++.dg/torture/pr62121.C b/gcc/testsuite/g++.dg/torture/pr62121.C
new file mode 100644 (file)
index 0000000..de1196a
--- /dev/null
@@ -0,0 +1,12 @@
+// { dg-do compile }
+class A
+{
+  virtual double operator()();
+};
+class B : A
+{
+public:
+  double operator()();
+};
+extern B a[];
+int b = a[0]();