Commit 2b7d71b2 by Jakub Jelinek Committed by Jakub Jelinek

jump.c (squeeze_notes): Return true if no real insns were found.

	* jump.c (squeeze_notes): Return true if no real insns were found.
	* rtl.h (squeeze_notes): Adjust prototype.
	* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): If
	squeeze_notes finds no real instructions, abort.
	(merge_blocks_move_successor_nojumps): Likewise.
	* loop.c (find_and_verify_loops): Likewise.
	* stmt.c (expand_end_case): Likewise.
	* ifcvt.c (dead_or_predicable): Return TRUE if squeeze_notes doesn't
	find any real instructions.

	* gcc.c-torture/compile/20011114-4.c: New test.

From-SVN: r47048
parent 36a68fe7
2001-11-15 Jakub Jelinek <jakub@redhat.com>
* jump.c (squeeze_notes): Return true if no real insns were found.
* rtl.h (squeeze_notes): Adjust prototype.
* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): If
squeeze_notes finds no real instructions, abort.
(merge_blocks_move_successor_nojumps): Likewise.
* loop.c (find_and_verify_loops): Likewise.
* stmt.c (expand_end_case): Likewise.
* ifcvt.c (dead_or_predicable): Return TRUE if squeeze_notes doesn't
find any real instructions.
2001-11-15 Neil Booth <neil@daikokuya.demon.co.uk> 2001-11-15 Neil Booth <neil@daikokuya.demon.co.uk>
* c-common.c: Include c-lex.h. * c-common.c: Include c-lex.h.
......
...@@ -329,7 +329,8 @@ merge_blocks_move_predecessor_nojumps (a, b) ...@@ -329,7 +329,8 @@ merge_blocks_move_predecessor_nojumps (a, b)
and adjust the block trees appropriately. Even better would be to have and adjust the block trees appropriately. Even better would be to have
a tighter connection between block trees and rtl so that this is not a tighter connection between block trees and rtl so that this is not
necessary. */ necessary. */
squeeze_notes (&a->head, &a->end); if (squeeze_notes (&a->head, &a->end))
abort ();
/* Scramble the insn chain. */ /* Scramble the insn chain. */
if (a->end != PREV_INSN (b->head)) if (a->end != PREV_INSN (b->head))
...@@ -393,7 +394,8 @@ merge_blocks_move_successor_nojumps (a, b) ...@@ -393,7 +394,8 @@ merge_blocks_move_successor_nojumps (a, b)
and adjust the block trees appropriately. Even better would be to have and adjust the block trees appropriately. Even better would be to have
a tighter connection between block trees and rtl so that this is not a tighter connection between block trees and rtl so that this is not
necessary. */ necessary. */
squeeze_notes (&b->head, &b->end); if (squeeze_notes (&b->head, &b->end))
abort ();
/* Scramble the insn chain. */ /* Scramble the insn chain. */
reorder_insns_nobb (b->head, b->end, a->end); reorder_insns_nobb (b->head, b->end, a->end);
......
...@@ -2659,7 +2659,8 @@ dead_or_predicable (test_bb, merge_bb, other_bb, new_dest, reversep) ...@@ -2659,7 +2659,8 @@ dead_or_predicable (test_bb, merge_bb, other_bb, new_dest, reversep)
if (end == merge_bb->end) if (end == merge_bb->end)
merge_bb->end = PREV_INSN (head); merge_bb->end = PREV_INSN (head);
squeeze_notes (&head, &end); if (squeeze_notes (&head, &end))
return TRUE;
reorder_insns (head, end, PREV_INSN (earliest)); reorder_insns (head, end, PREV_INSN (earliest));
} }
......
...@@ -541,9 +541,10 @@ duplicate_loop_exit_test (loop_start) ...@@ -541,9 +541,10 @@ duplicate_loop_exit_test (loop_start)
/* Move all block-beg, block-end, loop-beg, loop-cont, loop-vtop, loop-end, /* Move all block-beg, block-end, loop-beg, loop-cont, loop-vtop, loop-end,
notes between START and END out before START. START and END may be such notes between START and END out before START. START and END may be such
notes. Returns the values of the new starting and ending insns, which notes. Returns the values of the new starting and ending insns, which
may be different if the original ones were such notes. */ may be different if the original ones were such notes.
Return true if there were only such notes and no real instructions. */
void bool
squeeze_notes (startp, endp) squeeze_notes (startp, endp)
rtx* startp; rtx* startp;
rtx* endp; rtx* endp;
...@@ -584,15 +585,15 @@ squeeze_notes (startp, endp) ...@@ -584,15 +585,15 @@ squeeze_notes (startp, endp)
last = insn; last = insn;
} }
/* There were no real instructions, and we can't represent an empty /* There were no real instructions. */
range. Die. */
if (start == past_end) if (start == past_end)
abort (); return true;
end = last; end = last;
*startp = start; *startp = start;
*endp = end; *endp = end;
return false;
} }
/* Return the label before INSN, or put a new label there. */ /* Return the label before INSN, or put a new label there. */
......
...@@ -2748,7 +2748,8 @@ find_and_verify_loops (f, loops) ...@@ -2748,7 +2748,8 @@ find_and_verify_loops (f, loops)
/* Include the BARRIER after INSN and copy the /* Include the BARRIER after INSN and copy the
block after LOC. */ block after LOC. */
squeeze_notes (&new_label, &last_insn_to_move); if (squeeze_notes (&new_label, &last_insn_to_move))
abort ();
reorder_insns (new_label, last_insn_to_move, loc); reorder_insns (new_label, last_insn_to_move, loc);
/* All those insns are now in TARGET_LOOP. */ /* All those insns are now in TARGET_LOOP. */
......
...@@ -1340,7 +1340,7 @@ extern void mark_jump_label PARAMS ((rtx, rtx, int)); ...@@ -1340,7 +1340,7 @@ extern void mark_jump_label PARAMS ((rtx, rtx, int));
extern void cleanup_barriers PARAMS ((void)); extern void cleanup_barriers PARAMS ((void));
/* In jump.c */ /* In jump.c */
extern void squeeze_notes PARAMS ((rtx *, rtx *)); extern bool squeeze_notes PARAMS ((rtx *, rtx *));
extern rtx delete_related_insns PARAMS ((rtx)); extern rtx delete_related_insns PARAMS ((rtx));
extern void delete_jump PARAMS ((rtx)); extern void delete_jump PARAMS ((rtx));
extern void delete_barrier PARAMS ((rtx)); extern void delete_barrier PARAMS ((rtx));
......
...@@ -5598,7 +5598,8 @@ expand_end_case (orig_index) ...@@ -5598,7 +5598,8 @@ expand_end_case (orig_index)
before_case = NEXT_INSN (before_case); before_case = NEXT_INSN (before_case);
end = get_last_insn (); end = get_last_insn ();
squeeze_notes (&before_case, &end); if (squeeze_notes (&before_case, &end))
abort ();
reorder_insns (before_case, end, reorder_insns (before_case, end,
thiscase->data.case_stmt.start); thiscase->data.case_stmt.start);
} }
......
2001-11-15 Jakub Jelinek <jakub@redhat.com>
* gcc.c-torture/compile/20011114-4.c: New test.
2001-11-15 Nathan Sidwell <nathan@codesourcery.com> 2001-11-15 Nathan Sidwell <nathan@codesourcery.com>
* g++.dg/other/init1.C: New test. * g++.dg/other/init1.C: New test.
......
static inline int foo (long x)
{
register int a = 0;
register unsigned b;
do
{
b = (x & 0x7f);
x = (x >> 7) | ~(-1L >> 7);
a += 1;
}
while ((x != 0 || (b & 0x40) != 0) && (x != -1 || (b & 0x40) == 0));
return a;
}
static inline int bar (unsigned long x)
{
register int a = 0;
register unsigned b;
do
{
b = (x & 0x7f);
x >>= 7;
a++;
}
while (x != 0);
return a;
}
int
baz (unsigned long x, int y)
{
if (y)
return foo ((long) x);
else
return bar (x);
}
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