public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/97235] New: ICE in duplicate, at ipa-prop.c:4251
@ 2020-09-29  1:36 asolokha at gmx dot com
  2020-09-29  7:18 ` [Bug ipa/97235] [11 Regression] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: asolokha at gmx dot com @ 2020-09-29  1:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97235

            Bug ID: 97235
           Summary: ICE in duplicate, at ipa-prop.c:4251
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

gcc-11.0.0-alpha20200927 snapshot (g:e24817aa7a1c6d12039b486ab5ea9b5ee0a46cd4)
ICEs when compiling the following testcase w/ -O2 -fno-ipa-modref:

struct ie {
  int hk;
};

typedef int
gn (int, struct ie *);

int
de (int, struct ie *);

int
qc (int, struct ie *);

int bh;

int
uj (gn yz)
{
  struct ie *se = 0;

  if (se->hk == 1)
    return yz (bh, se);

  return 1;
}

int
n6 (void)
{
  (void) uj (qc);
  (void) uj (de);
}

% gcc-11.0.0 -O2 -fno-ipa-modref -c a7m1ghpt.c
during IPA pass: inline
a7m1ghpt.c: In function 'n6':
a7m1ghpt.c:31:10: internal compiler error: in duplicate, at ipa-prop.c:4251
   31 |   (void) uj (de);
      |          ^~~~~~~
0x6741de ipa_edge_args_sum_t::duplicate(cgraph_edge*, cgraph_edge*,
ipa_edge_args*, ipa_edge_args*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/ipa-prop.c:4251
0x95912b symbol_table::call_edge_duplication_hooks(cgraph_edge*, cgraph_edge*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/cgraph.c:451
0x96d12f cgraph_edge::clone(cgraph_node*, gcall*, unsigned int, profile_count,
profile_count, bool)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/cgraphclones.c:149
0xe322d7 copy_bb
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/tree-inline.c:2266
0xe332fb copy_cfg_body
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/tree-inline.c:3042
0xe332fb copy_body
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/tree-inline.c:3290
0xe36714 expand_call_inline
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/tree-inline.c:5076
0xe38391 gimple_expand_calls_inline
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/tree-inline.c:5266
0xe38391 optimize_inline_calls(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/tree-inline.c:5439
0xb92863 inline_transform(cgraph_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/ipa-inline-transform.c:741
0xccd67d execute_one_ipa_transform_pass
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/passes.c:2240
0xccd67d execute_all_ipa_transforms(bool)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/passes.c:2279
0x968683 cgraph_node::expand()
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/cgraphunit.c:2302
0x969c1d expand_all_functions
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/cgraphunit.c:2480
0x969c1d symbol_table::compile()
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/cgraphunit.c:2843
0x96c092 symbol_table::compile()
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/cgraphunit.c:2756
0x96c092 symbol_table::finalize_compilation_unit()
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/cgraphunit.c:3021

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug ipa/97235] [11 Regression] ICE in duplicate, at ipa-prop.c:4251
  2020-09-29  1:36 [Bug ipa/97235] New: ICE in duplicate, at ipa-prop.c:4251 asolokha at gmx dot com
@ 2020-09-29  7:18 ` rguenth at gcc dot gnu.org
  2020-09-29  8:11 ` [Bug ipa/97235] [11 Regression] ICE in duplicate, at ipa-prop.c:4251 since r11-3478-gada353b87909fd6c marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-09-29  7:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97235

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0
           Priority|P3                          |P1
           Keywords|ice-on-invalid-code         |ice-on-valid-code
            Summary|ICE in duplicate, at        |[11 Regression] ICE in
                   |ipa-prop.c:4251             |duplicate, at
                   |                            |ipa-prop.c:4251
                 CC|                            |hubicka at gcc dot gnu.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug ipa/97235] [11 Regression] ICE in duplicate, at ipa-prop.c:4251 since r11-3478-gada353b87909fd6c
  2020-09-29  1:36 [Bug ipa/97235] New: ICE in duplicate, at ipa-prop.c:4251 asolokha at gmx dot com
  2020-09-29  7:18 ` [Bug ipa/97235] [11 Regression] " rguenth at gcc dot gnu.org
@ 2020-09-29  8:11 ` marxin at gcc dot gnu.org
  2020-09-29  8:12 ` marxin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-09-29  8:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97235

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
      Known to fail|                            |11.0
           Assignee|unassigned at gcc dot gnu.org      |hubicka at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
            Summary|[11 Regression] ICE in      |[11 Regression] ICE in
                   |duplicate, at               |duplicate, at
                   |ipa-prop.c:4251             |ipa-prop.c:4251 since
                   |                            |r11-3478-gada353b87909fd6c
   Last reconfirmed|                            |2020-09-29

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug ipa/97235] [11 Regression] ICE in duplicate, at ipa-prop.c:4251 since r11-3478-gada353b87909fd6c
  2020-09-29  1:36 [Bug ipa/97235] New: ICE in duplicate, at ipa-prop.c:4251 asolokha at gmx dot com
  2020-09-29  7:18 ` [Bug ipa/97235] [11 Regression] " rguenth at gcc dot gnu.org
  2020-09-29  8:11 ` [Bug ipa/97235] [11 Regression] ICE in duplicate, at ipa-prop.c:4251 since r11-3478-gada353b87909fd6c marxin at gcc dot gnu.org
