#include <sys/types.h>
#include <ctype.h>
#include <sys/stat.h>
-
-#ifndef _WIN32
+#if !defined (_WIN32) || defined (__CYGWIN32__)
#ifdef USG
#undef FLOAT
#include <sys/param.h>
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;
/* Nonzero means to run loop optimizations twice. */
-static int flag_rerun_loop_opt;
+int flag_rerun_loop_opt;
/* Nonzero for -finline-functions: ok to inline functions that look like
good inline candidates. */
"-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",
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;
int
get_run_time ()
{
-#ifndef _WIN32
+#if !defined (_WIN32) || defined (__CYGWIN32__)
#ifdef USG
struct tms tms;
#else
if (quiet_flag)
return 0;
-#ifdef _WIN32
+#if defined (_WIN32) && !defined (__CYGWIN32__)
if (clock() < 0)
return 0;
else
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)
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;
FILE *asm_file;
char *string;
{
+#ifdef OUTPUT_QUOTED_STRING
+ OUTPUT_QUOTED_STRING (asm_file, string);
+#else
char c;
putc ('\"', asm_file);
putc (c, asm_file);
}
putc ('\"', asm_file);
+#endif
}
/* Output a file name in the form wanted by System V. */
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");
if (jump_opt_dump)
fclose (jump_opt_dump_file);
+ if (addressof_dump)
+ fclose (addressof_dump_file);
+
if (cse_dump)
fclose (cse_dump_file);
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)
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,
{
{
TIMEVAR (loop_time,
{
- int save_flag_unroll_loops;
- int save_flag_unroll_all_loops;
-
if (flag_rerun_loop_opt)
{
/* We only want to perform unrolling once. */
- save_flag_unroll_loops = flag_unroll_loops;
- save_flag_unroll_all_loops = flag_unroll_all_loops;
- flag_unroll_loops = 0;
- flag_unroll_all_loops = 0;
- loop_optimize (insns, loop_dump_file);
+ loop_optimize (insns, loop_dump_file, 0);
/* The regscan pass may not be necessary, but let's
be safe until we can prove otherwise. */
reg_scan (insns, max_reg_num (), 1);
-
- /* Restore loop unrolling flags. */
- flag_unroll_loops = save_flag_unroll_loops;
- flag_unroll_all_loops = save_flag_unroll_all_loops;
}
- loop_optimize (insns, loop_dump_file);
+ loop_optimize (insns, loop_dump_file, flag_unroll_loops);
});
}
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;
case 'j':
jump_opt_dump = 1;
break;
+ case 'D':
+ addressof_dump = 1;
+ break;
case 'J':
jump2_opt_dump = 1;
break;
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)
- level = atoi (p);
+ {
+ level = atoi (p);
+ if (len > 1 && !strncmp (str, "gdwarf", len))
+ {
+ error ("use -gdwarf -g%d for DWARF v1, level %d",
+ level, level);
+ if (level == 2)
+ error ("use -gdwarf-2 for DWARF v2");
+ }
+ }
else
level = 2; /* default debugging info level */
if (*q || level > 3)
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) */