comparison gcc/final.c @ 63:b7f97abdc517 gcc-4.6-20100522

update gcc from gcc-4.5.0 to gcc-4.6
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Mon, 24 May 2010 12:47:05 +0900
parents 77e2b8dfacca
children f6334be47118
comparison
equal deleted inserted replaced
56:3c8a44c06a95 63:b7f97abdc517
1 /* Convert RTL to assembler code and output it, for GNU compiler. 1 /* Convert RTL to assembler code and output it, for GNU compiler.
2 Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 2 Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
3 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 3 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
4 Free Software Foundation, Inc. 4 Free Software Foundation, Inc.
5 5
6 This file is part of GCC. 6 This file is part of GCC.
7 7
8 GCC is free software; you can redistribute it and/or modify it under 8 GCC is free software; you can redistribute it and/or modify it under
56 #include "insn-config.h" 56 #include "insn-config.h"
57 #include "insn-attr.h" 57 #include "insn-attr.h"
58 #include "recog.h" 58 #include "recog.h"
59 #include "conditions.h" 59 #include "conditions.h"
60 #include "flags.h" 60 #include "flags.h"
61 #include "real.h"
62 #include "hard-reg-set.h" 61 #include "hard-reg-set.h"
63 #include "output.h" 62 #include "output.h"
64 #include "except.h" 63 #include "except.h"
65 #include "function.h" 64 #include "function.h"
66 #include "toplev.h" 65 #include "toplev.h"
204 static int dialect_number; 203 static int dialect_number;
205 #endif 204 #endif
206 205
207 /* Nonnull if the insn currently being emitted was a COND_EXEC pattern. */ 206 /* Nonnull if the insn currently being emitted was a COND_EXEC pattern. */
208 rtx current_insn_predicate; 207 rtx current_insn_predicate;
208
209 /* True if printing into -fdump-final-insns= dump. */
210 bool final_insns_dump_p;
209 211
210 #ifdef HAVE_ATTR_length 212 #ifdef HAVE_ATTR_length
211 static int asm_insn_count (rtx); 213 static int asm_insn_count (rtx);
212 #endif 214 #endif
213 static void profile_function (FILE *); 215 static void profile_function (FILE *);
3524 putc ('.', file); 3526 putc ('.', file);
3525 break; 3527 break;
3526 3528
3527 case SYMBOL_REF: 3529 case SYMBOL_REF:
3528 if (SYMBOL_REF_DECL (x)) 3530 if (SYMBOL_REF_DECL (x))
3529 { 3531 assemble_external (SYMBOL_REF_DECL (x));
3530 mark_decl_referenced (SYMBOL_REF_DECL (x));
3531 assemble_external (SYMBOL_REF_DECL (x));
3532 }
3533 #ifdef ASM_OUTPUT_SYMBOL_REF 3532 #ifdef ASM_OUTPUT_SYMBOL_REF
3534 ASM_OUTPUT_SYMBOL_REF (file, x); 3533 ASM_OUTPUT_SYMBOL_REF (file, x);
3535 #else 3534 #else
3536 assemble_name (file, XSTR (x, 0)); 3535 assemble_name (file, XSTR (x, 0));
3537 #endif 3536 #endif
4369 flag_dump_final_insns = NULL; 4368 flag_dump_final_insns = NULL;
4370 } 4369 }
4371 else 4370 else
4372 { 4371 {
4373 const char *aname; 4372 const char *aname;
4373 struct cgraph_node *node = cgraph_node (current_function_decl);
4374 4374
4375 aname = (IDENTIFIER_POINTER 4375 aname = (IDENTIFIER_POINTER
4376 (DECL_ASSEMBLER_NAME (current_function_decl))); 4376 (DECL_ASSEMBLER_NAME (current_function_decl)));
4377 fprintf (final_output, "\n;; Function (%s) %s\n\n", aname, 4377 fprintf (final_output, "\n;; Function (%s) %s\n\n", aname,
4378 cfun->function_frequency == FUNCTION_FREQUENCY_HOT 4378 node->frequency == NODE_FREQUENCY_HOT
4379 ? " (hot)" 4379 ? " (hot)"
4380 : cfun->function_frequency == FUNCTION_FREQUENCY_UNLIKELY_EXECUTED 4380 : node->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED
4381 ? " (unlikely executed)" 4381 ? " (unlikely executed)"
4382 : node->frequency == NODE_FREQUENCY_EXECUTED_ONCE
4383 ? " (executed once)"
4382 : ""); 4384 : "");
4383 4385
4384 flag_dump_noaddr = flag_dump_unnumbered = 1; 4386 flag_dump_noaddr = flag_dump_unnumbered = 1;
4385 if (flag_compare_debug_opt || flag_compare_debug) 4387 if (flag_compare_debug_opt || flag_compare_debug)
4386 dump_flags |= TDF_NOUID; 4388 dump_flags |= TDF_NOUID;
4389 final_insns_dump_p = true;
4387 4390
4388 for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) 4391 for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
4389 if (LABEL_P (insn)) 4392 if (LABEL_P (insn))
4390 INSN_UID (insn) = CODE_LABEL_NUMBER (insn); 4393 INSN_UID (insn) = CODE_LABEL_NUMBER (insn);
4391 else 4394 else
4415 4418
4416 if (final_output) 4419 if (final_output)
4417 { 4420 {
4418 flag_dump_noaddr = save_noaddr; 4421 flag_dump_noaddr = save_noaddr;
4419 flag_dump_unnumbered = save_unnumbered; 4422 flag_dump_unnumbered = save_unnumbered;
4423 final_insns_dump_p = false;
4420 4424
4421 if (fclose (final_output)) 4425 if (fclose (final_output))
4422 { 4426 {
4423 error ("could not close final insn dump file %qs: %s", 4427 error ("could not close final insn dump file %qs: %s",
4424 flag_dump_final_insns, strerror (errno)); 4428 flag_dump_final_insns, strerror (errno));