re PR ipa/66896 (ipa-prop.c:2479 runtime error: member call on null pointer of type...
authorMartin Liska <mliska@suse.cz>
Thu, 16 Jul 2015 14:48:18 +0000 (16:48 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Thu, 16 Jul 2015 14:48:18 +0000 (14:48 +0000)
Fix PR ipa/66896.

* g++.dg/ipa/pr66896.c: New test.
PR ipa/66896.
* ipa-prop.c (update_jump_functions_after_inlining): Create properly
dst_ctx if it does not exist.

From-SVN: r225887

gcc/ChangeLog
gcc/ipa-prop.c
gcc/testsuite/ChangeLog

index 90254ffb0a80e1470d71d0658f3a700fe3decfe5..fa938d880efdf3b9560db715047f874de50b5ba2 100644 (file)
@@ -1,3 +1,9 @@
+2015-07-16  Martin Liska  <mliska@suse.cz>
+
+       PR ipa/66896.
+       * ipa-prop.c (update_jump_functions_after_inlining): Create properly
+       dst_ctx if it does not exist.
+
 2015-07-16  Martin Liska  <mliska@suse.cz>
 
        * hash-set.h (remove): New function.
index aa659b747e1ddc79ceef5986088aaea302f99ea1..c862cfff8d968b5a84d49edbbdde11dbe46447d5 100644 (file)
@@ -2377,11 +2377,15 @@ update_jump_functions_after_inlining (struct cgraph_edge *cs,
              ctx.offset_by (dst->value.ancestor.offset);
              if (!ctx.useless_p ())
                {
-                 vec_safe_grow_cleared (args->polymorphic_call_contexts,
-                                        count);
-                 dst_ctx = ipa_get_ith_polymorhic_call_context (args, i);
+                 if (!dst_ctx)
+                   {
+                     vec_safe_grow_cleared (args->polymorphic_call_contexts,
+                                            count);
+                     dst_ctx = ipa_get_ith_polymorhic_call_context (args, i);
+                   }
+
+                 dst_ctx->combine_with (ctx);
                }
-             dst_ctx->combine_with (ctx);
            }
 
          if (src->agg.items
index 9bace80590df9647bb4fb6c7e2f0cfa1cb32ae1b..aa807cc2bfe311a40787abdbbcf966202ed8102c 100644 (file)
@@ -1,3 +1,7 @@
+2015-07-16  Martin Liska  <mliska@suse.cz>
+
+       * g++.dg/ipa/pr66896.c: New test.
+
 2015-07-16  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/66894