Hi,
PR48954 demonstrate ICE when skip-args bitmap of a clone is NULL.  Fixed this.

Bootstrapped/regtested x86_64-linux, comitted.
Index: ChangeLog
===================================================================
*** ChangeLog   (revision 174641)
--- ChangeLog   (working copy)
***************
*** 1,3 ****
--- 1,8 ----
+ 2011-06-04  Jan Hubicka  <j...@suse.cz>
+ 
+       PR lto/48954
+       * lto-cgraph.c (output_node_opt_summary): Handle NULL skip args bitmaps.
+ 
  2011-06-04  Jakub Jelinek  <ja...@redhat.com>
  
        PR target/49281
Index: testsuite/ChangeLog
===================================================================
*** testsuite/ChangeLog (revision 174641)
--- testsuite/ChangeLog (working copy)
***************
*** 1,3 ****
--- 1,8 ----
+ 2011-06-04  Jan Hubicka  <j...@suse.cz>
+ 
+       PR lto/48954
+       * g++.dg/torture/pr48954.C: New testcase.
+ 
  2011-06-04  Jakub Jelinek  <ja...@redhat.com>
  
        PR target/49281
Index: testsuite/g++.dg/torture/pr48954.C
===================================================================
*** testsuite/g++.dg/torture/pr48954.C  (revision 0)
--- testsuite/g++.dg/torture/pr48954.C  (revision 0)
***************
*** 0 ****
--- 1,28 ----
+ /* { dg-do compile } */
+ /* { dg-options "-O2 -flto -fno-early-inlining -fkeep-inline-functions" } */
+ struct A
+ {
+   virtual void foo () = 0;
+ };
+ 
+ struct B : A {};
+ struct C : A {};
+ 
+ struct D: C, B
+ {
+   void foo () {}
+ };
+ 
+ static inline void
+ bar (B *b)
+ {
+   b->foo ();
+ }
+ 
+ int
+ main ()
+ {
+   D d;
+   for (;;)
+     bar (&d);
+ }
Index: lto-cgraph.c
===================================================================
*** lto-cgraph.c        (revision 174641)
--- lto-cgraph.c        (working copy)
*************** output_node_opt_summary (struct output_b
*** 1598,1611 ****
    int i;
    struct cgraph_edge *e;
  
!   lto_output_uleb128_stream (ob->main_stream,
!                            bitmap_count_bits (node->clone.args_to_skip));
!   EXECUTE_IF_SET_IN_BITMAP (node->clone.args_to_skip, 0, index, bi)
!     lto_output_uleb128_stream (ob->main_stream, index);
!   lto_output_uleb128_stream (ob->main_stream,
!                            bitmap_count_bits 
(node->clone.combined_args_to_skip));
!   EXECUTE_IF_SET_IN_BITMAP (node->clone.combined_args_to_skip, 0, index, bi)
!     lto_output_uleb128_stream (ob->main_stream, index);
    lto_output_uleb128_stream (ob->main_stream,
                             VEC_length (ipa_replace_map_p, 
node->clone.tree_map));
    FOR_EACH_VEC_ELT (ipa_replace_map_p, node->clone.tree_map, i, map)
--- 1598,1621 ----
    int i;
    struct cgraph_edge *e;
  
!   if (node->clone.args_to_skip)
!     {
!       lto_output_uleb128_stream (ob->main_stream,
!                                bitmap_count_bits (node->clone.args_to_skip));
!       EXECUTE_IF_SET_IN_BITMAP (node->clone.args_to_skip, 0, index, bi)
!       lto_output_uleb128_stream (ob->main_stream, index);
!     }
!   else
!     lto_output_uleb128_stream (ob->main_stream, 0);
!   if (node->clone.combined_args_to_skip)
!     {
!       lto_output_uleb128_stream (ob->main_stream,
!                                bitmap_count_bits 
(node->clone.combined_args_to_skip));
!       EXECUTE_IF_SET_IN_BITMAP (node->clone.combined_args_to_skip, 0, index, 
bi)
!       lto_output_uleb128_stream (ob->main_stream, index);
!     }
!   else
!     lto_output_uleb128_stream (ob->main_stream, 0);
    lto_output_uleb128_stream (ob->main_stream,
                             VEC_length (ipa_replace_map_p, 
node->clone.tree_map));
    FOR_EACH_VEC_ELT (ipa_replace_map_p, node->clone.tree_map, i, map)

Reply via email to