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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-04-18
     Ever confirmed|0                           |1

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed with GCC7.

> gcc-7 t.c -fopenacc
In function 'main._omp_fn.0':
lto1: internal compiler error: Segmentation fault
0x7b2d3f crash_signal
        ../../gcc/toplev.c:337
0x4a1056 flow_loops_find(loops*)
        ../../gcc/cfgloop.c:456
0x6cc63b input_cfg
        ../../gcc/lto-streamer-in.c:844
...

adjusted patch:

Index: gcc/lto-streamer-out.c
===================================================================
--- gcc/lto-streamer-out.c      (revision 259467)
+++ gcc/lto-streamer-out.c      (working copy)
@@ -2077,6 +2077,9 @@ output_function (struct cgraph_node *nod
      debug info.  */
   if (gimple_has_body_p (function))
     {
+      /* Fixup loops if required to match discovery done in the reader.  */
+      loop_optimizer_init (AVOID_CFG_MODIFICATIONS);
+
       streamer_write_uhwi (ob, 1);
       output_struct_function_base (ob, fn);

@@ -2134,6 +2137,7 @@ output_function (struct cgraph_node *nod

       output_cfg (ob, fn);

+      loop_optimizer_finalize ();
       pop_cfun ();
    }
   else

Reply via email to