aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
AgeCommit message (Collapse)AuthorFilesLines
2022-10-28Merge branch 'master' into devel/sphinxMartin Liska1-1/+1
2022-10-27runtime: use _libgo_off_t_type when calling C mmapIan Lance Taylor1-1/+1
The last argument to the C mmap function is type off_t, not uintptr. On some 32-bit systems, off_t is larger than uintptr. Based on patch by Sören Tempel. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/445735
2022-10-13Merge branch 'master' into devel/sphinxMartin Liska4-30/+14
2022-10-10compiler: treat S("") as a string constantIan Lance Taylor2-1/+4
The compiler neglected to notice that a conversion from a string constant to a string type was a valid string constant. No test case because this only caused a compiler failure when compiling without optimization, which is not the normal case, and is not a case that we test. Fixes golang/go#56113 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/441555
2022-10-10compiler: only build thunk struct type when it is neededIan Lance Taylor3-30/+11
Instead of building the thunk struct type in the determine_types pass, build it when we need it. That ensures that we are consistent in determining whether an argument is constant. We no longer need to add a field for a call to recover, as the simplify_thunk_statements pass runs after the build_recover_thunks pass, so the additional argument will already have been added to the call. The test case is https://go.dev/cl/440297. Fixes golang/go#56109 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/440298
2022-10-08Merge branch 'master' into devel/sphinxMartin Liska2-2/+7
2022-10-06compiler: better arg type checking for selected builtinsThan McIntosh2-2/+7
Tighten up the argument type checking for Builtin_call_expression to catch erroneous cases such as panic(panic("bad"))) where an argument void type is being passed to panic/alignof/sizeof. Fixes golang/go#56071. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/439815
2022-09-29Merge branch 'master' into devel/sphinxMartin Liska1-1/+1
2022-09-27runtime: portable access to sigev_notify_thread_idIan Lance Taylor1-1/+1
Previously, libgo relied on the _sigev_un implementation-specific field in struct sigevent, which is only available on glibc. This patch uses the sigev_notify_thread_id macro instead which is mandated by timer_create(2). In theory, this should work with any libc implementation for Linux. Unfortunately, there is an open glibc bug as glibc does not define this macro. For this reason, a glibc-specific workaround is required. Other libcs (such as musl) define the macro and don't require the workaround. See https://sourceware.org/bugzilla/show_bug.cgi?id=27417 This makes libgo compatible with musl libc. Based on patch by Sören Tempel. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/434755
2022-09-27runtime: synchronize empty struct field handlingmelonedo1-1/+1
In GCCGO and gollvm, the logic for allocating one byte for the last field is: 1. the last field has zero size 2. the struct itself does not have zero size 3. the last field is not blank this commit adds the last two conditions to runtime.structToFFI. For golang/go#55146 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/431735
2022-09-26Merge branch 'master' into devel/sphinxMartin Liska1-1/+1
2022-09-22cmd/cgo: add and use runtime/cgo.Incomplete instead of //go:notinheapIan Lance Taylor1-1/+1
This ports https://go.dev/cl/421879 to libgo. This is a quick port to update gofrontend to work with the version of cgo in gc mainline. A more complete port will follow, changing the gc version of cmd/cgo to choose an approach based on feature testing the gccgo in use. Updates golang/go#46731 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/432338
2022-09-20Merge branch 'master' into devel/sphinxMartin Liska2-3/+5
2022-09-16Daily bump.GCC Administrator1-0/+5
2022-09-15Move void_list_node init to common codeRichard Biener1-3/+0
All frontends replicate this, so move it. gcc/ * tree.cc (build_common_tree_nodes): Initialize void_list_node here. gcc/ada/ * gcc-interface/trans.cc (gigi): Do not initialize void_list_node. gcc/c-family/ * c-common.h (build_void_list_node): Remove. * c-common.cc (c_common_nodes_and_builtins): Do not initialize void_list_node. gcc/c/ * c-decl.cc (build_void_list_node): Remove. gcc/cp/ * decl.cc (cxx_init_decl_processing): Inline last build_void_list_node call. (build_void_list_node): Remove. gcc/d/ * d-builtins.cc (d_build_c_type_nodes): Do not initialize void_list_node. gcc/fortran/ * f95-lang.cc (gfc_init_decl_processing): Do not initialize void_list_node. gcc/go/ * go-lang.cc (go_langhook_init): Do not initialize void_list_node. gcc/jit/ * dummy-frontend.cc (jit_langhook_init): Do not initialize void_list_node. gcc/lto/ * lto-lang.cc (lto_build_c_type_nodes): Do not initialize void_list_node.
2022-09-12Merge branch 'master' into devel/sphinxMartin Liska1-1/+1
2022-09-06runtime: ignore __morestack function in runtime.CallersIan Lance Taylor1-1/+1
We were ignoring all functions starting with "__morestack_", but not the function "__morestack" itself. Without this change, some tests such as recover.go started failing recently, though I'm not sure exactly what changed. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/427935
2022-09-05Merge branch 'master' into devel/sphinxMartin Liska3-6/+7
2022-09-03Daily bump.GCC Administrator1-0/+6
2022-09-02STABS: remove -gstabs and -gxcoff functionalityMartin Liska2-6/+1
gcc/ChangeLog: * Makefile.in: Remove -gstabs option support, DBX-related macros and DBX debugging info support. * collect2.cc (scan_prog_file): Likewise. * common.opt: Likewise. * config.gcc: Likewise. * config.in: Likewise. * config/aarch64/aarch64-elf.h (DBX_DEBUGGING_INFO): Likewise. * config/alpha/alpha.cc: Likewise. * config/alpha/elf.h (ASM_SPEC): Likewise. * config/arc/arc.h (DBX_DEBUGGING_INFO): Likewise. (DBX_CONTIN_LENGTH): Likewise. * config/arm/aout.h (DBX_DEBUGGING_INFO): Likewise. (DBX_CONTIN_LENGTH): Likewise. * config/arm/netbsd-elf.h (DBX_CONTIN_LENGTH): Likewise. * config/darwin.h (DSYMUTIL_SPEC): Likewise. (ASM_DEBUG_SPEC): Likewise. (DBX_DEBUGGING_INFO): Likewise. (DBX_USE_BINCL): Likewise. (DBX_CONTIN_LENGTH): Likewise. (DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END): Likewise. * config/epiphany/epiphany.h (DBX_DEBUGGING_INFO): Likewise. (DBX_CONTIN_LENGTH): Likewise. * config/i386/bsd.h (DBX_NO_XREFS): Likewise. (DBX_CONTIN_LENGTH): Likewise. * config/i386/gas.h (DBX_NO_XREFS): Likewise. (DBX_CONTIN_LENGTH): Likewise. * config/ia64/ia64.h: Likewise. * config/ia64/sysv4.h (DBX_DEBUGGING_INFO): Likewise. * config/m68k/linux.h (DBX_CONTIN_LENGTH): Likewise. * config/m68k/openbsd.h (DBX_DEBUGGING_INFO): Likewise. (DBX_CONTIN_LENGTH): Likewise. (DBX_CONTIN_CHAR): Likewise. * config/mips/mips.cc (mips_output_filename): Likewise. (mips_option_override): Likewise. * config/mips/mips.h (SUBTARGET_ASM_DEBUGGING_SPEC): Likewise. (DBX_DEBUGGING_INFO): Likewise. (DBX_CONTIN_LENGTH): Likewise. (DBX_REGISTER_NUMBER): Likewise. (GP_DBX_FIRST): Likewise. (FP_DBX_FIRST): Likewise. (MD_DBX_FIRST): Likewise. * config/nvptx/nvptx.cc: Likewise. * config/openbsd.h (DBX_NO_XREFS): Likewise. * config/pa/pa-64.h (DBX_DEBUGGING_INFO): Likewise. * config/pa/pa.h (ASSEMBLER_DIALECT): Likewise. (DBX_CONTIN_LENGTH): Likewise. * config/pa/som.h (PREFERRED_DEBUGGING_TYPE): Likewise. (DBX_USE_BINCL): Likewise. (DBX_LINES_FUNCTION_RELATIVE): Likewise. (DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END): Likewise. * config/pdp11/pdp11.cc: Likewise. * config/pdp11/pdp11.h (DBX_DEBUGGING_INFO): Likewise. (PREFERRED_DEBUGGING_TYPE): Likewise. (DBX_CONTIN_LENGTH): Likewise. * config/rs6000/rs6000-builtin.cc: Likewise. * config/rs6000/rs6000-call.cc: Likewise. * config/rs6000/rs6000-logue.cc (defined): Likewise. * config/rs6000/rs6000.cc (rs6000_option_override_internal): Likewise. (HAVE_XCOFF_DWARF_EXTRAS): Likewise. (rs6000_xcoff_declare_function_name): Likewise. * config/rs6000/sysv4.h (DBX_DEBUGGING_INFO): Likewise. (DBX_FUNCTION_FIRST): Likewise. * config/rs6000/xcoff.h (XCOFF_DEBUGGING_INFO): Likewise. * config/rx/rx.h (DBX_DEBUGGING_INFO): Likewise. * config/sh/elf.h (DBX_LINES_FUNCTION_RELATIVE): Likewise. (DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END): Likewise. * config/sol2.h (NO_DBX_BNSYM_ENSYM): Likewise. * config/sparc/freebsd.h (DBX_CONTIN_CHAR): Likewise. * config/sparc/netbsd-elf.h (DBX_CONTIN_CHAR): Likewise. * config/sparc/sparc.h (DBX_CONTIN_LENGTH): Likewise. * config/vax/vax.cc (vax_file_start): Likewise. * config/vax/vax.h (DBX_DEBUGGING_INFO): Likewise. (DBX_CONTIN_LENGTH): Likewise. (DBX_CONTIN_CHAR): Likewise. (DBX_NO_XREFS): Likewise. (DBX_STATIC_STAB_DATA_SECTION): Likewise. * config/vx-common.h (DBX_DEBUGGING_INFO): Likewise. (XCOFF_DEBUGGING_INFO): Likewise. * configure: Regenerate. Likewise. * configure.ac: Likewise. * debug.h: Likewise. * doc/install.texi: Likewise. * doc/invoke.texi: Likewise. * doc/passes.texi: Likewise. * doc/tm.texi: Likewise. * doc/tm.texi.in: Likewise. * dwarf2asm.cc (XCOFF_DEBUGGING_INFO): Likewise. (dw2_asm_output_nstring): Likewise. (USE_LINKONCE_INDIRECT): Likewise. * dwarf2out.cc (XCOFF_DEBUGGING_INFO): Likewise. (HAVE_XCOFF_DWARF_EXTRAS): Likewise. (output_fde): Likewise. (output_call_frame_info): Likewise. (have_macinfo): Likewise. (add_AT_loc_list): Likewise. (add_AT_view_list): Likewise. (output_compilation_unit_header): Likewise. (output_pubnames): Likewise. (output_aranges): Likewise. (output_line_info): Likewise. (output_macinfo): Likewise. (dwarf2out_finish): Likewise. (dwarf2out_early_finish): Likewise. * final.cc (final_scan_insn_1): Likewise. (rest_of_handle_final): Likewise. * flag-types.h (enum debug_info_type): Likewise. (DBX_DEBUG): Likewise. (XCOFF_DEBUG): Likewise. * function.cc (defined): Likewise. * gcc.cc (defined): Likewise. (ASM_DEBUG_SPEC): Likewise. (ASM_DEBUG_OPTION_SPEC): Likewise. * opts.cc (common_handle_option): Likewise. (set_debug_level): Likewise. * system.h (fancy_abort): Likewise. * target-def.h (TARGET_ASM_CONSTRUCTOR): Likewise. (TARGET_ASM_DESTRUCTOR): Likewise. * toplev.cc (defined): Likewise. * varasm.cc: Likewise. * config/dbxcoff.h: Removed. * config/dbxelf.h: Removed. * dbxout.cc: Removed. * dbxout.h: Removed. * gstab.h: Removed. * stab.def: Removed. * xcoffout.cc: Removed. * xcoffout.h: Removed. gcc/go/ChangeLog: * go-lang.cc (go_langhook_pushdecl): Remove -gstabs option support, DBX-related macros and DBX debugging info support. * gospec.cc (lang_specific_driver): Likewise. gcc/testsuite/ChangeLog: * lib/gcc-dg.exp: Remove -gstabs option support, DBX-related macros and DBX debugging info support. * lib/gfortran-dg.exp: Likewise. * lib/target-supports.exp: Likewise. * g++.dg/cpp0x/alias-decl-debug-0.C: Removed. * g++.dg/other/PR23205.C: Removed. * g++.dg/other/pr23205-2.C: Removed. * gcc.dg/20040813-1.c: Removed. * gcc.dg/darwin-20040809-2.c: Removed. * gcc.dg/debug/pr35154.c: Removed. * gcc.dg/pr69471-2.c: Removed. * gcc.target/powerpc/stabs-attrib-vect-darwin.c: Removed. * gcc.target/s390/20041216-1.c: Removed. * gfortran.dg/debug/pr35154-stabs.f: Removed. * objc.dg/stabs-1.m: Removed.
2022-08-01Merge branch 'master' into devel/sphinxMartin Liska1-1/+1
2022-07-30libgo: use SYS_timer_settime32Ian Lance Taylor1-1/+1
Musl defines SYS_timer_settime32, not SYS_timer_settime, on 32-bit systems. Based on patch by Sören Tempel. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/420222
2022-07-25Merge branch 'master' into devel/sphinxMartin Liska1-1/+1
2022-07-22libgo: use POSIX shell arithmetic expansionIan Lance Taylor1-1/+1
Avoid bash-specific ((expression)) syntax. As the bash syntax converts a non-zero value to a zero status (and a zero value to a 1 status), and POSIX arithmetic expansion does not, we have to negate the result. Based on patch by Sören Tempel. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/419154
2022-07-18Merge branch 'master' into devel/sphinxMartin Liska2-0/+30
2022-07-17Daily bump.GCC Administrator1-0/+5
2022-07-16go: fix f().x where f returns zero-sized typeIan Lance Taylor1-0/+7
Test case is https://go.dev/cl/417874. Fixes golang/go#23870 * go-gcc.cc (Gcc_backend::struct_field_expression): Handle a void expression, as for f().x where f returns a zero-sized type.
2022-07-16Daily bump.GCC Administrator1-0/+5
2022-07-15go: fix f(g()) where g returns zero-sized typeIan Lance Taylor1-0/+13
Test case is https://go.dev/cl/417481. Fixes golang/go#23868 * go-gcc.cc (Gcc_backend::call_expression): Handle a void argument, as for f(g()) where g returns a zero-sized type.
2022-07-14Merge branch 'master' into devel/sphinxMartin Liska1-1/+1
2022-07-13libgo: don't include <linux/fs.h> when building gen-sysinfo.goIan Lance Taylor1-1/+1
Removing this doesn't change anything at least with glibc 2.33. The include was added in https://go.dev/cl/6100049 but it's not clear why. Fixes PR go/106266 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
2022-07-10Merge branch 'master' into devel/sphinxMartin Liska12-237/+461
2022-07-05compiler: propagate array length error marker fartherIan Lance Taylor3-2/+11
Fixes golang/go#53639 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/415936
2022-07-05compiler: better error message for unknown package nameIan Lance Taylor2-2/+6
Fixes golang/go#51237 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/415994
2022-07-01compiler: use correct init order for multi-value initializationIan Lance Taylor5-98/+150
Use the correct initialization order for var a = c var b, c = x.(bool) The global c is initialized by the preinit of b, but were missing a dependency of c on b, so a would be initialized to the zero value of c rather than the correct value. Simply adding the dependency of c on b didn't work because the preinit of b refers to c, so that appeared circular. So this patch changes the init order to skip dependencies that only appear on the left hand side of assignments in preinit blocks. Doing that didn't work because the write barrier pass can transform "a = b" into code like "gcWriteBarrier(&a, b)" that is not obviously a simple assigment. So this patch moves the collection of dependencies to just after lowering, before the write barriers are inserted. Making those changes permit relaxing the requirement that we don't warn about self-dependency in preinit blocks, so now we correctly warn for var a, b any = b.(bool) The test case is https://go.dev/cl/415238. Fixes golang/go#53619 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/415594
2022-07-01compiler: rename "requires" to "needs"Ian Lance Taylor3-17/+17
As of C++20 "requires" is a C++ keyword. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/415754
2022-06-30libgo: handle stat st_atim32 field and SYS_SECCOMPIan Lance Taylor1-1/+1
Patches for musl support, from Sören Tempel. Fixes PR go/105225 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/415294
2022-06-29compiler: check repeated const expressions in new scopeIan Lance Taylor5-92/+215
Test case is const8.go in https://go.dev/cl/414795. Fixes golang/go#53585 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/414914
2022-06-28compiler: use package path with embedded builtin typeIan Lance Taylor2-9/+22
The test case is https://go.dev/cl/414235. Fixes golang/go#52856 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/414294
2022-06-28libgo: make runtime.Version return a meaningful stringIan Lance Taylor1-1/+1
Fixes golang/go#51850 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/414734
2022-06-28compiler: permit expressions of abstract bool to remain abstractIan Lance Taylor2-5/+6
Test case is https://go.dev/cl/414755. Fixes golang/go#51475 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/414735
2022-06-27compiler: don't use sink as parameter in method expression thunkIan Lance Taylor3-5/+13
Also fix a couple of cases where the error led to a later compiler crash. Test case is https://go.dev/cl/414336. Fixes golang/go#52871 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/414354
2022-06-27compiler: always initialize mpfr in integer importIan Lance Taylor2-2/+2
Test case is https://go.dev/cl/413980. Fixes golang/go#52862 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/413981
2022-06-24compiler: use bool for comma-ok if not already booleanIan Lance Taylor2-8/+12
If a comma-ok variable already has a type, and that type is not a boolean type, then set the type of the temporary variable to bool. Otherwise we may try to convert an unnamed bool type to an interface type, which will fail. But we don't want to always use bool, because the type of the comma-ok variable may be a named bool type, in which case the assignment would fail (or need an explicit conversion). The test case is https://go.dev/cl/404496. Fixes golang/go#52535 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/413894
2022-06-23compiler: in Sort_bindings return false if comparing value to itselfzhangjian2-1/+4
Some versions of std::sort may pass elements at the same iterator location. Fixes golang/go#53483 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/413434
2022-06-23compiler: unalias types for hash/equality functionsIan Lance Taylor3-7/+14
Test case is https://go.dev/cl/413694. Fixes golang/go#52846 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/413660
2022-06-21libgo: #include <sys/types.h> when checking for loff_tIan Lance Taylor1-1/+1
PR go/106033 Fixes golang/go#53469 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/413214
2022-06-17libgo: permit loff_t and off_t to be macrosIan Lance Taylor1-1/+1
They are macros in musl libc, rather than typedefs, and -fgo-dump-spec doesn't handle that case. Based on patch by Sören Tempel. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/412075
2022-06-17Merge branch 'master' into devel/sphinxMartin Liska11-128/+380
2022-06-16compiler: don't generate stubs for ambiguous direct interface methodsMikhail Ablakatov2-2/+2
Current implementation checks whether it has to generate a stub method for a promoted method of an embedded struct field in Type::build_stub_methods(). If the promoted method is ambiguous it's simply skipped. But struct types that can fit in an interface value (e.g. structs that consist of a single pointer field) get a second chance in Type::build_direct_iface_stub_methods(). This patch adds the same check used by Type::build_stub_methods() to Type::build_direct_iface_stub_methods(). Fixes golang/go#52870 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/405974