X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gcc%2Ftoplev.c;h=1922384881eb40c5d84fee0e1789fbf69ce62c26;hb=5ece974606452372382c845ae9ca7409a0872efd;hp=f7b659e784126fb23e3dbac0b3c8053719d1f070;hpb=5e9defae4f3e7422d3f0fa04fb16e29b676c0d29;p=gcc.git diff --git a/gcc/toplev.c b/gcc/toplev.c index f7b659e7841..1922384881e 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -192,9 +192,6 @@ void pedwarn_with_file_and_line PVPROTO((char *file, int line, char *s, ...)); void sorry PVPROTO((char *s, ...)); void really_sorry PVPROTO((char *s, ...)); void fancy_abort (); -#ifndef abort -void abort (); -#endif void set_target_switch (); static char *decl_name (); @@ -204,6 +201,10 @@ void print_switch_values (); /* Length of line when printing switch values. */ #define MAX_LINE 75 +#ifdef NEED_DECLARATION_ABORT +void abort (); +#endif + #ifdef NEED_DECLARATION_SBRK extern char *sbrk (); #endif @@ -275,7 +276,9 @@ int local_reg_dump = 0; int global_reg_dump = 0; int sched2_dump = 0; int jump2_opt_dump = 0; +#ifdef DELAY_SLOTS int dbr_sched_dump = 0; +#endif int flag_print_asm_name = 0; #ifdef STACK_REGS int stack_reg_dump = 0; @@ -623,19 +626,12 @@ int flag_schedule_insns_after_reload = 0; flag_schedule_speculative_load means allow speculative motion of some load insns. flag_schedule_speculative_load_dangerous allows speculative motion of more - load insns. - flag_schedule_reverse_before_reload means try to reverse original order - of insns (S). - flag_schedule_reverse_after_reload means try to reverse original order - of insns (R). */ + load insns. */ int flag_schedule_interblock = 1; int flag_schedule_speculative = 1; int flag_schedule_speculative_load = 0; int flag_schedule_speculative_load_dangerous = 0; -int flag_schedule_reverse_before_reload = 0; -int flag_schedule_reverse_after_reload = 0; - /* flag_on_branch_count_reg means try to replace add-1,compare,branch tupple by a cheaper branch, on a count register. */ @@ -750,8 +746,6 @@ struct { char *string; int *variable; int on_value;} f_options[] = {"sched-spec",&flag_schedule_speculative, 1}, {"sched-spec-load",&flag_schedule_speculative_load, 1}, {"sched-spec-load-dangerous",&flag_schedule_speculative_load_dangerous, 1}, - {"sched-reverse-S",&flag_schedule_reverse_before_reload, 1}, - {"sched-reverse-R",&flag_schedule_reverse_after_reload, 1}, {"branch-count-reg",&flag_branch_on_count_reg, 1}, #endif /* HAIFA */ {"pic", &flag_pic, 1}, @@ -991,7 +985,9 @@ int sched_time; int local_alloc_time; int global_alloc_time; int sched2_time; +#ifdef DELAY_SLOTS int dbr_sched_time; +#endif int shorten_branch_time; int stack_reg_time; int final_time; @@ -2080,20 +2076,23 @@ pipe_closed (signo) /* Strip off a legitimate source ending from the input string NAME of length LEN. Rather than having to know the names used by all of - our front ends, we strip off an ending of a period followed by one, - two, or three characters. */ + our front ends, we strip off an ending of a period followed by + up to five characters. (Java uses ".class".) */ void strip_off_ending (name, len) char *name; int len; { - if (len > 2 && name[len - 2] == '.') - name[len - 2] = '\0'; - else if (len > 3 && name[len - 3] == '.') - name[len - 3] = '\0'; - else if (len > 4 && name[len - 4] == '.') - name[len - 4] = '\0'; + int i; + for (i = 2; i < 6 && len > i; i++) + { + if (name[len - i] == '.') + { + name[len - i] = '\0'; + break; + } + } } /* Output a quoted string. */ @@ -2198,7 +2197,7 @@ open_dump_file (suffix, function_name) /* Routine to close a dump file. */ static void close_dump_file (func, insns) - void (*func)(FILE *, rtx); + void (*func) PROTO ((FILE *, rtx)); rtx insns; { TIMEVAR @@ -2221,7 +2220,7 @@ static void dump_rtl (suffix, decl, func, insns) char *suffix; tree decl; - void (*func)(FILE *, rtx); + void (*func) PROTO ((FILE *, rtx)); rtx insns; { open_dump_file (suffix, decl_printable_name (decl, 2)); @@ -2284,7 +2283,9 @@ compile_file (name) local_alloc_time = 0; global_alloc_time = 0; sched2_time = 0; +#ifdef DELAY_SLOTS dbr_sched_time = 0; +#endif shorten_branch_time = 0; stack_reg_time = 0; final_time = 0; @@ -2376,8 +2377,10 @@ compile_file (name) clean_dump_file (".sched2"); if (jump2_opt_dump) clean_dump_file (".jump2"); +#ifdef DELAY_SLOTS if (dbr_sched_dump) clean_dump_file (".dbr"); +#endif #ifdef STACK_REGS if (stack_reg_dump) clean_dump_file (".stack"); @@ -2864,7 +2867,9 @@ compile_file (name) print_time ("local-alloc", local_alloc_time); print_time ("global-alloc", global_alloc_time); print_time ("sched2", sched2_time); +#ifdef DELAY_SLOTS print_time ("dbranch", dbr_sched_time); +#endif print_time ("shorten-branch", shorten_branch_time); print_time ("stack-reg", stack_reg_time); print_time ("final", final_time); @@ -3376,8 +3381,13 @@ rest_of_compilation (decl) /* Do control and data flow analysis, and write some of the results to dump file. */ - TIMEVAR (flow_time, flow_analysis (insns, max_reg_num (), - rtl_dump_file)); + TIMEVAR + (flow_time, + { + find_basic_blocks (insns, max_reg_num (), rtl_dump_file, 1); + life_analysis (insns, max_reg_num (), rtl_dump_file); + }); + if (warn_uninitialized) { uninitialized_vars_warning (DECL_INITIAL (decl)); @@ -3404,7 +3414,7 @@ rest_of_compilation (decl) /* Register allocation pre-pass, to reduce number of moves necessary for two-address machines. */ - if (optimize > 0 && flag_regmove) + if (optimize > 0 && (flag_regmove || flag_expensive_optimizations)) { if (regmove_dump) open_dump_file (".regmove", decl_printable_name (decl, 2)); @@ -3794,12 +3804,6 @@ main (argc, argv, envp) flag_inline_functions = 1; } - /* Disable code bloating optimizations if optimizing for size. */ - if (optimize_size) - { - flag_inline_functions = 0; - } - /* Initialize target_flags before OPTIMIZATION_OPTIONS so the latter can modify it. */ target_flags = 0; @@ -3847,7 +3851,9 @@ main (argc, argv, envp) case 'a': branch_prob_dump = 1; combine_dump = 1; +#ifdef DELAY_SLOTS dbr_sched_dump = 1; +#endif flow_dump = 1; global_reg_dump = 1; jump_opt_dump = 1; @@ -3878,9 +3884,11 @@ main (argc, argv, envp) case 'c': combine_dump = 1; break; +#ifdef DELAY_SLOTS case 'd': dbr_sched_dump = 1; break; +#endif case 'f': flow_dump = 1; break; @@ -4210,7 +4218,7 @@ main (argc, argv, envp) type = PREFERRED_DEBUGGING_TYPE; if (len > 1 && strncmp (str, "ggdb", len) == 0) { -#ifdef DWARF2_DEBUGGING_INFO +#if defined (DWARF2_DEBUGGING_INFO) && !defined (LINKER_DOES_NOT_WORK_WITH_DWARF2) type = DWARF2_DEBUG; #else #ifdef DBX_DEBUGGING_INFO