diff --git a/gcc.version b/gcc.version index 15f1c21b2..adcdbbd2e 100644 --- a/gcc.version +++ b/gcc.version @@ -1 +1 @@ -gcc-9-20180715 +gcc-9-20180729 diff --git a/gcc/d/ChangeLog b/gcc/d/ChangeLog index f112edeaa..e5937f581 100644 --- a/gcc/d/ChangeLog +++ b/gcc/d/ChangeLog @@ -1,3 +1,9 @@ +2018-07-23 Eugene Wissner + + * d-lang.cc (d_handle_option): Change function argument to HOST_WIDE_INT. + * lang.opt (Walloca-larger-than=, Wno-alloca-larger-than): New options. + * opt.texi (Walloca-larger-than=, Wno-alloca-larger-than): Likewise. + 2018-07-21 Iain Buclaw * decl.cc (get_symbol_decl): Set all generated static symbols as diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc index 3c887afcb..7cfbd41d0 100644 --- a/gcc/d/d-lang.cc +++ b/gcc/d/d-lang.cc @@ -386,7 +386,7 @@ d_init_ts (void) Handles D specific options. Return false if we didn't do anything. */ static bool -d_handle_option (size_t scode, const char *arg, int value, +d_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value, int kind ATTRIBUTE_UNUSED, location_t loc ATTRIBUTE_UNUSED, const cl_option_handlers *handlers ATTRIBUTE_UNUSED) diff --git a/gcc/d/gdc.texi b/gcc/d/gdc.texi index 2dbb203cc..ea79352a4 100644 --- a/gcc/d/gdc.texi +++ b/gcc/d/gdc.texi @@ -551,6 +551,19 @@ Turns on all warnings messages. Warnings are not a defined part of the D language, and all constructs for which this may generate a warning message are legal code. +@item -Walloca +@cindex @option{-Walloca} +This option warns on all uses of "alloca" in the source. + +@item -Walloca-larger-than=@var{n} +@cindex @option{-Walloca-larger-than} +@cindex @option{-Wno-alloca-larger-than} +Warn on unbounded uses of alloca, and on bounded uses of alloca +whose bound can be larger than @var{n} bytes. +@option{-Wno-alloca-larger-than} disables +@option{-Walloca-larger-than} warning and is equivalent to +@option{-Walloca-larger-than=@var{SIZE_MAX}} or larger. + @item -Wcast-result @cindex @option{-Wcast-result} @cindex @option{-Wno-cast-result} diff --git a/gcc/d/lang.opt b/gcc/d/lang.opt index f90306d59..76883d45b 100644 --- a/gcc/d/lang.opt +++ b/gcc/d/lang.opt @@ -114,6 +114,18 @@ Werror D ; Documented in common.opt +Walloca +D +; Documented in C + +Walloca-larger-than= +D +; Documented in C + +Wno-alloca-larger-than +D +; Documented in C + Wspeculative D Warn from speculative compiles such as __traits(compiles). diff --git a/gcc/d/patches/patch-gcc-9.patch b/gcc/d/patches/patch-gcc-9.patch index d45457147..89625e757 100644 --- a/gcc/d/patches/patch-gcc-9.patch +++ b/gcc/d/patches/patch-gcc-9.patch @@ -4,7 +4,7 @@ relevant documentation about the GDC front end. --- a/gcc/config/powerpcspe/powerpcspe.c +++ b/gcc/config/powerpcspe/powerpcspe.c -@@ -32035,11 +32035,12 @@ rs6000_output_function_epilogue (FILE *f +@@ -32025,11 +32025,12 @@ rs6000_output_function_epilogue (FILE *f use language_string. C is 0. Fortran is 1. Pascal is 2. Ada is 3. C++ is 9. Java is 13. Objective-C is 14. Objective-C++ isn't assigned @@ -21,7 +21,7 @@ relevant documentation about the GDC front end. else if (! strcmp (language_string, "GNU F77") --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c -@@ -28490,11 +28490,12 @@ rs6000_output_function_epilogue (FILE *f +@@ -28146,11 +28146,12 @@ rs6000_output_function_epilogue (FILE *f use language_string. C is 0. Fortran is 1. Pascal is 2. Ada is 3. C++ is 9. Java is 13. Objective-C is 14. Objective-C++ isn't assigned @@ -93,7 +93,7 @@ relevant documentation about the GDC front end. in the @file{gcc} subdirectory of the object directory. You can also --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -1406,6 +1406,15 @@ Go source code. +@@ -1424,6 +1424,15 @@ Go source code. @item @var{file}.brig BRIG files (binary representation of HSAIL). @@ -109,7 +109,7 @@ relevant documentation about the GDC front end. @item @var{file}.ads Ada source code file that contains a library unit declaration (a declaration of a package, subprogram, or generic, or a generic -@@ -1452,6 +1461,7 @@ objective-c objective-c-header objecti +@@ -1470,6 +1479,7 @@ objective-c objective-c-header objecti objective-c++ objective-c++-header objective-c++-cpp-output assembler assembler-with-cpp ada @@ -164,7 +164,7 @@ relevant documentation about the GDC front end. /* Remove the specified attribute if present. Return TRUE if removal was successful. */ -@@ -24437,6 +24447,8 @@ gen_compile_unit_die (const char *filena +@@ -24438,6 +24448,8 @@ gen_compile_unit_die (const char *filena language = DW_LANG_ObjC; else if (strcmp (language_string, "GNU Objective-C++") == 0) language = DW_LANG_ObjC_plus_plus; @@ -173,7 +173,7 @@ relevant documentation about the GDC front end. else if (dwarf_version >= 5 || !dwarf_strict) { if (strcmp (language_string, "GNU Go") == 0) -@@ -26037,7 +26049,7 @@ declare_in_namespace (tree thing, dw_die +@@ -26038,7 +26050,7 @@ declare_in_namespace (tree thing, dw_die if (ns_context != context_die) { @@ -182,7 +182,7 @@ relevant documentation about the GDC front end. return ns_context; if (DECL_P (thing)) gen_decl_die (thing, NULL, NULL, ns_context); -@@ -26060,7 +26072,7 @@ gen_namespace_die (tree decl, dw_die_ref +@@ -26061,7 +26073,7 @@ gen_namespace_die (tree decl, dw_die_ref { /* Output a real namespace or module. */ context_die = setup_namespace_context (decl, comp_unit_die ()); @@ -191,7 +191,7 @@ relevant documentation about the GDC front end. ? DW_TAG_module : DW_TAG_namespace, context_die, decl); /* For Fortran modules defined in different CU don't add src coords. */ -@@ -26126,7 +26138,7 @@ gen_decl_die (tree decl, tree origin, st +@@ -26127,7 +26139,7 @@ gen_decl_die (tree decl, tree origin, st break; case CONST_DECL: @@ -200,7 +200,7 @@ relevant documentation about the GDC front end. { /* The individual enumerators of an enum type get output when we output the Dwarf representation of the relevant enum type itself. */ -@@ -26723,7 +26735,7 @@ dwarf2out_decl (tree decl) +@@ -26727,7 +26739,7 @@ dwarf2out_decl (tree decl) case CONST_DECL: if (debug_info_level <= DINFO_LEVEL_TERSE) return; @@ -209,7 +209,7 @@ relevant documentation about the GDC front end. return; if (TREE_STATIC (decl) && decl_function_context (decl)) context_die = lookup_decl_die (DECL_CONTEXT (decl)); -@@ -29118,6 +29130,7 @@ prune_unused_types_walk_local_classes (d +@@ -29122,6 +29134,7 @@ prune_unused_types_walk_local_classes (d case DW_TAG_structure_type: case DW_TAG_union_type: case DW_TAG_class_type: @@ -217,7 +217,7 @@ relevant documentation about the GDC front end. break; case DW_TAG_subprogram: -@@ -29151,6 +29164,7 @@ prune_unused_types_walk (dw_die_ref die) +@@ -29155,6 +29168,7 @@ prune_unused_types_walk (dw_die_ref die) case DW_TAG_structure_type: case DW_TAG_union_type: case DW_TAG_class_type: @@ -225,7 +225,7 @@ relevant documentation about the GDC front end. if (die->die_perennial_p) break; -@@ -29177,7 +29191,6 @@ prune_unused_types_walk (dw_die_ref die) +@@ -29181,7 +29195,6 @@ prune_unused_types_walk (dw_die_ref die) case DW_TAG_volatile_type: case DW_TAG_typedef: case DW_TAG_array_type: diff --git a/gcc/d/patches/patch-targetdm-9.patch b/gcc/d/patches/patch-targetdm-9.patch index 50c1e57ec..21a76c3ec 100644 --- a/gcc/d/patches/patch-targetdm-9.patch +++ b/gcc/d/patches/patch-targetdm-9.patch @@ -92,7 +92,7 @@ The following OS versions are implemented: # Target specific, Fortran specific object file FORTRAN_TARGET_OBJS=@fortran_target_objs@ -@@ -1786,6 +1794,7 @@ bconfig.h: cs-bconfig.h ; @true +@@ -1789,6 +1797,7 @@ bconfig.h: cs-bconfig.h ; @true tconfig.h: cs-tconfig.h ; @true tm.h: cs-tm.h ; @true tm_p.h: cs-tm_p.h ; @true @@ -100,7 +100,7 @@ The following OS versions are implemented: cs-config.h: Makefile TARGET_CPU_DEFAULT="" \ -@@ -1812,6 +1821,11 @@ cs-tm_p.h: Makefile +@@ -1815,6 +1824,11 @@ cs-tm_p.h: Makefile HEADERS="$(tm_p_include_list)" DEFINES="" \ $(SHELL) $(srcdir)/mkconfig.sh tm_p.h @@ -112,7 +112,7 @@ The following OS versions are implemented: # Don't automatically run autoconf, since configure.ac might be accidentally # newer than configure. Also, this writes into the source directory which # might be on a read-only file system. If configured for maintainer mode -@@ -2178,6 +2192,12 @@ default-c.o: config/default-c.c +@@ -2181,6 +2195,12 @@ default-c.o: config/default-c.c CFLAGS-prefix.o += -DPREFIX=\"$(prefix)\" -DBASEVER=$(BASEVER_s) prefix.o: $(BASEVER) @@ -125,7 +125,7 @@ The following OS versions are implemented: # Language-independent files. DRIVER_DEFINES = \ -@@ -2473,6 +2493,15 @@ s-common-target-hooks-def-h: build/genho +@@ -2477,6 +2497,15 @@ s-common-target-hooks-def-h: build/genho common/common-target-hooks-def.h $(STAMP) s-common-target-hooks-def-h @@ -141,7 +141,7 @@ The following OS versions are implemented: # check if someone mistakenly only changed tm.texi. # We use a different pathname here to avoid a circular dependency. s-tm-texi: $(srcdir)/doc/../doc/tm.texi -@@ -2496,6 +2525,7 @@ s-tm-texi: build/genhooks$(build_exeext) +@@ -2500,6 +2529,7 @@ s-tm-texi: build/genhooks$(build_exeext) && ( test $(srcdir)/doc/tm.texi -nt $(srcdir)/target.def \ || test $(srcdir)/doc/tm.texi -nt $(srcdir)/c-family/c-target.def \ || test $(srcdir)/doc/tm.texi -nt $(srcdir)/common/common-target.def \ @@ -149,7 +149,7 @@ The following OS versions are implemented: ); then \ echo >&2 ; \ echo You should edit $(srcdir)/doc/tm.texi.in rather than $(srcdir)/doc/tm.texi . >&2 ; \ -@@ -2633,14 +2663,15 @@ s-gtype: build/gengtype$(build_exeext) $ +@@ -2637,14 +2667,15 @@ s-gtype: build/gengtype$(build_exeext) $ -r gtype.state $(STAMP) s-gtype @@ -167,7 +167,7 @@ The following OS versions are implemented: cfn-operators.pd # -@@ -2784,7 +2815,7 @@ build/genrecog.o : genrecog.c $(RTL_BASE +@@ -2788,7 +2819,7 @@ build/genrecog.o : genrecog.c $(RTL_BASE $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) \ $(HASH_TABLE_H) inchash.h build/genhooks.o : genhooks.c $(TARGET_DEF) $(C_TARGET_DEF) \ @@ -374,7 +374,7 @@ The following OS versions are implemented: /* Uninitialized common symbols in non-PIE executables, even with --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h -@@ -554,6 +554,9 @@ enum aarch64_parse_opt_result aarch64_pa +@@ -570,6 +570,9 @@ enum aarch64_parse_opt_result aarch64_pa std::string aarch64_get_extension_string_for_isa_flags (unsigned long, unsigned long); @@ -1210,7 +1210,7 @@ The following OS versions are implemented: +} --- a/gcc/config/rs6000/rs6000-protos.h +++ b/gcc/config/rs6000/rs6000-protos.h -@@ -226,6 +226,9 @@ extern void rs6000_target_modify_macros +@@ -224,6 +224,9 @@ extern void rs6000_target_modify_macros extern void (*rs6000_target_modify_macros_ptr) (bool, HOST_WIDE_INT, HOST_WIDE_INT); @@ -1222,7 +1222,7 @@ The following OS versions are implemented: #endif --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h -@@ -756,6 +756,9 @@ extern unsigned char rs6000_recip_bits[] +@@ -743,6 +743,9 @@ extern unsigned char rs6000_recip_bits[] #define TARGET_CPU_CPP_BUILTINS() \ rs6000_cpu_cpp_builtins (pfile) @@ -1564,7 +1564,7 @@ The following OS versions are implemented: @node Driver @section Controlling the Compilation Driver, @file{gcc} @cindex driver -@@ -10643,6 +10652,22 @@ unloaded. The default is to return false +@@ -10619,6 +10628,22 @@ unloaded. The default is to return false Return target-specific mangling context of @var{decl} or @code{NULL_TREE}. @end deftypefn @@ -1612,7 +1612,7 @@ The following OS versions are implemented: @node Driver @section Controlling the Compilation Driver, @file{gcc} @cindex driver -@@ -7279,6 +7288,16 @@ floating-point support; they are not inc +@@ -7271,6 +7280,16 @@ floating-point support; they are not inc @hook TARGET_CXX_DECL_MANGLING_CONTEXT diff --git a/libphobos/configure b/libphobos/configure index 399eadc26..05d7e828c 100755 --- a/libphobos/configure +++ b/libphobos/configure @@ -649,8 +649,6 @@ DRUNTIME_OS_UNIX_FALSE DRUNTIME_OS_UNIX_TRUE DRUNTIME_GC_ENABLE_FALSE DRUNTIME_GC_ENABLE_TRUE -DRUNTIME_WERROR_FALSE -DRUNTIME_WERROR_TRUE libphobos_srcdir libphobos_builddir get_gcc_base_ver @@ -1423,7 +1421,7 @@ Optional Features: --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) - --enable-werror turns on -Werror [default=yes] + --enable-werror turns on -Werror [default=no] --enable-druntime-gc enable D runtime garbage collector (default: yes) --enable-unix enables Unix runtime (default: yes, for Unix targets) @@ -11208,7 +11206,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11211 "configure" +#line 11209 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11314,7 +11312,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11317 "configure" +#line 11315 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13550,18 +13548,9 @@ if test "${enable_werror+set}" = set; then : fi WERROR_FLAG="" - if test "x$enable_werror" != "xno"; then - enable_werror="yes" + if test "x$enable_werror" = "xyes"; then WERROR_FLAG="-Werror" fi - if test "$enable_werror" = "yes"; then - DRUNTIME_WERROR_TRUE= - DRUNTIME_WERROR_FALSE='#' -else - DRUNTIME_WERROR_TRUE='#' - DRUNTIME_WERROR_FALSE= -fi - # Check whether --enable-druntime-gc was given. @@ -14725,10 +14714,6 @@ if test -z "${ENABLE_STATIC_TRUE}" && test -z "${ENABLE_STATIC_FALSE}"; then as_fn_error "conditional \"ENABLE_STATIC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${DRUNTIME_WERROR_TRUE}" && test -z "${DRUNTIME_WERROR_FALSE}"; then - as_fn_error "conditional \"DRUNTIME_WERROR\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${DRUNTIME_GC_ENABLE_TRUE}" && test -z "${DRUNTIME_GC_ENABLE_FALSE}"; then as_fn_error "conditional \"DRUNTIME_GC_ENABLE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/libphobos/m4/druntime.m4 b/libphobos/m4/druntime.m4 index 93f01efc7..ee9b8ed7a 100644 --- a/libphobos/m4/druntime.m4 +++ b/libphobos/m4/druntime.m4 @@ -5,18 +5,15 @@ # DRUNTIME_WERROR # --------------- -# Add the --enable-werror option and create the -# DRUNTIME_WERROR conditional +# Check to see if -Werror is enabled. AC_DEFUN([DRUNTIME_WERROR], [ AC_ARG_ENABLE(werror, [AS_HELP_STRING([--enable-werror], - [turns on -Werror @<:@default=yes@:>@])]) + [turns on -Werror @<:@default=no@:>@])]) WERROR_FLAG="" - if test "x$enable_werror" != "xno"; then - enable_werror="yes" + if test "x$enable_werror" = "xyes"; then WERROR_FLAG="-Werror" fi - AM_CONDITIONAL([DRUNTIME_WERROR], [test "$enable_werror" = "yes"]) ])