re PR target/29201 (ICE in create_recovery_block, at haifa-sched.c:3692 at -O3)

2006-11-16  Maxim Kuvyrkov  <mkuvyrkov@ispras.ru>

	PR target/29201
	* cfgrtl.c (rtl_delete_block): Move the code for getting last insn of
	bb to ...
	(get_last_bb_insn): ... new global function.
	(basic_block.h): Declare it.
	* haifa-sched.c (create_recovery_block): Use it.

2006-11-16  Maxim Kuvyrkov  <mkuvyrkov@ispras.ru>

	PR target/29201
	* gcc.c-torture/compile/pr29201.c: New test for ia64 target.

From-SVN: r118882
This commit is contained in:
Maxim Kuvyrkov 2006-11-16 06:57:59 +00:00 committed by Maxim Kuvyrkov
parent db21bbf90c
commit 96370780ab
6 changed files with 165 additions and 18 deletions

View File

@ -1,3 +1,12 @@
2006-11-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru>
PR target/29201
* cfgrtl.c (rtl_delete_block): Move the code for getting last insn of
bb to ...
(get_last_bb_insn): ... new global function.
(basic_block.h): Declare it.
* haifa-sched.c (create_recovery_block): Use it.
2006-11-15 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/29862

View File

@ -946,6 +946,7 @@ extern void update_br_prob_note (basic_block);
extern void fixup_abnormal_edges (void);
extern bool inside_basic_block_p (rtx);
extern bool control_flow_insn_p (rtx);
extern rtx get_last_bb_insn (basic_block);
/* In bb-reorder.c */
extern void reorder_basic_blocks (unsigned int);

View File

@ -361,7 +361,7 @@ cfg_layout_create_basic_block (void *head, void *end, basic_block after)
static void
rtl_delete_block (basic_block b)
{
rtx insn, end, tmp;
rtx insn, end;
/* If the head of this block is a CODE_LABEL, then it might be the
label for an exception handler which can't be reached. We need
@ -370,18 +370,7 @@ rtl_delete_block (basic_block b)
if (LABEL_P (insn))
maybe_remove_eh_handler (insn);
/* Include any jump table following the basic block. */
end = BB_END (b);
if (tablejump_p (end, NULL, &tmp))
end = tmp;
/* Include any barriers that may follow the basic block. */
tmp = next_nonnote_insn (end);
while (tmp && BARRIER_P (tmp))
{
end = tmp;
tmp = next_nonnote_insn (end);
}
end = get_last_bb_insn (b);
/* Selectively delete the entire chain. */
BB_HEAD (b) = NULL;
@ -1704,6 +1693,29 @@ update_br_prob_note (basic_block bb)
return;
XEXP (note, 0) = GEN_INT (BRANCH_EDGE (bb)->probability);
}
/* Get the last insn associated with block BB (that includes barriers and
tablejumps after BB). */
rtx
get_last_bb_insn (basic_block bb)
{
rtx tmp;
rtx end = BB_END (bb);
/* Include any jump table following the basic block. */
if (tablejump_p (end, NULL, &tmp))
end = tmp;
/* Include any barriers that may follow the basic block. */
tmp = next_nonnote_insn (end);
while (tmp && BARRIER_P (tmp))
{
end = tmp;
tmp = next_nonnote_insn (end);
}
return end;
}
/* Verify the CFG and RTL consistency common for both underlying RTL and
cfglayout RTL.

View File

@ -3544,18 +3544,22 @@ static basic_block
create_recovery_block (void)
{
rtx label;
rtx barrier;
basic_block rec;
added_recovery_block_p = true;
if (!before_recovery)
init_before_recovery ();
label = gen_label_rtx ();
gcc_assert (BARRIER_P (NEXT_INSN (BB_END (before_recovery))));
label = emit_label_after (label, NEXT_INSN (BB_END (before_recovery)));
rec = create_basic_block (label, label, before_recovery);
barrier = get_last_bb_insn (before_recovery);
gcc_assert (BARRIER_P (barrier));
label = emit_label_after (gen_label_rtx (), barrier);
rec = create_basic_block (label, label, before_recovery);
/* Recovery block always end with an unconditional jump. */
emit_barrier_after (BB_END (rec));
if (BB_PARTITION (before_recovery) != BB_UNPARTITIONED)

