This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/85645] ICE in maybe_record_trace_start, at dwarf2cfi.c:2348


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

--- Comment #11 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Author: segher
Date: Wed May  9 12:48:43 2018
New Revision: 260076

URL: https://gcc.gnu.org/viewcvs?rev=260076&root=gcc&view=rev
Log:
shrink-wrap: Improve spread_components (PR85645)

In the testcase for PR85645 we do a pretty dumb placement of the
prologue/epilogue for the LR component: we place an epilogue for LR
before a control flow split where one of the branches clobbers LR
eventually, and the other does not.  The branch that does clobber it
will need a prologue again some time later.  Because saving and
restoring LR is a two step process---it needs to be moved via a GPR---
the backend emits CFI directives so that we get correct unwind
information.  But both regcprop and regrename do not properly handle
such CFI directives leading to ICEs.

Now, neither of the two branches needs to have LR restored at all,
because both of the branches end up in an infinite loop.

This patch makes spread_component return a boolean saying if anything
was changed, and if so, it is called again.  This obviously is finite
(there is a finite number of basic blocks, each with a finite number
of components, and spread_components can only assign more components
to a block, never less).  I also instrumented the code, and on a
bootstrap+regtest spread_components made changes a maximum of two
times.  Interestingly though it made changes on two iterations in
a third of the cases it did anything at all!


        PR rtl-optimization/85645
        * shrink-wrap.c (spread_components): Return a boolean saying if
        anything was changed.
        (try_shrink_wrapping_separate): Iterate spread_components until
        nothing changes anymore.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/shrink-wrap.c

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]