- 09 Sep, 2017 1 commit
-
-
The code that lowers field references can sometimes introduce a double pointer indirection in cases where it is not/safe appropriate. For example, in var p **struct { f int } p.f = 0 the assignment LHS was being incorrectly lowered to (*(*p)).f. Detect this situation and issue an error. Fixes golang/go#21770 Reviewed-on: https://go-review.googlesource.com/62330 From-SVN: r251918
Ian Lance Taylor committed
-
- 31 Aug, 2017 1 commit
-
-
Patch by Rainer Orth. Reviewed-on: https://go-review.googlesource.com/60732 From-SVN: r251574
Ian Lance Taylor committed
-
- 30 Aug, 2017 3 commits
-
-
This patch adds another machine_mode wrapper for modes that are known to be COMPLEX_MODE_P. There aren't yet many places that make use of it, but that might change in future. 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * coretypes.h (complex_mode): New type. * gdbhooks.py (build_pretty_printer): Handle it. * machmode.h (complex_mode): New class. (complex_mode::includes_p): New function. (is_complex_int_mode): Likewise. (is_complex_float_mode): Likewise. * genmodes.c (get_mode_class): Handle complex mode classes. * function.c (expand_function_end): Use is_complex_int_mode. gcc/go/ * go-lang.c (go_langhook_type_for_mode): Use is_complex_float_mode. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251527
Richard Sandiford committed -
Replace checks of "GET_MODE_CLASS (...) == MODE_INT" with "is_int_mode (..., &var)", in cases where it becomes useful to refer to the mode as a scalar_int_mode. 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * machmode.h (is_int_mode): New fuction. * combine.c (find_split_point): Use it. (combine_simplify_rtx): Likewise. (simplify_if_then_else): Likewise. (simplify_set): Likewise. (simplify_shift_const_1): Likewise. (simplify_comparison): Likewise. * config/aarch64/aarch64.c (aarch64_rtx_costs): Likewise. * cse.c (notreg_cost): Likewise. (cse_insn): Likewise. * cselib.c (cselib_lookup_1): Likewise. * dojump.c (do_jump_1): Likewise. (do_compare_rtx_and_jump): Likewise. * dse.c (get_call_args): Likewise. * dwarf2out.c (rtl_for_decl_init): Likewise. (native_encode_initializer): Likewise. * expmed.c (emit_store_flag_1): Likewise. (emit_store_flag): Likewise. * expr.c (convert_modes): Likewise. (store_field): Likewise. (expand_expr_real_1): Likewise. * fold-const.c (fold_read_from_constant_string): Likewise. * gimple-ssa-sprintf.c (get_format_string): Likewise. * optabs-libfuncs.c (gen_int_libfunc): Likewise. * optabs.c (expand_binop): Likewise. (expand_unop): Likewise. (expand_abs_nojump): Likewise. (expand_one_cmpl_abs_nojump): Likewise. * simplify-rtx.c (mode_signbit_p): Likewise. (val_signbit_p): Likewise. (val_signbit_known_set_p): Likewise. (val_signbit_known_clear_p): Likewise. (simplify_relational_operation_1): Likewise. * tree.c (vector_type_mode): Likewise. gcc/go/ * go-lang.c (go_langhook_type_for_mode): Use is_int_mode. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251472
Richard Sandiford committed -
This patch adds a scalar_float_mode class, which wraps a mode enum that is known to satisfy SCALAR_FLOAT_MODE_P. Things like "SFmode" now give a scalar_float_mode object instead of a machine_mode. This in turn needs a change to the real.h format_helper, so that it can accept both machine_modes and scalar_float_modes. 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * coretypes.h (scalar_float_mode): New type. * machmode.h (mode_traits::from_int): Use machine_mode if USE_ENUM_MODES is defined. (is_a): New function. (as_a): Likewise. (dyn_cast): Likewise. (scalar_float_mode): New class. (scalar_float_mode::includes_p): New function. (is_float_mode): Likewise. * gdbhooks.py (MachineModePrinter): New class. (build_pretty_printer): Use it for scalar_float_mode. * real.h (FLOAT_MODE_FORMAT): Use as_a <scalar_float_mode>. (format_helper::format_helper): Turn into a template. * genmodes.c (get_mode_class): New function. (emit_insn_modes_h): Give modes the class returned by get_mode_class, or machine_mode if none. * config/aarch64/aarch64.c (aarch64_simd_valid_immediate): Use as_a <scalar_float_mode>. * dwarf2out.c (mem_loc_descriptor): Likewise. (insert_float): Likewise. (add_const_value_attribute): Likewise. * simplify-rtx.c (simplify_immed_subreg): Likewise. * optabs.c (expand_absneg_bit): Take a scalar_float_mode. (expand_unop): Update accordingly. (expand_abs_nojump): Likewise. (expand_copysign_absneg): Take a scalar_float_mode. (expand_copysign_bit): Likewise. (expand_copysign): Update accordingly. gcc/ada/ * gcc-interface/utils.c (gnat_type_for_mode): Use is_a <scalar_float_mode> instead of SCALAR_FLOAT_MODE_P. gcc/go/ * go-lang.c (go_langhook_type_for_mode): Use is_float_mode. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251458
Richard Sandiford committed
-
- 29 Aug, 2017 5 commits
-
-
Reviewed-on: https://go-review.googlesource.com/59913 From-SVN: r251440
Ian Lance Taylor committed -
Reviewed-on: https://go-review.googlesource.com/59912 From-SVN: r251439
Ian Lance Taylor committed -
Reviewed-on: https://go-review.googlesource.com/59911 From-SVN: r251436
Ian Lance Taylor committed -
Reviewed-on: https://go-review.googlesource.com/59910 From-SVN: r251435
Ian Lance Taylor committed -
Reviewed-on: https://go-review.googlesource.com/57550 From-SVN: r251420
Ian Lance Taylor committed
-
- 18 Aug, 2017 3 commits
-
-
PR go/81893 runtime: only use PPC GNU/Linux register code on little endian Reportedly the current code builds on little endian but not big endian. Fixes https://gcc.gnu.org/PR81893. Reviewed-on: https://go-review.googlesource.com/57110 From-SVN: r251188
Ian Lance Taylor committed -
Reviewed-on: https://go-review.googlesource.com/56910 From-SVN: r251182
Ian Lance Taylor committed -
Using -funwind-tables is necessary to permit Go code to correctly throw a panic through C code. This hasn't been necessary in the past as -funwind-tables is the default on x86. However, it is not the default for PPC AIX. Reviewed-on: https://go-review.googlesource.com/56650 From-SVN: r251179
Ian Lance Taylor committed
-
- 16 Aug, 2017 2 commits
-
-
Reviewed-on: https://go-review.googlesource.com/54170 From-SVN: r251133
Ian Lance Taylor committed -
Fix dumpregs on i386, implement dumpregs for PPC Linux/AIX, get PC on AIX. Reviewed-on: https://go-review.googlesource.com/56170 From-SVN: r251127
Ian Lance Taylor committed
-
- 09 Aug, 2017 2 commits
-
-
It's possible to construct an lshift expression using unsafe.Sizeof that is technically a compile-time constant but can't be evaluated without going through backend methods. In this case, insure that Type::make_non_abstract_type is called on the numeric operand of the shift (as opposed to leaving as abstract), to avoid an assert later on in the compiler flow. Fixes golang/go#21372. Reviewed-on: https://go-review.googlesource.com/54370 From-SVN: r251006
Ian Lance Taylor committed -
Libgo's implementation of math.Ldexp declared the libc "ldexp" as taking an 'int' exponent argument, which is not quite right for 64-bit platforms (exp arg is always int32); this could yield incorrect results for exponent values outside the range of Minint32/Maxint32. Fix by upating the type for the libc version of ldexp, and adding guards to screen for out-of-range exponents. Fixes #21323. Reviewed-on: https://go-review.googlesource.com/54250 From-SVN: r250992
Ian Lance Taylor committed
-
- 07 Aug, 2017 1 commit
-
-
2017-08-07 Martin Liska <mliska@suse.cz> * attribs.h (canonicalize_attr_name): New function. (cmp_attribs): Move from c-format.c and adjusted. (is_attribute_p): Moved from tree.h. * tree-inline.c: Add new includes. * tree.c (cmp_attrib_identifiers): Use cmp_attribs. (private_is_attribute_p): Remove. (private_lookup_attribute): Likewise. (private_lookup_attribute_by_prefix): Simplify. (remove_attribute): Use is_attribute_p. * tree.h: Remove removed declarations. 2017-08-07 Martin Liska <mliska@suse.cz> * array-notation-common.c: Add new includes. * c-format.c( handle_format_attribute): Canonicalize a format function name. * c-lex.c (c_common_has_attribute): Canonicalize name of an attribute. * c-pretty-print.c: Add new include. 2017-08-07 Martin Liska <mliska@suse.cz> * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an attribute. (cp_parser_std_attribute): Likewise. * tree.c: Add new include. 2017-08-07 Martin Liska <mliska@suse.cz> * c-parser.c (c_parser_attributes): Canonicalize name of an attribute. 2017-08-07 Martin Liska <mliska@suse.cz> * go-gcc.cc (Gcc_backend::function): Look up for no_split_stack and not __no_split_stack__. 2017-08-07 Martin Liska <mliska@suse.cz> * g++.dg/cpp0x/pr65558.C: Update scanned pattern. * gcc.dg/parm-impl-decl-1.c: Likewise. * gcc.dg/parm-impl-decl-3.c: Likewise. * gcc.dg/Wattributes-5.c: New test. From-SVN: r250911
Martin Liska committed
-
- 04 Aug, 2017 1 commit
-
-
Patch from Uros Bizjak. Reviewed-on: https://go-review.googlesource.com/53350 From-SVN: r250873
Ian Lance Taylor committed
-
- 03 Aug, 2017 1 commit
-
-
PR go/81617 libgo: change mksigtab to recognize glibc 2.26 NSIG expression Fixes golang/go#21147 Fixes GCC PR 81617 Reviewed-on: https://go-review.googlesource.com/52611 From-SVN: r250858
Ian Lance Taylor committed
-
- 02 Aug, 2017 1 commit
-
-
When finalizing the methods of a named struct type, we used to finalize all the field types first. That can fail if the field types refer indirectly to the named type. Change it to just finalize the embedded field types first, and the rest of the fields later. Fixes golang/go#21253 Reviewed-on: https://go-review.googlesource.com/52570 From-SVN: r250832
Ian Lance Taylor committed
-
- 28 Jul, 2017 4 commits
-
-
Tweak Interface_field_reference_expression::do_get_backend to apply an additional backend type conversion to the returned result. This is needed due to the fact that the top level type of the expression is a function descriptor, however the value being manufactured is a pointer to <thunk-descriptor, value> struct. Reviewed-on: https://go-review.googlesource.com/51712 From-SVN: r250686
Ian Lance Taylor committed -
We recently started walking through the hash table of pointer types to finalize them. Unfortunately it is possible to create a new pointer type while finalizing an existing one (test case: test/fixedbugs/issue5291) and that breaks the iteration. So, instead, keep a list of placeholder pointer types, and iterate through them while permitting the list to be extended as we go. Reviewed-on: https://go-review.googlesource.com/51771 From-SVN: r250683
Ian Lance Taylor committed -
For calls that return multiple results we used to create a temporary of struct type to hold the results, and also create a separate temporary for each result. Then the call expression would copy each result out of the struct to the temporary, and Call_result_expression would refer to the desired temporary. Simplify this to just use a single temporary of struct type, and change Call_result_expression to fetch a field of the struct. This may reduce some incorrect tree sharing in the backend code. Reviewed-on: https://go-review.googlesource.com/51770 From-SVN: r250682
Ian Lance Taylor committed -
* go-backend.c (go_write_export_data): Use EXCLUDE section for AIX. From-SVN: r250648
Tony Reix committed
-
- 26 Jul, 2017 1 commit
-
-
Patch by Uros Bizjak. Reviewed-on: https://go-review.googlesource.com/51370 From-SVN: r250588
Ian Lance Taylor committed
-
- 25 Jul, 2017 1 commit
-
-
Add a new helper routine Type::finish_pointer_types that walks through the pointer type cache and looks for placeholder types that may have been created at some point before conversion of named types, and invokes Type::finish_backend() on said placeholders. This is needed to handle cases where the compiler manufactures a pointer type as part of lowering, then a placeholder is created for it due to a call to Type::backend_type_size(), but there is no explicit reference to the type in user code. Reviewed-on: https://go-review.googlesource.com/51131 From-SVN: r250548
Ian Lance Taylor committed
-
- 21 Jul, 2017 4 commits
-
-
We unconditionally set _FILE_OFFSET_BITS to 64 in configure.ac, so we should unconditionally call the statfs64 and fstatfs64 functions. These functions should be available on all versions of GNU/Linux since 2.6. On 64-bit systems they are aliased to statfs/fstatfs, and on 32-bit systems they use the 64-bit data structures. Fixes golang/go#20922 Reviewed-on: https://go-review.googlesource.com/50635 From-SVN: r250443
Ian Lance Taylor committed -
If getSiginfo does not know how to determine the PC, it will call runtime_callers. That can happen in a thread that was started by non-Go code, in which case the TLS variable g will not be set, in which case runtime_lock will crash. Avoid the problem by using atomic operations for the lock. This is OK since creating a backtrace state is fast and never blocks. The test case is TestCgoExternalThreadSIGPROF in the runtime package on a system that getSiginfo doesn't handle specially. Updates golang/go#20931 Reviewed-on: https://go-review.googlesource.com/50650 From-SVN: r250439
Ian Lance Taylor committed -
Updates golang/go#20931 Reviewed-on: https://go-review.googlesource.com/50631 From-SVN: r250436
Ian Lance Taylor committed -
Allocate enough stack space so that the test will work on a system that does not support split stacks. This test is actually not very meaningful for gccgo at present, but it doesn't hurt to keep running it. Updates golang/go#20931 Reviewed-on: https://go-review.googlesource.com/50630 From-SVN: r250433
Ian Lance Taylor committed
-
- 20 Jul, 2017 1 commit
-
-
The current recipe in Type_guard_expression for creating a Bexpression performs a type conversion at the Type level, but doesn't invoke Backend::convert_expression to capture the conversion for the back end. Add code to create a BE type conversion operation. Reviewed-on: https://go-review.googlesource.com/50373 From-SVN: r250400
Ian Lance Taylor committed
-
- 18 Jul, 2017 4 commits
-
-
In Func_expression::do_get_backend when creating the backend representation for a closure, create a backend type conversion to account for potential differences between the closure struct type (where the number of fields is dependent on the number of values referenced in the closure) and the generic function descriptor type (struct with single function pointer field). Reviewed-on: https://go-review.googlesource.com/49255 From-SVN: r250327
Ian Lance Taylor committed -
re PR go/81451 (missing futex check - libgo/runtime/thread-linux.c:12:0 futex.h:13:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘long’) PR go/81451 runtime: inline runtime_osinit We had two identical copies of runtime_osinit. They set runtime_ncpu, a variable that is no longer used. Removing that leaves us with two lines. Inline those two lines in the two places the function was called. This fixes GCC PR 81451. Reviewed-on: https://go-review.googlesource.com/48862 From-SVN: r250326
Ian Lance Taylor committed -
The code in Named_type::do_get_backend was not passing the correct flag value for circular function types to Backend::circular_pointer_type (it was always setting this flag to false). Pass a true value if the type being converted is a function type. Reviewed-on: https://go-review.googlesource.com/49330 From-SVN: r250325
Ian Lance Taylor committed -
PR go/81324 sysinfo.c: ignore ptrace_peeksiginfo_args from <linux/ptrace.h> With some versions of glibc and GNU/Linux ptrace_pseeksiginfo_args is defined in both <sys/ptrace.h> and <linux/ptrace.h>. We don't actually care about the struct, so use a #define to avoid a redefinition error. This fixes https://gcc.gnu.org/PR81324. Reviewed-on: https://go-review.googlesource.com/49290 From-SVN: r250324
Ian Lance Taylor committed
-
- 14 Jul, 2017 2 commits
-
-
https://gcc.gnu.org/PR81449 reports a problem with the definition semt in runtime.inc on some systems. Since the C code in libgo/runtime doesn't need semt, just don't copy it into runtime.inc. Reviewed-on: https://go-review.googlesource.com/48593 From-SVN: r250217
Ian Lance Taylor committed -
Don't assume that all (or only) 386/amd64 compilers support -fsplit-stack. Reviewed-on: https://go-review.googlesource.com/48592 From-SVN: r250216
Ian Lance Taylor committed
-
- 13 Jul, 2017 1 commit
-
-
PR go/81393 syscall: don't use GETREGS/SETREGS on s390 They were removed in recent glibc. Patch by Andreas Krebbel for GCC PR 81393. Reviewed-on: https://go-review.googlesource.com/48231 From-SVN: r250174
Ian Lance Taylor committed
-
- 29 Jun, 2017 1 commit
-
-
This test is not yet run, but it will be soon. Reviewed-on: https://go-review.googlesource.com/47038 From-SVN: r249795
Ian Lance Taylor committed
-