Commit 28cb2b14 by Roger Sayle Committed by Roger Sayle

re PR rtl-optimization/12628 (Segfault with -fno-expensive-optimizations -fno-rerun-loop-opt)


	PR optimization/12628
	* toplev.c (rest_of_handle_jump_bypass): Call reg_scan.
	* regclass.c (reg_scan): Include allocate_reg_info time in
	TV_REG_SCAN.  Minor clean-ups.
	(reg_scan_update): Minor clean-ups.

	* gcc.dg/20031201-1.c: New test case.

From-SVN: r74125
parent ea91ed09
2003-12-01 Roger Sayle <roger@eyesopen.com>
PR optimization/12628
* toplev.c (rest_of_handle_jump_bypass): Call reg_scan.
* regclass.c (reg_scan): Include allocate_reg_info time in
TV_REG_SCAN. Minor clean-ups.
(reg_scan_update): Minor clean-ups.
2003-12-01 Ulrich Weigand <uweigand@de.ibm.com> 2003-12-01 Ulrich Weigand <uweigand@de.ibm.com>
* config.gcc (s390x-ibm-tpf*): Add extra_parts. * config.gcc (s390x-ibm-tpf*): Add extra_parts.
......
...@@ -2293,21 +2293,20 @@ reg_scan (rtx f, unsigned int nregs, int repeat ATTRIBUTE_UNUSED) ...@@ -2293,21 +2293,20 @@ reg_scan (rtx f, unsigned int nregs, int repeat ATTRIBUTE_UNUSED)
{ {
rtx insn; rtx insn;
timevar_push (TV_REG_SCAN);
allocate_reg_info (nregs, TRUE, FALSE); allocate_reg_info (nregs, TRUE, FALSE);
max_parallel = 3; max_parallel = 3;
max_set_parallel = 0; max_set_parallel = 0;
timevar_push (TV_REG_SCAN);
for (insn = f; insn; insn = NEXT_INSN (insn)) for (insn = f; insn; insn = NEXT_INSN (insn))
if (GET_CODE (insn) == INSN if (INSN_P (insn))
|| GET_CODE (insn) == CALL_INSN
|| GET_CODE (insn) == JUMP_INSN)
{ {
if (GET_CODE (PATTERN (insn)) == PARALLEL rtx pat = PATTERN (insn);
&& XVECLEN (PATTERN (insn), 0) > max_parallel) if (GET_CODE (pat) == PARALLEL
max_parallel = XVECLEN (PATTERN (insn), 0); && XVECLEN (pat, 0) > max_parallel)
reg_scan_mark_refs (PATTERN (insn), insn, 0, 0); max_parallel = XVECLEN (pat, 0);
reg_scan_mark_refs (pat, insn, 0, 0);
if (REG_NOTES (insn)) if (REG_NOTES (insn))
reg_scan_mark_refs (REG_NOTES (insn), insn, 1, 0); reg_scan_mark_refs (REG_NOTES (insn), insn, 1, 0);
...@@ -2331,14 +2330,13 @@ reg_scan_update (rtx first, rtx last, unsigned int old_max_regno) ...@@ -2331,14 +2330,13 @@ reg_scan_update (rtx first, rtx last, unsigned int old_max_regno)
allocate_reg_info (max_reg_num (), FALSE, FALSE); allocate_reg_info (max_reg_num (), FALSE, FALSE);
for (insn = first; insn != last; insn = NEXT_INSN (insn)) for (insn = first; insn != last; insn = NEXT_INSN (insn))
if (GET_CODE (insn) == INSN if (INSN_P (insn))
|| GET_CODE (insn) == CALL_INSN
|| GET_CODE (insn) == JUMP_INSN)
{ {
if (GET_CODE (PATTERN (insn)) == PARALLEL rtx pat = PATTERN (insn);
&& XVECLEN (PATTERN (insn), 0) > max_parallel) if (GET_CODE (pat) == PARALLEL
max_parallel = XVECLEN (PATTERN (insn), 0); && XVECLEN (pat, 0) > max_parallel)
reg_scan_mark_refs (PATTERN (insn), insn, 0, old_max_regno); max_parallel = XVECLEN (pat, 0);
reg_scan_mark_refs (pat, insn, 0, old_max_regno);
if (REG_NOTES (insn)) if (REG_NOTES (insn))
reg_scan_mark_refs (REG_NOTES (insn), insn, 1, old_max_regno); reg_scan_mark_refs (REG_NOTES (insn), insn, 1, old_max_regno);
......
2003-12-01 Roger Sayle <roger@eyesopen.com>
PR optimization/12628
* gcc.dg/20031201-1.c: New test case.
2003-12-01 Eric Botcazou <ebotcazou@libertysurf.fr> 2003-12-01 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/unaligned-1.c: New test. * gcc.dg/unaligned-1.c: New test.
......
/* PR optimization/12628 */
/* The following test used to ICE in init_alias_analysis because the
given command line options meant that reg_scan wasn't (re)run before
the jump bypassing pass. */
/* { dg-do compile } */
/* { dg-options "-O2 -fno-expensive-optimizations -fno-rerun-loop-opt" } */
int outbuf[100];
int outcnt;
int bi_buf;
void send_bits(void)
{
bi_buf = 0;
outbuf[outcnt++] = 8;
outbuf[outcnt++] = 8;
if (outcnt)
bi_buf = 1;
}
...@@ -2571,6 +2571,7 @@ rest_of_handle_jump_bypass (tree decl, rtx insns) ...@@ -2571,6 +2571,7 @@ rest_of_handle_jump_bypass (tree decl, rtx insns)
open_dump_file (DFI_bypass, decl); open_dump_file (DFI_bypass, decl);
cleanup_cfg (CLEANUP_EXPENSIVE); cleanup_cfg (CLEANUP_EXPENSIVE);
reg_scan (insns, max_reg_num (), 1);
if (bypass_jumps (rtl_dump_file)) if (bypass_jumps (rtl_dump_file))
{ {
......
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