diff options
author | YamaArashi <shadow962@live.com> | 2016-04-25 20:09:57 -0700 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2016-04-25 20:09:57 -0700 |
commit | 31cf69f88e968da5857ee39333d60bb81c021520 (patch) | |
tree | 37e685b669a30209b7db7a6f5b21faed90c5819c /gcc | |
parent | b03d2c9d30b7f15fddd6fb34401b4ca58a121229 (diff) |
make compilable using MinGW
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/Makefile | 4 | ||||
-rwxr-xr-x | gcc/config/arm/thumb.md | 4 | ||||
-rwxr-xr-x | gcc/obstack.h | 25 | ||||
-rwxr-xr-x | gcc/real.h | 2 | ||||
-rwxr-xr-x | gcc/system.h | 12 | ||||
-rwxr-xr-x | gcc/toplev.c | 69 |
6 files changed, 26 insertions, 90 deletions
diff --git a/gcc/Makefile b/gcc/Makefile index f97f677..d03008f 100644 --- a/gcc/Makefile +++ b/gcc/Makefile @@ -22,7 +22,7 @@ srcdir = . VPATH = $(srcdir) -CFLAGS = -g +CFLAGS = -g -std=gnu11 CC = gcc @@ -35,7 +35,7 @@ md_file=$(srcdir)/config/arm/thumb.md # This tells GNU Make version 3 not to put all variables in the environment. .NOEXPORT: -HOST_RTL = rtl.o bitmap.o +HOST_RTL = rtl.o bitmap.o obstack.o HOST_RTLANAL = rtlanal.o HOST_PRINT = print-rtl.o diff --git a/gcc/config/arm/thumb.md b/gcc/config/arm/thumb.md index a99917f..ed37724 100755 --- a/gcc/config/arm/thumb.md +++ b/gcc/config/arm/thumb.md @@ -1117,7 +1117,7 @@ case MODE_FLOAT: { union real_extract u; - bcopy ((char *) &CONST_DOUBLE_LOW (operands[0]), (char *) &u, sizeof u); + memcpy((char *)&u, (char *)&CONST_DOUBLE_LOW(operands[0]), sizeof u); assemble_real (u.d, GET_MODE (operands[0])); break; } @@ -1139,7 +1139,7 @@ case MODE_FLOAT: { union real_extract u; - bcopy ((char *) &CONST_DOUBLE_LOW (operands[0]), (char *) &u, sizeof u); + memcpy((char *)&u, (char *)&CONST_DOUBLE_LOW(operands[0]), sizeof u); assemble_real (u.d, GET_MODE (operands[0])); break; } diff --git a/gcc/obstack.h b/gcc/obstack.h index 09f1422..2fb012c 100755 --- a/gcc/obstack.h +++ b/gcc/obstack.h @@ -130,27 +130,12 @@ extern "C" { available, include it and use ptrdiff_t. In traditional C, long is the best that we can do. */ -#ifdef __PTRDIFF_TYPE__ -# define PTR_INT_TYPE __PTRDIFF_TYPE__ -#else -# ifdef HAVE_STDDEF_H -# include <stddef.h> -# define PTR_INT_TYPE ptrdiff_t -# else -# define PTR_INT_TYPE long -# endif -#endif -#if defined _LIBC || defined HAVE_STRING_H -# include <string.h> -# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N)) -#else -# ifdef memcpy -# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N)) -# else -# define _obstack_memcpy(To, From, N) bcopy ((From), (To), (N)) -# endif -#endif +#include <stddef.h> +#define PTR_INT_TYPE ptrdiff_t + +#include <string.h> +#define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N)) struct _obstack_chunk /* Lives at front of each chunk. */ { @@ -353,7 +353,7 @@ REAL_VALUE_TYPE real_value_from_int_cst (union tree_node *, #define REAL_VALUE_FROM_CONST_DOUBLE(to, from) \ do { union real_extract u; \ - bcopy ((char *) &CONST_DOUBLE_LOW ((from)), (char *) &u, sizeof u); \ + memcpy((char *)&u, (char *)&CONST_DOUBLE_LOW(from), sizeof u); \ to = u.d; } while (0) /* Return a CONST_DOUBLE with value R and mode M. */ diff --git a/gcc/system.h b/gcc/system.h index 1022bbd..5cac102 100755 --- a/gcc/system.h +++ b/gcc/system.h @@ -72,8 +72,6 @@ Boston, MA 02111-1307, USA. */ #include <sys/stat.h> #include <sys/param.h> #include <sys/time.h> -#include <sys/times.h> -#include <sys/wait.h> #include <fcntl.h> /* Some systems define these in, e.g., param.h. We undefine these names @@ -102,9 +100,11 @@ Boston, MA 02111-1307, USA. */ #define _(String) String #define N_(String) String -extern void *xmalloc (size_t); -extern void *xrealloc (void *, size_t); -extern void *xcalloc (size_t, size_t); -extern char *xstrdup (const char *); +extern void *xmalloc(size_t); +extern void *xrealloc(void *, size_t); +extern void *xcalloc(size_t, size_t); +extern char *xstrdup(const char *); + +extern void *alloca(size_t); #endif /* __GCC_SYSTEM_H__ */ diff --git a/gcc/toplev.c b/gcc/toplev.c index cc652c1..36db530 100755 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -306,10 +306,6 @@ int quiet_flag = 0; /* -f flags. */ -/* Nonzero means `char' should be signed. */ - -int flag_signed_char; - /* Nonzero means give an enum type only as many bytes as it needs. */ int flag_short_enums; @@ -1036,56 +1032,17 @@ int dump_time; /* Return time used so far, in microseconds. */ long -get_run_time () +get_run_time() { - if (quiet_flag) - return 0; + if (quiet_flag) + return 0; -#ifdef __BEOS__ - return 0; -#else /* not BeOS */ -#if defined (_WIN32) && !defined (__CYGWIN__) - if (clock() < 0) - return 0; - else - return (clock() * 1000); -#else /* not _WIN32 */ -#ifdef _SC_CLK_TCK - { - static int tick; - struct tms tms; - if (tick == 0) - tick = 1000000 / sysconf(_SC_CLK_TCK); - times (&tms); - return (tms.tms_utime + tms.tms_stime) * tick; - } -#else -#ifdef USG - { - struct tms tms; -# if HAVE_SYSCONF && defined _SC_CLK_TCK -# define TICKS_PER_SECOND sysconf (_SC_CLK_TCK) /* POSIX 1003.1-1996 */ -# else -# ifdef CLK_TCK -# define TICKS_PER_SECOND CLK_TCK /* POSIX 1003.1-1988; obsolescent */ -# else -# define TICKS_PER_SECOND HZ /* traditional UNIX */ -# endif -# endif - times (&tms); - return (tms.tms_utime + tms.tms_stime) * (1000000 / TICKS_PER_SECOND); - } -#else - { - struct rusage rusage; - getrusage (0, &rusage); - return (rusage.ru_utime.tv_sec * 1000000 + rusage.ru_utime.tv_usec - + rusage.ru_stime.tv_sec * 1000000 + rusage.ru_stime.tv_usec); - } -#endif /* USG */ -#endif /* _SC_CLK_TCK */ -#endif /* _WIN32 */ -#endif /* __BEOS__ */ + clock_t clk = clock(); + + if (clk < 0) + return 0; + + return (clk * 1000000) / CLOCKS_PER_SEC; } #define TIMEVAR(VAR, BODY) \ @@ -3669,13 +3626,7 @@ display_help () printf (" -o <file> Place output into <file> \n"); printf (" -G <number> Put global and static data smaller than <number>\n"); printf (" bytes into a special section (on some targets)\n"); - - for (i = NUM_ELEM (debug_args); i--;) - { - if (debug_args[i].description != NULL) - printf (" -%-22s %s\n", debug_args[i].arg, debug_args[i].description); - } - + printf (" -g Enable debug output\n"); printf (" -aux-info <file> Emit declaration info into <file>.X\n"); /* CYGNUS LOCAL v850/law */ printf (" -offset-info <file> Emit structure member offsets into <file>.s\n"); |