X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Ffinal.c;h=5ef12ef36108e666b85d57ecfcb167eb2e4aba21;hb=15b50aec7e8167a05342fbfa84314c6edbcb15d6;hp=6ace9b24f940910063291b2afdd9a92a6a197bef;hpb=ed420a2578e99e494f74b297b8b016e1e9405e11;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/final.c b/gcc/final.c index 6ace9b24f94..5ef12ef3610 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -49,6 +49,7 @@ Boston, MA 02111-1307, USA. */ #include "tree.h" #include "rtl.h" +#include "tm_p.h" #include "regs.h" #include "insn-config.h" #include "insn-flags.h" @@ -2034,6 +2035,27 @@ final (first, file, optimize, prescan) free_insn_eh_region (); } +const char * +get_insn_template (code, insn) + int code; + rtx insn; +{ + const void *output = insn_data[code].output; + switch (insn_data[code].output_format) + { + case INSN_OUTPUT_FORMAT_SINGLE: + return (const char *) output; + case INSN_OUTPUT_FORMAT_MULTI: + return ((const char * const *) output)[which_alternative]; + case INSN_OUTPUT_FORMAT_FUNCTION: + if (insn == NULL) + abort (); + return (* (insn_output_fn) output) (recog_data.operand, insn); + + default: + abort (); + } +} /* The final scan for one insn, INSN. Args are same as in `final', except that INSN is the insn being scanned. @@ -2078,11 +2100,11 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG && ! exceptions_via_longjmp) { - ASM_OUTPUT_INTERNAL_LABEL (file, "LEHB", NOTE_BLOCK_NUMBER (insn)); + ASM_OUTPUT_INTERNAL_LABEL (file, "LEHB", NOTE_EH_HANDLER (insn)); if (! flag_new_exceptions) - add_eh_table_entry (NOTE_BLOCK_NUMBER (insn)); + add_eh_table_entry (NOTE_EH_HANDLER (insn)); #ifdef ASM_OUTPUT_EH_REGION_BEG - ASM_OUTPUT_EH_REGION_BEG (file, NOTE_BLOCK_NUMBER (insn)); + ASM_OUTPUT_EH_REGION_BEG (file, NOTE_EH_HANDLER (insn)); #endif break; } @@ -2090,11 +2112,11 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END && ! exceptions_via_longjmp) { - ASM_OUTPUT_INTERNAL_LABEL (file, "LEHE", NOTE_BLOCK_NUMBER (insn)); + ASM_OUTPUT_INTERNAL_LABEL (file, "LEHE", NOTE_EH_HANDLER (insn)); if (flag_new_exceptions) - add_eh_table_entry (NOTE_BLOCK_NUMBER (insn)); + add_eh_table_entry (NOTE_EH_HANDLER (insn)); #ifdef ASM_OUTPUT_EH_REGION_END - ASM_OUTPUT_EH_REGION_END (file, NOTE_BLOCK_NUMBER (insn)); + ASM_OUTPUT_EH_REGION_END (file, NOTE_EH_HANDLER (insn)); #endif break; } @@ -2864,10 +2886,8 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) extract_insn (insn); cleanup_subreg_operands (insn); -#ifdef REGISTER_CONSTRAINTS if (! constrain_operands (1)) fatal_insn_not_found (insn); -#endif /* Some target machines need to prescan each insn before it is output. */ @@ -2895,25 +2915,18 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) dwarf2out_frame_debug (insn); #endif - /* If the proper template needs to be chosen by some C code, - run that code and get the real template. */ + /* Find the proper template for this insn. */ + template = get_insn_template (insn_code_number, insn); - template = insn_template[insn_code_number]; + /* If the C code returns 0, it means that it is a jump insn + which follows a deleted test insn, and that test insn + needs to be reinserted. */ if (template == 0) { - template = ((*insn_outfun[insn_code_number]) - (recog_data.operand, insn)); - - /* If the C code returns 0, it means that it is a jump insn - which follows a deleted test insn, and that test insn - needs to be reinserted. */ - if (template == 0) - { - if (prev_nonnote_insn (insn) != last_ignored_compare) - abort (); - new_block = 0; - return prev_nonnote_insn (insn); - } + if (prev_nonnote_insn (insn) != last_ignored_compare) + abort (); + new_block = 0; + return prev_nonnote_insn (insn); } /* If the template is the string "#", it means that this insn must @@ -3359,11 +3372,13 @@ output_asm_name () { register int num = INSN_CODE (debug_insn); fprintf (asm_out_file, "\t%s %d\t%s", - ASM_COMMENT_START, INSN_UID (debug_insn), insn_name[num]); - if (insn_n_alternatives[num] > 1) + ASM_COMMENT_START, INSN_UID (debug_insn), + insn_data[num].name); + if (insn_data[num].n_alternatives > 1) fprintf (asm_out_file, "/%d", which_alternative + 1); #ifdef HAVE_ATTR_length - fprintf (asm_out_file, "\t[length = %d]", get_attr_length (debug_insn)); + fprintf (asm_out_file, "\t[length = %d]", + get_attr_length (debug_insn)); #endif /* Clear this so only the first assembler insn of any rtl insn will get the special comment for -dp. */ @@ -3866,6 +3881,7 @@ asm_fprintf VPROTO((FILE *file, const char *p, ...)) default: fputc (c, file); } + va_end (argptr); } /* Split up a CONST_DOUBLE or integer constant rtx