re PR rtl-optimization/33737 (verify_flow_info failed: Wrong probability of edge 94->1 -6651)
PR rtl-optimization/33737 * cfgcleanup.c (try_crossjump_to_edge): Add count and frequency of target block after computing the probabilities of outgoing edges. Cap the frequency to BB_FREQ_MAX. * tree-ssa-threadupdate.c (redirect_edges): Also adjust count and frequency of the basic block if it has been reused. From-SVN: r129973
This commit is contained in:
parent
8c6c36a3c9
commit
52982a970e
5 changed files with 358 additions and 3 deletions
|
@ -1,3 +1,12 @@
|
|||
2007-11-07 Eric Botcazou <ebotcazou@libertysurf.fr>
|
||||
|
||||
PR rtl-optimization/33737
|
||||
* cfgcleanup.c (try_crossjump_to_edge): Add count and frequency of
|
||||
target block after computing the probabilities of outgoing edges.
|
||||
Cap the frequency to BB_FREQ_MAX.
|
||||
* tree-ssa-threadupdate.c (redirect_edges): Also adjust count and
|
||||
frequency of the basic block if it has been reused.
|
||||
|
||||
2007-11-07 Eric Botcazou <ebotcazou@libertysurf.fr>
|
||||
|
||||
PR rtl-optimization/33822
|
||||
|
|
|
@ -1699,8 +1699,6 @@ try_crossjump_to_edge (int mode, edge e1, edge e2)
|
|||
"Cross jumping from bb %i to bb %i; %i common insns\n",
|
||||
src1->index, src2->index, nmatch);
|
||||
|
||||
redirect_to->count += src1->count;
|
||||
redirect_to->frequency += src1->frequency;
|
||||
/* We may have some registers visible through the block. */
|
||||
df_set_bb_dirty (redirect_to);
|
||||
|
||||
|
@ -1757,6 +1755,14 @@ try_crossjump_to_edge (int mode, edge e1, edge e2)
|
|||
/ (redirect_to->frequency + src1->frequency));
|
||||
}
|
||||
|
||||
/* Adjust count and frequency for the block. An earlier jump
|
||||
threading pass may have left the profile in an inconsistent
|
||||
state (see update_bb_profile_for_threading) so we must be
|
||||
prepared for overflows. */
|
||||
redirect_to->count += src1->count;
|
||||
redirect_to->frequency += src1->frequency;
|
||||
if (redirect_to->frequency > BB_FREQ_MAX)
|
||||
redirect_to->frequency = BB_FREQ_MAX;
|
||||
update_br_prob_note (redirect_to);
|
||||
|
||||
/* Edit SRC1 to go to REDIRECT_TO at NEWPOS1. */
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2007-11-07 Eric Botcazou <ebotcazou@libertysurf.fr>
|
||||
|
||||
* gcc.c-torture/compile/20071107-1.c: New test.
|
||||
|
||||
2007-11-07 Eric Botcazou <ebotcazou@libertysurf.fr>
|
||||
|
||||
* gcc.dg/out-of-bounds-1.c: New test.
|
||||
|
|
332
gcc/testsuite/gcc.c-torture/compile/20071107-1.c
Normal file
332
gcc/testsuite/gcc.c-torture/compile/20071107-1.c
Normal file
|
@ -0,0 +1,332 @@
|
|||
/* PR rtl-optimization/33737 */
|
||||
/* Testcase by Richard Guenther <rguenth@gcc.gnu.org> */
|
||||
|
||||
enum { PROP_0, PROP_DOUBLE_CLICK_TIME, PROP_DOUBLE_CLICK_DISTANCE, PROP_CURSOR_BLINK, PROP_CURSOR_BLINK_TIME, PROP_CURSOR_BLINK_TIMEOUT, PROP_SPLIT_CURSOR, PROP_THEME_NAME, PROP_ICON_THEME_NAME, PROP_FALLBACK_ICON_THEME, PROP_KEY_THEME_NAME, PROP_MENU_BAR_ACCEL, PROP_DND_DRAG_THRESHOLD, PROP_FONT_NAME, PROP_ICON_SIZES, PROP_MODULES, PROP_XFT_ANTIALIAS, PROP_XFT_HINTING, PROP_XFT_HINTSTYLE, PROP_XFT_RGBA, PROP_XFT_DPI, PROP_CURSOR_THEME_NAME, PROP_CURSOR_THEME_SIZE, PROP_ALTERNATIVE_BUTTON_ORDER, PROP_ALTERNATIVE_SORT_ARROWS, PROP_SHOW_INPUT_METHOD_MENU, PROP_SHOW_UNICODE_MENU, PROP_TIMEOUT_INITIAL, PROP_TIMEOUT_REPEAT, PROP_TIMEOUT_EXPAND, PROP_COLOR_SCHEME, PROP_ENABLE_ANIMATIONS, PROP_TOUCHSCREEN_MODE, PROP_TOOLTIP_TIMEOUT, PROP_TOOLTIP_BROWSE_TIMEOUT, PROP_TOOLTIP_BROWSE_MODE_TIMEOUT, PROP_KEYNAV_CURSOR_ONLY, PROP_KEYNAV_WRAP_AROUND, PROP_ERROR_BELL, PROP_COLOR_HASH, PROP_FILE_CHOOSER_BACKEND, PROP_PRINT_BACKENDS, PROP_PRINT_PREVIEW_COMMAND, PROP_ENABLE_MNEMONICS, PROP_ENABLE_ACCELS, PROP_RECENT_FILES_LIMIT };
|
||||
void g_assert_warning (void) __attribute__((__noreturn__));
|
||||
void gtk_settings_class_init (void)
|
||||
{
|
||||
unsigned int result;
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_DOUBLE_CLICK_TIME) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_DOUBLE_CLICK_DISTANCE) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_CURSOR_BLINK) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_CURSOR_BLINK_TIME) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_CURSOR_BLINK_TIMEOUT) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_SPLIT_CURSOR) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_THEME_NAME) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_ICON_THEME_NAME) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_FALLBACK_ICON_THEME) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_KEY_THEME_NAME) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_MENU_BAR_ACCEL) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_DND_DRAG_THRESHOLD) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_FONT_NAME) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_ICON_SIZES) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_MODULES) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_XFT_ANTIALIAS) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_XFT_HINTING) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_XFT_HINTSTYLE) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_XFT_RGBA) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_XFT_DPI) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_CURSOR_THEME_NAME) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_CURSOR_THEME_SIZE) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_ALTERNATIVE_BUTTON_ORDER) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_ALTERNATIVE_SORT_ARROWS) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_SHOW_INPUT_METHOD_MENU) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_SHOW_UNICODE_MENU) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_TOOLTIP_BROWSE_TIMEOUT) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_TOOLTIP_BROWSE_MODE_TIMEOUT) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_KEYNAV_CURSOR_ONLY) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_KEYNAV_WRAP_AROUND) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_ERROR_BELL) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_FILE_CHOOSER_BACKEND) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_PRINT_PREVIEW_COMMAND) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_ENABLE_MNEMONICS) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
result = settings_install_property_parser();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_ENABLE_ACCELS) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
if (__builtin_expect (__extension__ ({
|
||||
int _g_boolean_var_;
|
||||
if (result == PROP_RECENT_FILES_LIMIT) _g_boolean_var_ = 1;
|
||||
else _g_boolean_var_ = 0;
|
||||
_g_boolean_var_;
|
||||
}), 1)) {
|
||||
}
|
||||
else g_assert_warning();
|
||||
}
|
|
@ -442,10 +442,14 @@ redirect_edges (void **slot, void *data)
|
|||
remove_ctrl_stmt_and_useless_edges (local_info->bb,
|
||||
rd->outgoing_edge->dest);
|
||||
|
||||
/* And fixup the flags on the single remaining edge. */
|
||||
/* Fixup the flags on the single remaining edge. */
|
||||
single_succ_edge (local_info->bb)->flags
|
||||
&= ~(EDGE_TRUE_VALUE | EDGE_FALSE_VALUE | EDGE_ABNORMAL);
|
||||
single_succ_edge (local_info->bb)->flags |= EDGE_FALLTHRU;
|
||||
|
||||
/* And adjust count and frequency on BB. */
|
||||
local_info->bb->count = e->count;
|
||||
local_info->bb->frequency = EDGE_FREQUENCY (e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue