* 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
+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>
* c-common.c: Include c-lex.h.
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
necessary. */
- squeeze_notes (&a->head, &a->end);
+ if (squeeze_notes (&a->head, &a->end))
+ abort ();
/* Scramble the insn chain. */
if (a->end != PREV_INSN (b->head))
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
necessary. */
- squeeze_notes (&b->head, &b->end);
+ if (squeeze_notes (&b->head, &b->end))
+ abort ();
/* Scramble the insn chain. */
reorder_insns_nobb (b->head, b->end, a->end);
if (end == merge_bb->end)
merge_bb->end = PREV_INSN (head);
- squeeze_notes (&head, &end);
+ if (squeeze_notes (&head, &end))
+ return TRUE;
reorder_insns (head, end, PREV_INSN (earliest));
}
/* 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. 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)
rtx* startp;
rtx* endp;
last = insn;
}
- /* There were no real instructions, and we can't represent an empty
- range. Die. */
+ /* There were no real instructions. */
if (start == past_end)
- abort ();
+ return true;
end = last;
*startp = start;
*endp = end;
+ return false;
}
\f
/* Return the label before INSN, or put a new label there. */
/* Include the BARRIER after INSN and copy the
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);
/* All those insns are now in TARGET_LOOP. */
extern void cleanup_barriers PARAMS ((void));
/* 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 void delete_jump PARAMS ((rtx));
extern void delete_barrier PARAMS ((rtx));
before_case = NEXT_INSN (before_case);
end = get_last_insn ();
- squeeze_notes (&before_case, &end);
+ if (squeeze_notes (&before_case, &end))
+ abort ();
reorder_insns (before_case, end,
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>
* g++.dg/other/init1.C: New test.
--- /dev/null
+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);
+}