ia64.md (prologue_use): New.

* config/ia64/ia64.md (prologue_use): New.
	* config/ia64/ia64.c (ia64_expand_prologue): Use
	gen_prologue_use instead of gen_rtx_USE.
	(group_barrier_needed_p): Handle CODE_FOR_prologue_use the same way
	as CODE_FOR_pred_rel_mutex.
	(ia64_sched_reorder2): Likewise.

	* gcc.c-torture/compile/20020116-1.c: New test.

From-SVN: r48946
This commit is contained in:
Jakub Jelinek 2002-01-17 13:07:58 +01:00 committed by Jakub Jelinek
parent 02c361a472
commit d0e8287098
5 changed files with 58 additions and 5 deletions

View File

@ -1,3 +1,12 @@
2002-01-17 Jakub Jelinek <jakub@redhat.com>
* config/ia64/ia64.md (prologue_use): New.
* config/ia64/ia64.c (ia64_expand_prologue): Use
gen_prologue_use instead of gen_rtx_USE.
(group_barrier_needed_p): Handle CODE_FOR_prologue_use the same way
as CODE_FOR_pred_rel_mutex.
(ia64_sched_reorder2): Likewise.
2002-01-16 Eric Christopher <echristo@redhat.com>
* config/mips/r3900.h: Reformat.

View File

@ -2137,7 +2137,7 @@ ia64_expand_prologue ()
/* Even if we're not going to generate an epilogue, we still
need to save the register so that EH works. */
if (! epilogue_p && current_frame_info.reg_save_ar_unat)
emit_insn (gen_rtx_USE (VOIDmode, ar_unat_save_reg));
emit_insn (gen_prologue_use (ar_unat_save_reg));
}
else
ar_unat_save_reg = NULL_RTX;
@ -2178,7 +2178,7 @@ ia64_expand_prologue ()
/* Even if we're not going to generate an epilogue, we still
need to save the register so that EH works. */
if (! epilogue_p)
emit_insn (gen_rtx_USE (VOIDmode, alt_reg));
emit_insn (gen_prologue_use (alt_reg));
}
else
{
@ -2222,7 +2222,7 @@ ia64_expand_prologue ()
/* Even if we're not going to generate an epilogue, we still
need to save the register so that EH works. */
if (! epilogue_p)
emit_insn (gen_rtx_USE (VOIDmode, alt_reg));
emit_insn (gen_prologue_use (alt_reg));
}
else
{
@ -2262,7 +2262,7 @@ ia64_expand_prologue ()
/* Even if we're not going to generate an epilogue, we still
need to save the register so that EH works. */
if (! epilogue_p)
emit_insn (gen_rtx_USE (VOIDmode, alt_reg));
emit_insn (gen_prologue_use (alt_reg));
}
else
{
@ -4776,6 +4776,7 @@ group_barrier_needed_p (insn)
/* Doesn't generate code. */
case CODE_FOR_pred_rel_mutex:
case CODE_FOR_prologue_use:
return 0;
default:
@ -6393,7 +6394,8 @@ ia64_sched_reorder2 (dump, sched_verbose, ready, pn_ready, clock_var)
/* Ignore cycle displays and .pred.rel.mutex. */
if (insn_code == CODE_FOR_cycle_display
|| insn_code == CODE_FOR_pred_rel_mutex)
|| insn_code == CODE_FOR_pred_rel_mutex
|| insn_code == CODE_FOR_prologue_use)
continue;
if (insn_code == CODE_FOR_insn_group_barrier)

View File

@ -67,6 +67,7 @@
;; 22 bundle selector
;; 23 cycle display
;; 24 addp4
;; 25 prologue_use
;;
;; unspec_volatile:
;; 0 alloc
@ -5302,3 +5303,12 @@
"addp4 %0 = 0,%1"
[(set_attr "itanium_class" "ialu")])
;;
;; As USE insns aren't meaningful after reload, this is used instead
;; to prevent deleting instructions setting registers for EH handling
(define_insn "prologue_use"
[(unspec:DI [(match_operand:DI 0 "register_operand" "")] 25)]
""
"// %0 needed for EH"
[(set_attr "itanium_class" "ignore")
(set_attr "predicable" "no")])

View File

@ -1,3 +1,7 @@
2002-01-17 Jakub Jelinek <jakub@redhat.com>
* gcc.c-torture/compile/20020116-1.c: New test.
2002-01-16 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/20020116-2.c: New test.

View File

@ -0,0 +1,28 @@
void noret (void) __attribute__ ((noreturn));
int foo (int, char **);
char *a, *b;
int d;
int
main (int argc, char **argv)
{
register int c;
d = 1;
while ((c = foo (argc, argv)) != -1)
switch (c) {
case 's':
case 'c':
case 'f':
a = b;
break;
case 'v':
d = 1;
break;
case 'V':
d = 0;
break;
}
noret ();
return 0;
}