ia64.c (169690) | ia64.c (215840) |
---|---|
1/* Definitions of target machine for GNU compiler. 2 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 3 Free Software Foundation, Inc. 4 Contributed by James E. Wilson <wilson@cygnus.com> and 5 David Mosberger <davidm@hpl.hp.com>. 6 7This file is part of GCC. 8 --- 236 unchanged lines hidden (view full) --- 245 246static int ia64_hpux_reloc_rw_mask (void) ATTRIBUTE_UNUSED; 247static int ia64_reloc_rw_mask (void) ATTRIBUTE_UNUSED; 248static section *ia64_select_rtx_section (enum machine_mode, rtx, 249 unsigned HOST_WIDE_INT); 250static void ia64_output_dwarf_dtprel (FILE *, int, rtx) 251 ATTRIBUTE_UNUSED; 252static unsigned int ia64_section_type_flags (tree, const char *, int); | 1/* Definitions of target machine for GNU compiler. 2 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 3 Free Software Foundation, Inc. 4 Contributed by James E. Wilson <wilson@cygnus.com> and 5 David Mosberger <davidm@hpl.hp.com>. 6 7This file is part of GCC. 8 --- 236 unchanged lines hidden (view full) --- 245 246static int ia64_hpux_reloc_rw_mask (void) ATTRIBUTE_UNUSED; 247static int ia64_reloc_rw_mask (void) ATTRIBUTE_UNUSED; 248static section *ia64_select_rtx_section (enum machine_mode, rtx, 249 unsigned HOST_WIDE_INT); 250static void ia64_output_dwarf_dtprel (FILE *, int, rtx) 251 ATTRIBUTE_UNUSED; 252static unsigned int ia64_section_type_flags (tree, const char *, int); |
253static void ia64_hpux_add_extern_decl (tree decl) 254 ATTRIBUTE_UNUSED; 255static void ia64_hpux_file_end (void) 256 ATTRIBUTE_UNUSED; | |
257static void ia64_init_libfuncs (void) 258 ATTRIBUTE_UNUSED; 259static void ia64_hpux_init_libfuncs (void) 260 ATTRIBUTE_UNUSED; 261static void ia64_sysv4_init_libfuncs (void) 262 ATTRIBUTE_UNUSED; 263static void ia64_vms_init_libfuncs (void) 264 ATTRIBUTE_UNUSED; --- 4745 unchanged lines hidden (view full) --- 5010 default: 5011 break; 5012 } 5013 5014 return NO_REGS; 5015} 5016 5017 | 253static void ia64_init_libfuncs (void) 254 ATTRIBUTE_UNUSED; 255static void ia64_hpux_init_libfuncs (void) 256 ATTRIBUTE_UNUSED; 257static void ia64_sysv4_init_libfuncs (void) 258 ATTRIBUTE_UNUSED; 259static void ia64_vms_init_libfuncs (void) 260 ATTRIBUTE_UNUSED; --- 4745 unchanged lines hidden (view full) --- 5006 default: 5007 break; 5008 } 5009 5010 return NO_REGS; 5011} 5012 5013 |
5018/* Emit text to declare externally defined variables and functions, because 5019 the Intel assembler does not support undefined externals. */ 5020 5021void 5022ia64_asm_output_external (FILE *file, tree decl, const char *name) 5023{ 5024 int save_referenced; 5025 5026 /* GNU as does not need anything here, but the HP linker does need 5027 something for external functions. */ 5028 5029 if (TARGET_GNU_AS 5030 && (!TARGET_HPUX_LD 5031 || TREE_CODE (decl) != FUNCTION_DECL 5032 || strstr (name, "__builtin_") == name)) 5033 return; 5034 5035 /* ??? The Intel assembler creates a reference that needs to be satisfied by 5036 the linker when we do this, so we need to be careful not to do this for 5037 builtin functions which have no library equivalent. Unfortunately, we 5038 can't tell here whether or not a function will actually be called by 5039 expand_expr, so we pull in library functions even if we may not need 5040 them later. */ 5041 if (! strcmp (name, "__builtin_next_arg") 5042 || ! strcmp (name, "alloca") 5043 || ! strcmp (name, "__builtin_constant_p") 5044 || ! strcmp (name, "__builtin_args_info")) 5045 return; 5046 5047 if (TARGET_HPUX_LD) 5048 ia64_hpux_add_extern_decl (decl); 5049 else 5050 { 5051 /* assemble_name will set TREE_SYMBOL_REFERENCED, so we must save and 5052 restore it. */ 5053 save_referenced = TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)); 5054 if (TREE_CODE (decl) == FUNCTION_DECL) 5055 ASM_OUTPUT_TYPE_DIRECTIVE (file, name, "function"); 5056 (*targetm.asm_out.globalize_label) (file, name); 5057 TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)) = save_referenced; 5058 } 5059} 5060 | |
5061/* Parse the -mfixed-range= option string. */ 5062 5063static void 5064fix_range (const char *const_str) 5065{ 5066 int i, first, last; 5067 char *str, *dash, *comma; 5068 --- 4149 unchanged lines hidden (view full) --- 9218 if (type && AGGREGATE_TYPE_P (type) 9219 && int_size_in_bytes (type) < UNITS_PER_WORD) 9220 return upward; 9221 9222 /* Fall back to the default. */ 9223 return DEFAULT_FUNCTION_ARG_PADDING (mode, type); 9224} 9225 | 5014/* Parse the -mfixed-range= option string. */ 5015 5016static void 5017fix_range (const char *const_str) 5018{ 5019 int i, first, last; 5020 char *str, *dash, *comma; 5021 --- 4149 unchanged lines hidden (view full) --- 9171 if (type && AGGREGATE_TYPE_P (type) 9172 && int_size_in_bytes (type) < UNITS_PER_WORD) 9173 return upward; 9174 9175 /* Fall back to the default. */ 9176 return DEFAULT_FUNCTION_ARG_PADDING (mode, type); 9177} 9178 |
9226/* Linked list of all external functions that are to be emitted by GCC. 9227 We output the name if and only if TREE_SYMBOL_REFERENCED is set in 9228 order to avoid putting out names that are never really used. */ | 9179/* Emit text to declare externally defined variables and functions, because 9180 the Intel assembler does not support undefined externals. */ |
9229 | 9181 |
9230struct extern_func_list GTY(()) | 9182void 9183ia64_asm_output_external (FILE *file, tree decl, const char *name) |
9231{ | 9184{ |
9232 struct extern_func_list *next; 9233 tree decl; 9234}; 9235 9236static GTY(()) struct extern_func_list *extern_func_head; 9237 9238static void 9239ia64_hpux_add_extern_decl (tree decl) 9240{ 9241 struct extern_func_list *p = ggc_alloc (sizeof (struct extern_func_list)); 9242 9243 p->decl = decl; 9244 p->next = extern_func_head; 9245 extern_func_head = p; 9246} 9247 9248/* Print out the list of used global functions. */ 9249 9250static void 9251ia64_hpux_file_end (void) 9252{ 9253 struct extern_func_list *p; 9254 9255 for (p = extern_func_head; p; p = p->next) | 9185 /* We output the name if and only if TREE_SYMBOL_REFERENCED is 9186 set in order to avoid putting out names that are never really 9187 used. */ 9188 if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))) |
9256 { | 9189 { |
9257 tree decl = p->decl; 9258 tree id = DECL_ASSEMBLER_NAME (decl); | 9190 /* maybe_assemble_visibility will return 1 if the assembler 9191 visibility directive is outputed. */ 9192 int need_visibility = ((*targetm.binds_local_p) (decl) 9193 && maybe_assemble_visibility (decl)); |
9259 | 9194 |
9260 gcc_assert (id); 9261 9262 if (!TREE_ASM_WRITTEN (decl) && TREE_SYMBOL_REFERENCED (id)) 9263 { 9264 const char *name = XSTR (XEXP (DECL_RTL (decl), 0), 0); 9265 9266 TREE_ASM_WRITTEN (decl) = 1; 9267 (*targetm.asm_out.globalize_label) (asm_out_file, name); 9268 fputs (TYPE_ASM_OP, asm_out_file); 9269 assemble_name (asm_out_file, name); 9270 fprintf (asm_out_file, "," TYPE_OPERAND_FMT "\n", "function"); 9271 } | 9195 /* GNU as does not need anything here, but the HP linker does 9196 need something for external functions. */ 9197 if ((TARGET_HPUX_LD || !TARGET_GNU_AS) 9198 && TREE_CODE (decl) == FUNCTION_DECL) 9199 { 9200 ASM_OUTPUT_TYPE_DIRECTIVE (file, name, "function"); 9201 (*targetm.asm_out.globalize_label) (file, name); 9202 } 9203 else if (need_visibility && !TARGET_GNU_AS) 9204 (*targetm.asm_out.globalize_label) (file, name); |
9272 } | 9205 } |
9273 9274 extern_func_head = 0; | |
9275} 9276 9277/* Set SImode div/mod functions, init_integral_libfuncs only initializes 9278 modes of word_mode and larger. Rename the TFmode libfuncs using the 9279 HPUX conventions. __divtf3 is used for XFmode. We need to keep it for 9280 backward compatibility. */ 9281 9282static void --- 557 unchanged lines hidden --- | 9206} 9207 9208/* Set SImode div/mod functions, init_integral_libfuncs only initializes 9209 modes of word_mode and larger. Rename the TFmode libfuncs using the 9210 HPUX conventions. __divtf3 is used for XFmode. We need to keep it for 9211 backward compatibility. */ 9212 9213static void --- 557 unchanged lines hidden --- |