Commit 42821aff by Michael Matz

re PR rtl-optimization/48389 (ICE: in make_edges, at cfgbuild.c:319 with -mtune=pentiumpro)

	PR middle-end/48389
	* jump.c (rebuild_jump_labels_1, rebuild_jump_labels_chain): New
	functions.
	(rebuild_jump_labels): Call rebuild_jump_labels_1.
	* rtl.h (rebuild_jump_labels_chain): Declare.
	* cfgexpand.c (gimple_expand_cfg): Initialize JUMP_LABEL also on
        insns inserted on edges.

testsuite/
	* gcc.target/i386/pr48389.c: New test.

From-SVN: r172208
parent ad7be009
2011-04-08 Michael Matz <matz@suse.de>
PR middle-end/48389
* jump.c (rebuild_jump_labels_1, rebuild_jump_labels_chain): New
functions.
(rebuild_jump_labels): Call rebuild_jump_labels_1.
* rtl.h (rebuild_jump_labels_chain): Declare.
* cfgexpand.c (gimple_expand_cfg): Initialize JUMP_LABEL also on
insns inserted on edges.
2011-04-08 Joseph Myers <joseph@codesourcery.com> 2011-04-08 Joseph Myers <joseph@codesourcery.com>
* config.gcc (arm*-*-*): Add arm/arm-tables.opt to extra_options. * config.gcc (arm*-*-*): Add arm/arm-tables.opt to extra_options.
...@@ -16,7 +26,7 @@ ...@@ -16,7 +26,7 @@
* config/arm/t-arm ($(srcdir)/config/arm/arm-tables.opt): New. * config/arm/t-arm ($(srcdir)/config/arm/arm-tables.opt): New.
(arm.o): Update dependencies. (arm.o): Update dependencies.
2011-04-08 Basile Starynkevitch <basile@starynkevitch.net> 2011-04-08 Basile Starynkevitch <basile@starynkevitch.net>
* gengtype.c (write_typed_alloc_def): New argument f. Use it instead * gengtype.c (write_typed_alloc_def): New argument f. Use it instead
of header_file. of header_file.
......
...@@ -4143,6 +4143,8 @@ gimple_expand_cfg (void) ...@@ -4143,6 +4143,8 @@ gimple_expand_cfg (void)
/* Zap the tree EH table. */ /* Zap the tree EH table. */
set_eh_throw_stmt_table (cfun, NULL); set_eh_throw_stmt_table (cfun, NULL);
/* We need JUMP_LABEL be set in order to redirect jumps, and hence
split edges which edge insertions might do. */
rebuild_jump_labels (get_insns ()); rebuild_jump_labels (get_insns ());
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb) FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb)
...@@ -4153,6 +4155,7 @@ gimple_expand_cfg (void) ...@@ -4153,6 +4155,7 @@ gimple_expand_cfg (void)
{ {
if (e->insns.r) if (e->insns.r)
{ {
rebuild_jump_labels_chain (e->insns.r);
/* Avoid putting insns before parm_birth_insn. */ /* Avoid putting insns before parm_birth_insn. */
if (e->src == ENTRY_BLOCK_PTR if (e->src == ENTRY_BLOCK_PTR
&& single_succ_p (ENTRY_BLOCK_PTR) && single_succ_p (ENTRY_BLOCK_PTR)
......
...@@ -72,12 +72,9 @@ static void redirect_exp_1 (rtx *, rtx, rtx, rtx); ...@@ -72,12 +72,9 @@ static void redirect_exp_1 (rtx *, rtx, rtx, rtx);
static int invert_exp_1 (rtx, rtx); static int invert_exp_1 (rtx, rtx);
static int returnjump_p_1 (rtx *, void *); static int returnjump_p_1 (rtx *, void *);
/* This function rebuilds the JUMP_LABEL field and REG_LABEL_TARGET /* Worker for rebuild_jump_labels and rebuild_jump_labels_chain. */
notes in jumping insns and REG_LABEL_OPERAND notes in non-jumping static void
instructions and jumping insns that have labels as operands rebuild_jump_labels_1 (rtx f, bool count_forced)
(e.g. cbranchsi4). */
void
rebuild_jump_labels (rtx f)
{ {
rtx insn; rtx insn;
...@@ -89,12 +86,32 @@ rebuild_jump_labels (rtx f) ...@@ -89,12 +86,32 @@ rebuild_jump_labels (rtx f)
closely enough to delete them here, so make sure their reference closely enough to delete them here, so make sure their reference
count doesn't drop to zero. */ count doesn't drop to zero. */
if (count_forced)
for (insn = forced_labels; insn; insn = XEXP (insn, 1)) for (insn = forced_labels; insn; insn = XEXP (insn, 1))
if (LABEL_P (XEXP (insn, 0))) if (LABEL_P (XEXP (insn, 0)))
LABEL_NUSES (XEXP (insn, 0))++; LABEL_NUSES (XEXP (insn, 0))++;
timevar_pop (TV_REBUILD_JUMP); timevar_pop (TV_REBUILD_JUMP);
} }
/* This function rebuilds the JUMP_LABEL field and REG_LABEL_TARGET
notes in jumping insns and REG_LABEL_OPERAND notes in non-jumping
instructions and jumping insns that have labels as operands
(e.g. cbranchsi4). */
void
rebuild_jump_labels (rtx f)
{
rebuild_jump_labels_1 (f, true);
}
/* This function is like rebuild_jump_labels, but doesn't run over
forced_labels. It can be used on insn chains that aren't the
main function chain. */
void
rebuild_jump_labels_chain (rtx chain)
{
rebuild_jump_labels_1 (chain, false);
}
/* Some old code expects exactly one BARRIER as the NEXT_INSN of a /* Some old code expects exactly one BARRIER as the NEXT_INSN of a
non-fallthru insn. This is not generally true, as multiple barriers non-fallthru insn. This is not generally true, as multiple barriers
may have crept in, or the BARRIER may be separated from the last may have crept in, or the BARRIER may be separated from the last
......
...@@ -2315,6 +2315,7 @@ extern int redirect_jump_1 (rtx, rtx); ...@@ -2315,6 +2315,7 @@ extern int redirect_jump_1 (rtx, rtx);
extern void redirect_jump_2 (rtx, rtx, rtx, int, int); extern void redirect_jump_2 (rtx, rtx, rtx, int, int);
extern int redirect_jump (rtx, rtx, int); extern int redirect_jump (rtx, rtx, int);
extern void rebuild_jump_labels (rtx); extern void rebuild_jump_labels (rtx);
extern void rebuild_jump_labels_chain (rtx);
extern rtx reversed_comparison (const_rtx, enum machine_mode); extern rtx reversed_comparison (const_rtx, enum machine_mode);
extern enum rtx_code reversed_comparison_code (const_rtx, const_rtx); extern enum rtx_code reversed_comparison_code (const_rtx, const_rtx);
extern enum rtx_code reversed_comparison_code_parts (enum rtx_code, const_rtx, extern enum rtx_code reversed_comparison_code_parts (enum rtx_code, const_rtx,
......
2011-04-08 Michael Matz <matz@suse.de>
PR middle-end/48389
* gcc.target/i386/pr48389.c: New test.
2011-04-08 Andrey Belevantsev <abel@ispras.ru> 2011-04-08 Andrey Belevantsev <abel@ispras.ru>
PR rtl-optimization/48272 PR rtl-optimization/48272
...@@ -1828,6 +1833,13 @@ ...@@ -1828,6 +1833,13 @@
PR fortran/47775 PR fortran/47775
* gfortran.dg/func_result_6.f90: New. * gfortran.dg/func_result_6.f90: New.
2011-02-18 Michael Matz <matz@suse.de>
PR fortran/45586
* gfortran.dg/lto/pr45586_0.f90: New test.
* gfortran.dg/typebound_proc_20.f90: Ditto.
* gfortran.dg/typebound_proc_21.f90: Ditto.
2011-02-18 Paolo Carlini <paolo.carlini@oracle.com> 2011-02-18 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/47795 PR c++/47795
......
/* PR middle-end/48389 */
/* { dg-do compile } */
/* { dg-options "-O -mtune=pentiumpro -Wno-abi" } */
/* { dg-require-effective-target ilp32 } */
typedef float V2SF __attribute__ ((vector_size (128)));
V2SF foo (int x, V2SF a)
{
V2SF b = {};
if (x & 42)
b = a;
a += b;
return a;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment