This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFA: Patch for PR 22057
Mark Mitchell <mark@codesourcery.com> writes:
> Ian Lance Taylor wrote:
> > Geoff Keating <geoffk@apple.com> writes:
> >
> >>>2005-07-13 Ian Lance Taylor <ian@airs.com>
> >>>
> >>> PR 22057
> >>> * tree-cfgcleanup.c (cleanup_tree_cfg): Only remove forwarder
> >>> blocks when optimizing.
> >>
> >>This is OK.
> > Thanks; committed.
> > Mark, is this OK for the 4.0 branch? This fixes a 4.0 regression in
> > -O0 debug information. Original patch is here:
> > http://gcc.gnu.org/ml/gcc-patches/2005-07/msg00954.html
>
> Yes, thanks.
For the record, here is the patch as committed to the 4.0 branch. The
function is in a different file, but is otherwise unchanged.
Ian
2005-07-18 Ian Lance Taylor <ian@airs.com>
PR middle-end/22057
* tree-cfg.c (cleanup_tree_cfg): Only remove forwarder blocks when
optimizing.
Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.151.2.1
diff -u -r2.151.2.1 tree-cfg.c
--- tree-cfg.c 21 May 2005 16:58:32 -0000 2.151.2.1
+++ tree-cfg.c 19 Jul 2005 06:23:11 -0000
@@ -927,20 +927,28 @@
retval = cleanup_control_flow ();
retval |= delete_unreachable_blocks ();
- /* cleanup_forwarder_blocks can redirect edges out of SWITCH_EXPRs,
- which can get expensive. So we want to enable recording of edge
- to CASE_LABEL_EXPR mappings around the call to
- cleanup_forwarder_blocks. */
- start_recording_case_labels ();
- retval |= cleanup_forwarder_blocks ();
- end_recording_case_labels ();
+ /* Forwarder blocks can carry line number information which is
+ useful when debugging, so we only clean them up when
+ optimizing. */
+
+ if (optimize > 0)
+ {
+ /* cleanup_forwarder_blocks can redirect edges out of
+ SWITCH_EXPRs, which can get expensive. So we want to enable
+ recording of edge to CASE_LABEL_EXPR mappings around the call
+ to cleanup_forwarder_blocks. */
+ start_recording_case_labels ();
+ retval |= cleanup_forwarder_blocks ();
+ end_recording_case_labels ();
+ }
#ifdef ENABLE_CHECKING
if (retval)
{
gcc_assert (!cleanup_control_flow ());
gcc_assert (!delete_unreachable_blocks ());
- gcc_assert (!cleanup_forwarder_blocks ());
+ if (optimize > 0)
+ gcc_assert (!cleanup_forwarder_blocks ());
}
#endif