diff options
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r-- | gcc/toplev.c | 59 |
1 files changed, 56 insertions, 3 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index c36554f..956d78e 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -239,6 +239,7 @@ extern int target_flags; int rtl_dump = 0; int rtl_dump_and_exit = 0; int jump_opt_dump = 0; +int addressof_dump = 0; int cse_dump = 0; int loop_dump = 0; int cse2_dump = 0; @@ -807,6 +808,11 @@ char *lang_options[] = "-Wno-format", "-Wimport", "-Wno-import", + "-Wimplicit-function-declaration", + "-Wno-implicit-function-declaration", + "-Werror-implicit-function-declaration", + "-Wimplicit-int", + "-Wno-implicit-int", "-Wimplicit", "-Wno-implicit", "-Wmain", @@ -938,6 +944,7 @@ FILE *asm_out_file; FILE *aux_info_file; FILE *rtl_dump_file; FILE *jump_opt_dump_file; +FILE *addressof_dump_file; FILE *cse_dump_file; FILE *loop_dump_file; FILE *cse2_dump_file; @@ -1104,6 +1111,8 @@ fatal_insn (message, insn) fflush (rtl_dump_file); if (jump_opt_dump_file) fflush (jump_opt_dump_file); + if (addressof_dump_file) + fflush (addressof_dump_file); if (cse_dump_file) fflush (cse_dump_file); if (loop_dump_file) @@ -1929,14 +1938,17 @@ xmalloc (size) return value; } -/* Same as `realloc' but report error if no memory available. */ +/* Same as `realloc' but report error if no memory available. + Also handle null PTR even if the vendor realloc gets it wrong. */ char * xrealloc (ptr, size) char *ptr; int size; { - char *result = (char *) realloc (ptr, size); + char *result = (ptr + ? (char *) realloc (ptr, size) + : (char *) malloc (size)); if (!result) fatal ("virtual memory exhausted"); return result; @@ -2096,6 +2108,9 @@ output_quoted_string (asm_file, string) FILE *asm_file; char *string; { +#ifdef OUTPUT_QUOTED_STRING + OUTPUT_QUOTED_STRING (asm_file, string); +#else char c; putc ('\"', asm_file); @@ -2106,6 +2121,7 @@ output_quoted_string (asm_file, string) putc (c, asm_file); } putc ('\"', asm_file); +#endif } /* Output a file name in the form wanted by System V. */ @@ -2269,6 +2285,10 @@ compile_file (name) if (jump_opt_dump) jump_opt_dump_file = open_dump_file (dump_base_name, ".jump"); + /* If addressof dump desired, open the output file. */ + if (addressof_dump) + addressof_dump_file = open_dump_file (dump_base_name, ".addressof"); + /* If cse dump desired, open the output file. */ if (cse_dump) cse_dump_file = open_dump_file (dump_base_name, ".cse"); @@ -2790,6 +2810,9 @@ compile_file (name) if (jump_opt_dump) fclose (jump_opt_dump_file); + if (addressof_dump) + fclose (addressof_dump_file); + if (cse_dump) fclose (cse_dump_file); @@ -3062,6 +3085,18 @@ rest_of_compilation (decl) functions containing nested functions since the nested function data is in our non-saved obstack. */ + /* If this is a nested inline, remove ADDRESSOF now so we can + finish compiling ourselves. Otherwise, wait until EOF. + We have to do this because the purge_addressof transformation + changes the DECL_RTL for many variables, which confuses integrate. */ + if (inlineable) + { + if (decl_function_context (decl)) + purge_addressof (insns); + else + DECL_DEFER_OUTPUT (decl) = 1; + } + if (! current_function_contains_functions && (DECL_DEFER_OUTPUT (decl) || (DECL_INLINE (decl) @@ -3254,6 +3289,18 @@ rest_of_compilation (decl) fflush (cse_dump_file); }); + purge_addressof (insns); + reg_scan (insns, max_reg_num (), 1); + + if (addressof_dump) + TIMEVAR (dump_time, + { + fprintf (addressof_dump_file, "\n;; Function %s\n\n", + (*decl_printable_name) (decl, 2)); + print_rtl (addressof_dump_file, insns); + fflush (addressof_dump_file); + }); + if (loop_dump) TIMEVAR (dump_time, { @@ -3911,6 +3958,7 @@ main (argc, argv, envp) flow_dump = 1; global_reg_dump = 1; jump_opt_dump = 1; + addressof_dump = 1; jump2_opt_dump = 1; local_reg_dump = 1; loop_dump = 1; @@ -3942,6 +3990,9 @@ main (argc, argv, envp) case 'j': jump_opt_dump = 1; break; + case 'D': + addressof_dump = 1; + break; case 'J': jump2_opt_dump = 1; break; @@ -4216,8 +4267,8 @@ main (argc, argv, envp) p = str + strlen (da->arg); if (*p && (*p < '0' || *p > '9')) continue; - q = p; len = p - str; + q = p; while (*q && (*q >= '0' && *q <= '9')) q++; if (*p) @@ -4402,11 +4453,13 @@ main (argc, argv, envp) lim - (char *) &environ); fflush (stderr); +#ifndef __MSDOS__ #ifdef USG system ("ps -l 1>&2"); #else /* not USG */ system ("ps v"); #endif /* not USG */ +#endif } #endif /* ! OS2 && ! VMS && (! _WIN32 || CYGWIN32) */ |