Skip to content
This repository has been archived by the owner on Jun 20, 2019. It is now read-only.

Commit

Permalink
Update to gcc-9-20180923
Browse files Browse the repository at this point in the history
  • Loading branch information
belka-ew committed Sep 25, 2018
1 parent c7f8bce commit f8a05f4
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 37 deletions.
2 changes: 1 addition & 1 deletion gcc.version
@@ -1 +1 @@
gcc-9-20180909
gcc-9-20180923
7 changes: 7 additions & 0 deletions gcc/d/ChangeLog
@@ -1,3 +1,10 @@
2018-09-25 Eugene Wissner <belka@caraus.de>

* d-codegen.cc (d_assert_call): Don't make STRING_CSTs larger than they
are.
* expr.cc (ExprVisitor::visit(StringExp)): Likewise.
* typeinfo.cc (TypeInfoVisitor::layout_string): Likewise.

2018-09-18 Iain Buclaw <ibuclaw@gdcproject.org>

* d-lang.cc (deps_write): Use toChars accessor to get module path.
Expand Down
2 changes: 1 addition & 1 deletion gcc/d/d-codegen.cc
Expand Up @@ -1950,7 +1950,7 @@ d_assert_call (const Loc& loc, libcall_fn libcall, tree msg)
if (loc.filename)
{
unsigned len = strlen (loc.filename);
tree str = build_string (len + 1, loc.filename);
tree str = build_string (len, loc.filename);
TREE_TYPE (str) = make_array_type (Type::tchar, len);

file = d_array_value (build_ctype (Type::tchar->arrayOf ()),
Expand Down
2 changes: 1 addition & 1 deletion gcc/d/expr.cc
Expand Up @@ -2618,7 +2618,7 @@ class ExprVisitor : public Visitor
string[length] = '\0';

/* String value and type includes the null terminator. */
tree value = build_string (length + 1, string);
tree value = build_string (length, string);
TREE_TYPE (value) = make_array_type (tb->nextOf (), length + 1);
value = build_address (value);

Expand Down
22 changes: 11 additions & 11 deletions gcc/d/patches/patch-gcc-9.patch
Expand Up @@ -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
@@ -28405,11 +28405,12 @@ rs6000_output_function_epilogue (FILE *f
@@ -28410,11 +28410,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
Expand Down Expand Up @@ -147,7 +147,7 @@ relevant documentation about the GDC front end.
@xref{Top, GNAT Reference Manual, About This Guide, gnat_rm,
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -5506,6 +5506,16 @@ is_ada (void)
@@ -5521,6 +5521,16 @@ is_ada (void)
return lang == DW_LANG_Ada95 || lang == DW_LANG_Ada83;
}

Expand All @@ -164,7 +164,7 @@ relevant documentation about the GDC front end.
/* Remove the specified attribute if present. Return TRUE if removal
was successful. */

@@ -24471,6 +24481,8 @@ gen_compile_unit_die (const char *filena
@@ -24550,6 +24560,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;
Expand All @@ -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)
@@ -26071,7 +26083,7 @@ declare_in_namespace (tree thing, dw_die
@@ -26150,7 +26162,7 @@ declare_in_namespace (tree thing, dw_die

if (ns_context != context_die)
{
Expand All @@ -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);
@@ -26094,7 +26106,7 @@ gen_namespace_die (tree decl, dw_die_ref
@@ -26173,7 +26185,7 @@ gen_namespace_die (tree decl, dw_die_ref
{
/* Output a real namespace or module. */
context_die = setup_namespace_context (decl, comp_unit_die ());
Expand All @@ -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. */
@@ -26160,7 +26172,7 @@ gen_decl_die (tree decl, tree origin, st
@@ -26239,7 +26251,7 @@ gen_decl_die (tree decl, tree origin, st
break;

case CONST_DECL:
Expand All @@ -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. */
@@ -26760,7 +26772,7 @@ dwarf2out_decl (tree decl)
@@ -26839,7 +26851,7 @@ dwarf2out_decl (tree decl)
case CONST_DECL:
if (debug_info_level <= DINFO_LEVEL_TERSE)
return;
Expand All @@ -209,23 +209,23 @@ relevant documentation about the GDC front end.
return;
if (TREE_STATIC (decl) && decl_function_context (decl))
context_die = lookup_decl_die (DECL_CONTEXT (decl));
@@ -29161,6 +29173,7 @@ prune_unused_types_walk_local_classes (d
@@ -29242,6 +29254,7 @@ prune_unused_types_walk_local_classes (d
case DW_TAG_structure_type:
case DW_TAG_union_type:
case DW_TAG_class_type:
+ case DW_TAG_interface_type:
break;

case DW_TAG_subprogram:
@@ -29194,6 +29207,7 @@ prune_unused_types_walk (dw_die_ref die)
@@ -29275,6 +29288,7 @@ prune_unused_types_walk (dw_die_ref die)
case DW_TAG_structure_type:
case DW_TAG_union_type:
case DW_TAG_class_type:
+ case DW_TAG_interface_type:
if (die->die_perennial_p)
break;

@@ -29220,7 +29234,6 @@ prune_unused_types_walk (dw_die_ref die)
@@ -29301,7 +29315,6 @@ prune_unused_types_walk (dw_die_ref die)
case DW_TAG_volatile_type:
case DW_TAG_typedef:
case DW_TAG_array_type:
Expand All @@ -235,7 +235,7 @@ relevant documentation about the GDC front end.
case DW_TAG_subroutine_type:
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1307,6 +1307,7 @@ static const struct compiler default_com
@@ -1305,6 +1305,7 @@ static const struct compiler default_com
{".f08", "#Fortran", 0, 0, 0}, {".F08", "#Fortran", 0, 0, 0},
{".r", "#Ratfor", 0, 0, 0},
{".go", "#Go", 0, 1, 0},
Expand Down
12 changes: 6 additions & 6 deletions gcc/d/patches/patch-gcc-ddmd-9.patch
Expand Up @@ -140,21 +140,21 @@ This implements building of self hosted D compiler in GCC back end.
# Determine PICFLAG for target gnatlib.


@@ -18460,7 +18563,7 @@ else
@@ -18463,7 +18566,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 18463 "configure"
+#line 18566 "configure"
-#line 18466 "configure"
+#line 18569 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
@@ -18566,7 +18669,7 @@ else
@@ -18569,7 +18672,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 18569 "configure"
+#line 18672 "configure"
-#line 18572 "configure"
+#line 18675 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
Expand Down
32 changes: 16 additions & 16 deletions gcc/d/patches/patch-targetdm-9.patch
Expand Up @@ -297,7 +297,7 @@ The following OS versions are implemented:
extra_modes=
if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-modes.def
then
@@ -814,8 +836,10 @@ case ${target} in
@@ -808,8 +830,10 @@ case ${target} in
esac
c_target_objs="${c_target_objs} glibc-c.o"
cxx_target_objs="${cxx_target_objs} glibc-c.o"
Expand All @@ -308,7 +308,7 @@ The following OS versions are implemented:
;;
*-*-netbsd*)
tm_p_file="${tm_p_file} netbsd-protos.h"
@@ -3231,6 +3255,10 @@ if [ "$common_out_file" = "" ]; then
@@ -3230,6 +3254,10 @@ if [ "$common_out_file" = "" ]; then
fi
fi

Expand All @@ -319,7 +319,7 @@ The following OS versions are implemented:
# Support for --with-cpu and related options (and a few unrelated options,
# too).
case ${with_cpu} in
@@ -4845,6 +4873,7 @@ case ${target} in
@@ -4856,6 +4884,7 @@ case ${target} in
out_file="${cpu_type}/${cpu_type}.c"
c_target_objs="${c_target_objs} ${cpu_type}-c.o"
cxx_target_objs="${cxx_target_objs} ${cpu_type}-c.o"
Expand Down Expand Up @@ -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
@@ -618,6 +618,9 @@ enum aarch64_parse_opt_result aarch64_pa
@@ -619,6 +619,9 @@ enum aarch64_parse_opt_result aarch64_pa
std::string aarch64_get_extension_string_for_isa_flags (unsigned long,
unsigned long);

Expand Down Expand Up @@ -780,7 +780,7 @@ The following OS versions are implemented:
extern void i386_pe_declare_function_type (FILE *, const char *, int);
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -710,6 +710,9 @@ extern const char *host_detect_local_cpu
@@ -718,6 +718,9 @@ extern const char *host_detect_local_cpu
/* Target Pragmas. */
#define REGISTER_TARGET_PRAGMAS() ix86_register_pragmas ()

Expand Down Expand Up @@ -1443,7 +1443,7 @@ The following OS versions are implemented:
host_xm_file="auto-host.h ansidecl.h ${host_xm_file}"
build_xm_file="${build_auto} ansidecl.h ${build_xm_file}"
# We don't want ansidecl.h in target files, write code there in ISO/GNU C.
@@ -12294,6 +12298,21 @@ for f in $tm_p_file; do
@@ -12297,6 +12301,21 @@ for f in $tm_p_file; do
esac
done

Expand All @@ -1465,25 +1465,25 @@ The following OS versions are implemented:
xm_file_list=
xm_include_list=
for f in $xm_file; do
@@ -18563,7 +18582,7 @@ else
@@ -18566,7 +18585,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 18566 "configure"
+#line 18585 "configure"
-#line 18569 "configure"
+#line 18588 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
@@ -18669,7 +18688,7 @@ else
@@ -18672,7 +18691,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 18672 "configure"
+#line 18691 "configure"
-#line 18675 "configure"
+#line 18694 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
@@ -29877,6 +29896,9 @@ fi
@@ -29918,6 +29937,9 @@ fi



Expand All @@ -1503,7 +1503,7 @@ The following OS versions are implemented:
host_xm_file="auto-host.h ansidecl.h ${host_xm_file}"
build_xm_file="${build_auto} ansidecl.h ${build_xm_file}"
# We don't want ansidecl.h in target files, write code there in ISO/GNU C.
@@ -1953,6 +1954,21 @@ for f in $tm_p_file; do
@@ -1956,6 +1957,21 @@ for f in $tm_p_file; do
esac
done

Expand All @@ -1525,7 +1525,7 @@ The following OS versions are implemented:
xm_file_list=
xm_include_list=
for f in $xm_file; do
@@ -6418,6 +6434,8 @@ AC_SUBST(tm_include_list)
@@ -6430,6 +6446,8 @@ AC_SUBST(tm_include_list)
AC_SUBST(tm_defines)
AC_SUBST(tm_p_file_list)
AC_SUBST(tm_p_include_list)
Expand All @@ -1534,7 +1534,7 @@ The following OS versions are implemented:
AC_SUBST(xm_file_list)
AC_SUBST(xm_include_list)
AC_SUBST(xm_defines)
@@ -6425,6 +6443,7 @@ AC_SUBST(use_gcc_stdint)
@@ -6437,6 +6455,7 @@ AC_SUBST(use_gcc_stdint)
AC_SUBST(c_target_objs)
AC_SUBST(cxx_target_objs)
AC_SUBST(fortran_target_objs)
Expand Down
2 changes: 1 addition & 1 deletion gcc/d/typeinfo.cc
Expand Up @@ -336,7 +336,7 @@ class TypeInfoVisitor : public Visitor
void layout_string (const char *str)
{
unsigned len = strlen (str);
tree value = build_string (len + 1, str);
tree value = build_string (len, str);

TREE_TYPE (value) = make_array_type (Type::tchar, len);
TREE_CONSTANT (value) = 1;
Expand Down

0 comments on commit f8a05f4

Please sign in to comment.