diff options
author | Zack Weinberg <zackw@panix.com> | 2001-08-12 01:56:10 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2001-08-12 01:56:10 +0000 |
commit | 94aca342987fa4c024f4aaa32c72715787ab84e5 (patch) | |
tree | 7e0d274b9d7e3a3888aa3d22cd6cba4854e43f24 /gcc/varasm.c | |
parent | 31cdd4996b4223793a65643fcbf69163c3623258 (diff) | |
download | gcc-94aca342987fa4c024f4aaa32c72715787ab84e5.zip gcc-94aca342987fa4c024f4aaa32c72715787ab84e5.tar.gz gcc-94aca342987fa4c024f4aaa32c72715787ab84e5.tar.bz2 |
toplev.c (set_float_handler): Make static.
* toplev.c (set_float_handler): Make static.
* toplev.h: Don't prototype set_float_handler.
* simplify-rtx.c: Don't include setjmp.h.
(simplify_unary_real, simplify_binary_real, simplify_binary_is2orm1):
New functions.
(simplify_unary_operation, simplify_binary_operation): Use them,
via do_float_handler.
* fold-const.c: Don't include setjmp.h.
(exact_real_inverse_1): New function.
(exact_real_inverse): Use it, via do_float_handler.
* varasm.c: Don't include setjmp.h.
(assemble_real_1): New function.
(assemble_real): Use it, via do_float_handler.
Call internal_error if we get a trap here.
* c-parse.in, cse.c, cselib.c, ch/lex.c, config/i386/i386.c,
config/pj/pj.c, config/s390/s390.c: Don't include setjmp.h.
* java/lex.h: Don't include setjmp.h. Don't define
SET_FLOAT_HANDLER or prototype set_float_handler.
From-SVN: r44815
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 7480cf6..5f2810a 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -29,7 +29,6 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #include "system.h" -#include <setjmp.h> #include "rtl.h" #include "tree.h" #include "flags.h" @@ -138,6 +137,7 @@ tree last_assemble_variable_decl; static const char *strip_reg_name PARAMS ((const char *)); static int contains_pointers_p PARAMS ((tree)); +static void assemble_real_1 PARAMS ((PTR)); static void decode_addr_const PARAMS ((tree, struct addr_const *)); static int const_hash PARAMS ((tree)); static int compare_constant PARAMS ((tree, @@ -1798,68 +1798,74 @@ assemble_integer (x, size, force) } /* Assemble the floating-point constant D into an object of size MODE. */ - -void -assemble_real (d, mode) - REAL_VALUE_TYPE d; - enum machine_mode mode; +struct assemble_real_args { - jmp_buf output_constant_handler; - - if (setjmp (output_constant_handler)) - { - error ("floating point trap outputting a constant"); -#ifdef REAL_IS_NOT_DOUBLE - memset ((char *) &d, 0, sizeof d); - d = dconst0; -#else - d = 0; -#endif - } + REAL_VALUE_TYPE *d; + enum machine_mode mode; +}; - set_float_handler (output_constant_handler); +static void +assemble_real_1 (p) + PTR p; +{ + struct assemble_real_args *args = (struct assemble_real_args *) p; + REAL_VALUE_TYPE *d = args->d; + enum machine_mode mode = args->mode; switch (mode) { #ifdef ASM_OUTPUT_BYTE_FLOAT case QFmode: - ASM_OUTPUT_BYTE_FLOAT (asm_out_file, d); + ASM_OUTPUT_BYTE_FLOAT (asm_out_file, *d); break; #endif #ifdef ASM_OUTPUT_SHORT_FLOAT case HFmode: - ASM_OUTPUT_SHORT_FLOAT (asm_out_file, d); + ASM_OUTPUT_SHORT_FLOAT (asm_out_file, *d); break; #endif #ifdef ASM_OUTPUT_THREE_QUARTER_FLOAT case TQFmode: - ASM_OUTPUT_THREE_QUARTER_FLOAT (asm_out_file, d); + ASM_OUTPUT_THREE_QUARTER_FLOAT (asm_out_file, *d); break; #endif #ifdef ASM_OUTPUT_FLOAT case SFmode: - ASM_OUTPUT_FLOAT (asm_out_file, d); + ASM_OUTPUT_FLOAT (asm_out_file, *d); break; #endif #ifdef ASM_OUTPUT_DOUBLE case DFmode: - ASM_OUTPUT_DOUBLE (asm_out_file, d); + ASM_OUTPUT_DOUBLE (asm_out_file, *d); break; #endif #ifdef ASM_OUTPUT_LONG_DOUBLE case XFmode: case TFmode: - ASM_OUTPUT_LONG_DOUBLE (asm_out_file, d); + ASM_OUTPUT_LONG_DOUBLE (asm_out_file, *d); break; #endif default: abort (); } +} + +void +assemble_real (d, mode) + REAL_VALUE_TYPE d; + enum machine_mode mode; +{ + struct assemble_real_args args; + args.d = &d; + args.mode = mode; + + if (do_float_handler (assemble_real_1, (PTR) &args)) + return; - set_float_handler (NULL); + internal_error ("floating point trap outputting a constant"); } /* Here we combine duplicate floating constants to make |