View File

@ -1,3 +1,8 @@
2006-11-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru>
PR target/29201
* gcc.c-torture/compile/pr29201.c: New test for ia64 target.
2006-11-15 Steven G. Kargl <kargl@gcc.gnu.org>
* gfortran.dg/import3.f90: Fix error message.

View File

@ -0,0 +1,116 @@
/* { dg-do assemble { target ia64-*-* } } */
typedef int gint;
typedef gint gboolean;
typedef unsigned int guint;
typedef struct _MetaRectangle MetaRectangle;
struct _MetaRectangle
{
int x;
int y;
};
typedef struct _MetaDisplay MetaDisplay;
typedef struct _MetaFrame MetaFrame;
typedef struct _MetaWindow MetaWindow;
typedef struct
{
int win_gravity;
}
XSizeHints;
typedef enum
{
META_DEBUG_FOCUS = 1 << 0, META_DEBUG_WORKAREA = 1 << 1, META_DEBUG_STACK =
1 << 6, META_DEBUG_WINDOW_OPS = 1 << 7, META_DEBUG_GEOMETRY =
1 << 20, META_DEBUG_EDGE_RESISTANCE = 1 << 21
}
MetaStackLayer;
struct _MetaWindow
{
MetaDisplay *display;
MetaFrame *frame;
guint user_has_move_resized:1;
MetaRectangle user_rect;
XSizeHints size_hints;
};
void meta_window_get_position (MetaWindow * window, int *x, int *y);
typedef struct _MetaFrameGeometry MetaFrameGeometry;
struct _MetaFrameGeometry
{
};
struct _MetaFrame
{
MetaWindow *window;
MetaRectangle rect;
int child_x;
int child_y;
};
typedef enum
{
META_IS_CONFIGURE_REQUEST = 1 << 0, META_DO_GRAVITY_ADJUST =
1 << 3, META_IS_RESIZE_ACTION = 1 << 4
}
MetaMoveResizeFlags;
adjust_for_gravity (MetaWindow * window, MetaFrameGeometry * fgeom,
gboolean coords_assume_border, int gravity,
MetaRectangle * rect)
{
int ref_x, ref_y;
int child_x, child_y;
int frame_width, frame_height;
switch (gravity)
{
case 1:
ref_x = rect->x;
}
switch (gravity)
{
case 1:
rect->y = ref_y + child_y;
case 2:
rect->x = ref_x - frame_width / 2 + child_x;
break;
case 3:
case 5:
case 6:
rect->x = ref_x - frame_width + child_x;
}
}
meta_window_move_resize_internal (MetaWindow * window,
MetaMoveResizeFlags flags,
int resize_gravity, int root_x_nw,
int root_y_nw, int w, int h)
{
unsigned int mask;
MetaFrameGeometry fgeom;
gboolean need_resize_client = (0);
gboolean is_configure_request;
MetaRectangle new_rect;
MetaRectangle old_rect;
{
adjust_for_gravity (window, window->frame ? &fgeom : ((void *) 0),
is_configure_request, window->size_hints.win_gravity,
&new_rect);
}
meta_window_constrain (window, window->frame ? &fgeom : ((void *) 0), flags,
resize_gravity, &old_rect, &new_rect);
if (mask != 0)
{
{
meta_topic_real (META_DEBUG_GEOMETRY,
need_resize_client ? "true" : "false");
}
}
{
window->user_has_move_resized = (!(0));
meta_window_get_position (window, &window->user_rect.x,
&window->user_rect.y);
}
}
void
meta_window_get_position (MetaWindow * window, int *x, int *y)
{
if (window->frame)
{
*x = window->frame->rect.x + window->frame->child_x;
*y = window->frame->rect.y + window->frame->child_y;
}
}