aboutsummaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2000-11-23 06:37:23 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2000-11-23 06:37:23 +0000
commit422be3c3ccc0a941ea3a0a40c339322681b28b2b (patch)
tree5c0256af6368b27411a55e15e137d7e09aea0433 /gcc/final.c
parent43c05634539cbdb4162ac6e067891e8f01ac2f62 (diff)
downloadgcc-422be3c3ccc0a941ea3a0a40c339322681b28b2b.zip
gcc-422be3c3ccc0a941ea3a0a40c339322681b28b2b.tar.gz
gcc-422be3c3ccc0a941ea3a0a40c339322681b28b2b.tar.bz2
final.c (output_addr_const): Simplify.
* final.c (output_addr_const) [LABEL_REF]: Simplify. [MINUS]: Enclose non-CONST_INTs in parentheses. [default]: Try OUTPUT_ADDR_CONST_EXTRA. * tm.texi (OUTPUT_ADDR_CONST_EXTRA): Document it. * varasm.c (decode_rtx_const) [CONST]: If it's not something PLUS or MINUS a CONST_INT, use the whole CONST with offset 0 instead of abort()ing. * sh.c (output_pic_addr_const): Removed. Fixed all callers. * sh.h (OUTPUT_ADDR_CONST_EXTRA): New. Handle the UNSPECs formerly handled in output_pic_addr_const. * sh.md (sym_label2reg, symPLT_label2reg): Enclose UNSPEC operands of MINUS in CONSTs so that decode_rtx_const() will accept them. From-SVN: r37691
Diffstat (limited to 'gcc/final.c')
-rw-r--r--gcc/final.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/final.c b/gcc/final.c
index c83f722..46c09ee 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -3677,10 +3677,8 @@ output_addr_const (file, x)
break;
case LABEL_REF:
- ASM_GENERATE_INTERNAL_LABEL (buf, "L", CODE_LABEL_NUMBER (XEXP (x, 0)));
- assemble_name (file, buf);
- break;
-
+ x = XEXP (x, 0);
+ /* Fall through. */
case CODE_LABEL:
ASM_GENERATE_INTERNAL_LABEL (buf, "L", CODE_LABEL_NUMBER (x));
assemble_name (file, buf);
@@ -3741,8 +3739,9 @@ output_addr_const (file, x)
output_addr_const (file, XEXP (x, 0));
fprintf (file, "-");
- if (GET_CODE (XEXP (x, 1)) == CONST_INT
- && INTVAL (XEXP (x, 1)) < 0)
+ if ((GET_CODE (XEXP (x, 1)) == CONST_INT
+ && INTVAL (XEXP (x, 1)) < 0)
+ || GET_CODE (XEXP (x, 1)) != CONST_INT)
{
fprintf (file, "%s", ASM_OPEN_PAREN);
output_addr_const (file, XEXP (x, 1));
@@ -3758,6 +3757,12 @@ output_addr_const (file, x)
break;
default:
+#ifdef OUTPUT_ADDR_CONST_EXTRA
+ OUTPUT_ADDR_CONST_EXTRA (file, x, fail);
+ break;
+
+ fail:
+#endif
output_operand_lossage ("invalid expression as operand");
}
}