aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2005-07-18 23:20:09 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2005-07-18 23:20:09 +0000
commit7825308e2053d319f1fb2162968bbf84a86acae3 (patch)
tree635d996d3e9a7dd331e13ce0eb3e0a5e8017c64c /gcc
parent2928d0f87052e921ddd212f32e20fd2add5f771b (diff)
downloadgcc-7825308e2053d319f1fb2162968bbf84a86acae3.zip
gcc-7825308e2053d319f1fb2162968bbf84a86acae3.tar.gz
gcc-7825308e2053d319f1fb2162968bbf84a86acae3.tar.bz2
re PR middle-end/22057 (Poor -O0 debug information for for loops with no initializer)
PR middle-end/22057 * tree-cfgcleanup.c (cleanup_tree_cfg): Only remove forwarder blocks when optimizing. From-SVN: r102142
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-cfgcleanup.c24
2 files changed, 22 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c24f4b4..9cd5cff 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2005-07-18 Ian Lance Taylor <ian@airs.com>
+
+ PR middle-end/22057
+ * tree-cfgcleanup.c (cleanup_tree_cfg): Only remove forwarder
+ blocks when optimizing.
+
2005-07-18 Steve Ellcey <sje@cup.hp.com>
* common.opt (frename-registers): Initialize to 2.
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index bedee9b..51b2fc5 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -501,20 +501,28 @@ cleanup_tree_cfg (void)
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