From: jakub Date: Thu, 4 Apr 2002 20:57:53 +0000 (+0000) Subject: * config/sparc/sparc.md (pic): New attribute. X-Git-Tag: upstream/4.9.2~87504 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=02b9b9f19b9d90134ad5c238565f9a70f1fdfbd2;p=platform%2Fupstream%2Flinaro-gcc.git * config/sparc/sparc.md (pic): New attribute. (do_builtin_setjmp_setup): Save %fp, %i7 and %l7 for TARGET_V9 into stack slots. (split after do_builtin_setjmp_setup): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51870 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8510f08..2566a78 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2002-04-04 Jakub Jelinek + * config/sparc/sparc.md (pic): New attribute. + (do_builtin_setjmp_setup): Save %fp, %i7 and %l7 for TARGET_V9 + into stack slots. + (split after do_builtin_setjmp_setup): New. + +2002-04-04 Jakub Jelinek + PR fortran/6106 * config/sparc/sparc.h (MIN_UNITS_PER_WORD): Backout 2001-01-01 change. diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md index d783fea..981249f 100644 --- a/gcc/config/sparc/sparc.md +++ b/gcc/config/sparc/sparc.md @@ -93,6 +93,9 @@ (define_attr "branch_type" "none,icc,fcc,reg" (const_string "none")) +(define_attr "pic" "false,true" + (symbol_ref "flag_pic != 0")) + ;; Length (in # of insns). (define_attr "length" "" (cond [(eq_attr "type" "uncond_branch,call,sibcall") @@ -8877,22 +8880,41 @@ DONE; }") -;; ??? Should set length to zero when !current_function_calls_alloca, -;; ??? but there is no easy way to get at that definition. It would -;; ??? require including function.h into sparc-protos.h and that is -;; ??? likely not a good idea. -DaveM (define_insn "do_builtin_setjmp_setup" [(unspec_volatile [(const_int 0)] 5)] "" "* { - if (!current_function_calls_alloca) - return \"\"; - if (TARGET_V9) - return \"flushw\"; - return \"ta\\t3\"; + if (! current_function_calls_alloca || ! TARGET_V9 || TARGET_FLAT) + return \"#\"; + fputs (\"\tflushw\n\", asm_out_file); + if (flag_pic) + fprintf (asm_out_file, \"\tst%c\t%%l7, [%%sp+%d]\n\", + TARGET_ARCH64 ? 'x' : 'w', + SPARC_STACK_BIAS + 7 * UNITS_PER_WORD); + fprintf (asm_out_file, \"\tst%c\t%%fp, [%%sp+%d]\n\", + TARGET_ARCH64 ? 'x' : 'w', + SPARC_STACK_BIAS + 14 * UNITS_PER_WORD); + fprintf (asm_out_file, \"\tst%c\t%%i7, [%%sp+%d]\n\", + TARGET_ARCH64 ? 'x' : 'w', + SPARC_STACK_BIAS + 15 * UNITS_PER_WORD); + return \"\"; }" - [(set_attr "type" "misc")]) + [(set_attr "type" "misc") + (set (attr "length") (if_then_else (eq_attr "pic" "true") + (const_int 4) + (const_int 3)))]) + +(define_split + [(unspec_volatile [(const_int 0)] 5)] + "! current_function_calls_alloca || ! TARGET_V9 || TARGET_FLAT" + [(const_int 0)] + " +{ + if (current_function_calls_alloca) + emit_insn (gen_flush_register_windows ()); + DONE; +}") ;; Pattern for use after a setjmp to store FP and the return register ;; into the stack area.