@ 2020-09-29  8:12 ` marxin at gcc dot gnu.org
  2020-09-30 15:43 ` hubicka at ucw dot cz
  2020-10-01 13:14 ` hubicka at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-09-29  8:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97235

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, started with r11-3478-gada353b87909fd6c.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug ipa/97235] [11 Regression] ICE in duplicate, at ipa-prop.c:4251 since r11-3478-gada353b87909fd6c
  2020-09-29  1:36 [Bug ipa/97235] New: ICE in duplicate, at ipa-prop.c:4251 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2020-09-29  8:12 ` marxin at gcc dot gnu.org
@ 2020-09-30 15:43 ` hubicka at ucw dot cz
  2020-10-01 13:14 ` hubicka at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: hubicka at ucw dot cz @ 2020-09-30 15:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97235

--- Comment #2 from Jan Hubicka <hubicka at ucw dot cz> ---
I am testing this fix. Problem is that when modref is disabled we never
relase ipa-prop datastructures.

2020-09-30  Jan Hubicka  <hubicka@ucw.cz>

        * ipa-fnsummary.c: (pass_free_fnsummary:execute): Call  
        ipa_free_all_structures_after_iinln.
        * ipa-modref.c (pass_ipa_modref::execute): Do not call
        ipa_free_all_structures_after_iinln.
        * ipa-prop.c (ipa_free_all_node_params): Do not crash if info
        is not allocated.
        (ipa_unregister_cgraph_hooks): Likewise.


diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c
index 4c1c1f91482..8285cc00d33 100644
--- a/gcc/ipa-fnsummary.c
+++ b/gcc/ipa-fnsummary.c
@@ -4680,6 +4680,8 @@ public:
   virtual unsigned int execute (function *)
     {
       ipa_free_fn_summary ();
+      /* Free ipa-prop structures if they are no longer needed.  */
+      ipa_free_all_structures_after_iinln ();
       if (!flag_wpa)
        ipa_free_size_summary ();
       return 0;
diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c
index 6225552e41a..2f4da8f2a14 100644
--- a/gcc/ipa-modref.c
+++ b/gcc/ipa-modref.c
@@ -1681,8 +1681,6 @@ pass_ipa_modref::execute (function *)
     }
   ((modref_summaries *)summaries)->ipa = false;
   ipa_free_postorder_info ();
-  /* Free ipa-prop structures if they are no longer needed.  */
-  ipa_free_all_structures_after_iinln ();
   return 0;
 }

diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index b28c78eeab4..ea88fd3fd95 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -4124,7 +4124,8 @@ ipa_free_all_edge_args (void)
 void
 ipa_free_all_node_params (void)
 {
-  ggc_delete (ipa_node_params_sum);
+  if (ipa_node_params_sum)
+    ggc_delete (ipa_node_params_sum);
   ipa_node_params_sum = NULL;
 }

@@ -4368,7 +4369,8 @@ ipa_register_cgraph_hooks (void)
 static void
 ipa_unregister_cgraph_hooks (void)
 {
-  symtab->remove_cgraph_insertion_hook (function_insertion_hook_holder);
+  if (function_insertion_hook_holder)
+    symtab->remove_cgraph_insertion_hook (function_insertion_hook_holder);
   function_insertion_hook_holder = NULL;
 }

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug ipa/97235] [11 Regression] ICE in duplicate, at ipa-prop.c:4251 since r11-3478-gada353b87909fd6c
  2020-09-29  1:36 [Bug ipa/97235] New: ICE in duplicate, at ipa-prop.c:4251 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2020-09-30 15:43 ` hubicka at ucw dot cz
@ 2020-10-01 13:14 ` hubicka at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: hubicka at gcc dot gnu.org @ 2020-10-01 13:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97235

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|ASSIGNED                    |RESOLVED

--- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
This is the same issues at 97244

*** This bug has been marked as a duplicate of bug 97244 ***

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-01 13:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29  1:36 [Bug ipa/97235] New: ICE in duplicate, at ipa-prop.c:4251 asolokha at gmx dot com
2020-09-29  7:18 ` [Bug ipa/97235] [11 Regression] " rguenth at gcc dot gnu.org
2020-09-29  8:11 ` [Bug ipa/97235] [11 Regression] ICE in duplicate, at ipa-prop.c:4251 since r11-3478-gada353b87909fd6c marxin at gcc dot gnu.org
2020-09-29  8:12 ` marxin at gcc dot gnu.org
2020-09-30 15:43 ` hubicka at ucw dot cz
2020-10-01 13:14 ` hubicka at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).