aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Hainque <hainque@act-europe.fr>2003-03-06 01:32:29 +0100
committerRichard Kenner <kenner@gcc.gnu.org>2003-03-05 19:32:29 -0500
commit39ee7fa95535337ab8e7a0423f3cf00c1bd4ea84 (patch)
treefdc5929c54a284741c985108be1c6e50bb82f91f
parent99a86ee1e2f9dd165167bf57bbd756d288dd3640 (diff)
downloadgcc-39ee7fa95535337ab8e7a0423f3cf00c1bd4ea84.zip
gcc-39ee7fa95535337ab8e7a0423f3cf00c1bd4ea84.tar.gz
gcc-39ee7fa95535337ab8e7a0423f3cf00c1bd4ea84.tar.bz2
alpha.h (PRINT_OPERAND_PUNCT_VALID_P): Add '+'.
* config/alpha/alpha.h (PRINT_OPERAND_PUNCT_VALID_P): Add '+'. * config/alpha/alpha.c (print_operand, case '+'): New. * config/alpha/alpha.md (call_osf_1_noreturn): Document and use. (call_value_osf_1_noreturn): Likewise. From-SVN: r63882
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/alpha/alpha.c7
-rw-r--r--gcc/config/alpha/alpha.h5
-rw-r--r--gcc/config/alpha/alpha.md22
4 files changed, 34 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8a7b8b3..5d76f71 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+Wed Mar 5 19:34:18 2003 Olivier Hainque <hainque@act-europe.fr>
+
+ * config/alpha/alpha.h (PRINT_OPERAND_PUNCT_VALID_P): Add '+'.
+ * config/alpha/alpha.c (print_operand, case '+'): New.
+ * config/alpha/alpha.md (call_osf_1_noreturn): Document and use.
+ (call_value_osf_1_noreturn): Likewise.
+
Wed Mar 5 18:55:02 2003 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* stmt.c (fixup_gotos): Change meaning of DONT_JUMP_IN.
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index c21656d..28b9873 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -5916,6 +5916,13 @@ print_operand (file, x, code)
fputc ((TARGET_FLOAT_VAX ? 'g' : 't'), file);
break;
+ case '+':
+ /* Generates a nop after a noreturn call at the very end of the
+ function. */
+ if (next_real_insn (current_output_insn) == 0)
+ fprintf (file, "\n\tnop");
+ break;
+
case '#':
if (alpha_this_literal_sequence_number == 0)
alpha_this_literal_sequence_number = alpha_next_sequence_number++;
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index 2c79fa8..27f2822 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -1720,11 +1720,14 @@ do { \
- Generates double precision suffix for floating point
instructions (t for IEEE, g for VAX)
+
+ + Generates a nop instruction after a noreturn call at the very end
+ of the function
*/
#define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
((CODE) == '/' || (CODE) == ',' || (CODE) == '-' || (CODE) == '~' \
- || (CODE) == '#' || (CODE) == '*' || (CODE) == '&')
+ || (CODE) == '#' || (CODE) == '*' || (CODE) == '&' || (CODE) == '+')
/* Print a memory address as an operand to reference that memory location. */
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index 2d5285a..6674641 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -4687,6 +4687,16 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
"jsr $26,(%0),%2%J3"
[(set_attr "type" "jsr")])
+;; We output a nop after noreturn calls at the very end of the function to
+;; ensure that the return address always remains in the caller's code range,
+;; as not doing so might confuse unwinding engines.
+;;
+;; The potential change in insn length is not reflected in the length
+;; attributes at this stage. Since the extra space is only actually added at
+;; the very end of the compilation process (via final/print_operand), it
+;; really seems harmless and not worth the trouble of some extra computation
+;; cost and complexity.
+
(define_insn "*call_osf_1_noreturn"
[(call (mem:DI (match_operand:DI 0 "call_operand" "c,R,s"))
(match_operand 1 "" ""))
@@ -4695,9 +4705,9 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
"! TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF
&& find_reg_note (insn, REG_NORETURN, NULL_RTX)"
"@
- jsr $26,($27),0
- bsr $26,$%0..ng
- jsr $26,%0"
+ jsr $26,($27),0%+
+ bsr $26,$%0..ng%+
+ jsr $26,%0%+"
[(set_attr "type" "jsr")
(set_attr "length" "*,*,8")])
@@ -7920,9 +7930,9 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
"! TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF
&& find_reg_note (insn, REG_NORETURN, NULL_RTX)"
"@
- jsr $26,($27),0
- bsr $26,$%1..ng
- jsr $26,%1"
+ jsr $26,($27),0%+
+ bsr $26,$%1..ng%+
+ jsr $26,%1%+"
[(set_attr "type" "jsr")
(set_attr "length" "*,*,8")])