Commit Graph

150634 Commits

Author SHA1 Message Date
GCC Administrator
846fbd1e2b Daily bump.
From-SVN: r243523
2016-12-11 00:16:15 +00:00
Thomas Koenig
be841e112b re PR fortran/78226 (Fill out location information everywhere)
2016-12-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/78226
	* error.c (gfc_warning_internal):  New function.
	* frontend-passes.c (gfc_run_passes):  Call check_locus if
	CHECKING_P is defined.
	(check_locus_code):  New function.
	(check_locus_expr):  New function.
	(check_locus):  New function.
	* gfortran.h:  Add prototype for gfc_warning_internal.

From-SVN: r243520
2016-12-10 22:28:32 +00:00
Krister Walfridsson
8a45a00eee config.gcc (i386-*-netbsd*): Make i486 the default arch on NetBSD.
2016-12-10  Krister Walfridsson  <krister.walfridsson@gmail.com>

	* config.gcc (i386-*-netbsd*): Make i486 the default arch on NetBSD.
	Generally use cpu generic.

From-SVN: r243519
2016-12-10 21:07:10 +00:00
Krister Walfridsson
d6574dd103 config.host (i[34567]86-*-netbsdelf*): Add i386/t-crtstuff to tmake_file.
2016-12-10  Krister Walfridsson  <krister.walfridsson@gmail.com>

	* config.host (i[34567]86-*-netbsdelf*): Add i386/t-crtstuff to
	tmake_file.

From-SVN: r243518
2016-12-10 20:59:52 +00:00
Paul Thomas
c3879be19f re PR fortran/78350 (ICE in gfc_code2string(): Bad code, at fortran/misc.c:193)
2016-12-10 Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/78350
	* resolve.c (resolve_structure_cons): Remove the block that
	tried to remove a charlen and rely on namespace cleanup.

From-SVN: r243517
2016-12-10 18:35:47 +00:00
Jakub Jelinek
c0140e3c5d re PR tree-optimization/78720 (Illegal instruction in generated code)
PR tree-optimization/78720
	* match.pd (A < 0 ? C : 0): Only optimize for signed A.  If shift
	is negative, sign extend to @1's type and than AND with C.

	* gcc.c-torture/execute/pr78720.c: New test.

Co-Authored-By: Marc Glisse <marc.glisse@inria.fr>

From-SVN: r243516
2016-12-10 13:06:12 +01:00
Jakub Jelinek
2d4102c5cb re PR fortran/78758 (Warning: '__builtin_memcpy' ... overflows the destination for string assignment)
PR fortran/78758
	* tree-object-size.c (compute_object_offset) <case ARRAY_REF>: Handle
	non-zero low bound or non-standard element sizes.

	* gfortran.dg/pr78758.f90: New test.
	* gfortran.dg/pr38868.f: Remove again bogus warning.

From-SVN: r243515
2016-12-10 09:02:21 +01:00
Jakub Jelinek
d89ee6dbda re PR sanitizer/78708 ([ASAN][LTO] ICE in expand_ASAN_MARK, at internal-fn.c:380 - when compiling but not linking with ASAN)
PR sanitizer/78708
	* lto-streamer-in.c (input_function): In addition to debug stmts
	without -g, remove IFN_*SAN_* calls if corresponding flag_sanitize
	bit is not enabled.

From-SVN: r243514
2016-12-10 09:01:17 +01:00
GCC Administrator
991dde0a4f Daily bump.
From-SVN: r243513
2016-12-10 00:16:19 +00:00
Paul Thomas
c064374dc4 re PR fortran/77903 ([F08] gfortran 6.1.0/7.0.0 accept invalid code with conflicting module/submodule interfaces)
2016-12-09  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/77903
	* decl.c (get_proc_name): Use the symbol tlink field instead of
	the typespec interface field.
	(gfc_match_function_decl, gfc_match_submod_proc): Ditto.
	* gfortran.h : Since the symbol tlink field is no longer used
	by the frontend for change management, change the comment to
	reflect its current uses.
	* parse.c (get_modproc_result): Same as decl.c changes.
	* resolve.c (resolve_fl_procedure): Ditto.

2016-12-09  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/77903
	* gfortran.dg/submodule_20.f08: New test.

From-SVN: r243507
2016-12-09 22:25:26 +00:00
Bill Schmidt
36823125e4 re PR testsuite/78740 (test case powerpc/pr78691-ppc.c fails starting with its introduction in r243335)
2016-12-09  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR testsuite/78740
	* gcc.target/powerpc/pr78691-ppc.c: Remove -m32.

From-SVN: r243506
2016-12-09 22:02:04 +00:00
Bill Schmidt
5715e98017 rs6000-passes.def: New file.
2016-12-09  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/rs6000-passes.def: New file.
	* config/rs6000/rs6000-protos.h: Declare make_pass_analyze_swaps.
	* config/rs6000/rs6000.c (rs6000_option_override): Remove
	registration of machine-specific passes.
	(pass_analyze_swaps::clone): New function.
	* config/rs6000/t-rs6000: Define PASSES_EXTRA.

From-SVN: r243504
2016-12-09 19:56:02 +00:00
Bill Schmidt
46c0848272 fold-vec-add-7.c: Require effective target to support __int128.
2016-12-09  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gcc.target/powerpc/fold-vec-add-7.c: Require effective target to
	support __int128.

From-SVN: r243503
2016-12-09 19:54:11 +00:00
Martin Sebor
a6aba17d00 Add missing part of entry.
From-SVN: r243502
2016-12-09 12:51:43 -07:00
Kugan Vivekanandarajah
7d22d5a3ec re PR tree-optimization/78721 (ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in set_value_range, at tree-vrp.c:371)
gcc/testsuite/ChangeLog:

2016-12-09  Kugan Vivekanandarajah  <kuganv@linaro.org>

	PR ipa/78721
	* gcc.dg/pr78721.c: New test.

gcc/ChangeLog:

2016-12-09  Kugan Vivekanandarajah  <kuganv@linaro.org>

	PR ipa/78721
	* ipa-cp.c (propagate_vr_accross_jump_function): drop_tree_overflow
	after fold_convert.

From-SVN: r243501
2016-12-09 19:47:10 +00:00
Jakub Jelinek
424c77c26e re PR target/72742 (ICE in extract_insn, at recog.c:2309 (error: unrecognizable insn) w/ -Os -mlra)
PR target/72742
	* config/rs6000/rs6000.md (*and<mode>3_imm_mask_dot,
	*and<mode>3_imm_mask_dot2): Add rs6000_is_valid_and_mask to insn
	condition.

	* gcc.c-torture/compile/pr72742.c: New test.

From-SVN: r243500
2016-12-09 20:35:18 +01:00
Segher Boessenkool
bb0f9c0249 rs6000: clz/ctz/ffs improvement (PR78683)
On CPUs that implement popcnt[wd] but not cnttz[wd] we can do better for
the ctz sequences than we do today.

CL[TZ]_DEFINED_VALUE_AT_ZERO can return 2, since we always return the
same fixed value (only dependent on TARGET_* options).


	PR target/78683
	* config/rs6000/rs6000.h (CLZ_DEFINED_VALUE_AT_ZERO): Use
	GET_MODE_BITSIZE.  Return 2.
	(CTZ_DEFINED_VALUE_AT_ZERO): Use GET_MODE_BITSIZE.  Return 2.  Handle
	TARGET_POPCNTD the same as TARGET_CTZ.
	* config/rs6000/rs6000.md (ctz<mode>2): Reimplement.
	(ffs<mode>2): Reimplement.

From-SVN: r243499
2016-12-09 20:31:06 +01:00
Marek Polacek
59ab1319cb re PR middle-end/78750 (ICE in get_range_info, at tree-ssanames.c:375)
PR middle-end/78750
	* builtins.c (check_sizes): Use POINTER_TYPE_P.

	* g++.dg/torture/pr78750.C: New.

From-SVN: r243498
2016-12-09 19:05:28 +00:00
Martin Sebor
c915eee640 gcc/testsuite/ChangeLog:
on arm-unknown-linux-gnueabi (and likely other ILP32) targets.

From-SVN: r243497
2016-12-09 10:38:17 -07:00
Andre Vieira
d5a752ebc3 PR78255: Make postreload aware of NO_FUNCTION_CSE
gcc/ChangeLog:
2016-12-09  Andre Vieira <andre.simoesdiasvieira@arm.com>

	PR rtl-optimization/78255
	* gcc/postreload.c (reload_cse_simplify): Do not CSE a function if
	NO_FUNCTION_CSE is true.

gcc/testsuite/ChangeLog:
2016-12-09  Andre Vieira <andre.simoesdiasvieira@arm.com>

	PR rtl-optimization/78255
	* gcc.target/aarch64/pr78255.c: New.
	* gcc.target/arm/pr78255-1.c: New.
	* gcc.target/arm/pr78255-2.c: New.

From-SVN: r243494
2016-12-09 16:46:42 +00:00
Will Schmidt
d9e0fdff4f dimode-1.c: Update syntax on scan-assembler strings
* gcc.target/powerpc/dimode-1.c: Update syntax on scan-assembler
	strings
	* gcc.target/powerpc/dimode-2.c: Likewise.

From-SVN: r243493
2016-12-09 16:19:03 +00:00
Jonathan Wakely
9b796223a3 Fix std::variant for gnu-versioned--namespace build
* include/std/variant: Remove misplaced
	_GLIBCXX_BEGIN_NAMESPACE_VERSION macro.

From-SVN: r243489
2016-12-09 15:22:01 +00:00
Cesar Philippidis
97ad3aef45 re PR ipa/78027 (ICE in new_oacc_loop_routine, at omp-low.c:19000)
PR ipa/78027

	gcc/
	* ipa-icf.c (sem_function::parse): Don't process functions with
	oacc decl attributes, as they may be OpenACC routines.

	gcc/testsuite/
	* c-c++-common/goacc/acc-icf.c: New test.
	* gfortran.dg/goacc/pr78027.f90: New test.

From-SVN: r243488
2016-12-09 06:45:54 -08:00
David Malcolm
6bd8a5c78f Prevent use of MEM_* attr accessor macros as lvalues
gcc/ChangeLog:
	* rtl.h (get_mem_attrs): Add "const" qualifier to returned
	pointer.

From-SVN: r243487
2016-12-09 14:34:48 +00:00
Wilco Dijkstra
ac9e52e72b Add the test this time...
PR target/78733
        * gcc.target/aarch64/pr78733.c: New test.

From-SVN: r243486
2016-12-09 14:26:07 +00:00
Janus Weil
cdeb16cbf2 re PR fortran/61767 ([OOP] ICE in generate_finalization_wrapper at fortran/class.c:1491)
2016-12-09  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/61767
	* class.c (has_finalizer_component): Fix this function to detect only
	non-pointer non-allocatable components which have a finalizer.

2016-12-09  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/61767
	* gfortran.dg/finalize_31.f90: New test.

From-SVN: r243483
2016-12-09 14:21:44 +01:00
Andre Vehreschild
ffaf9305aa re PR fortran/78505 ([F08] Coarray source allocation not synchronizing on oversubscribed cores)
gcc/fortran/ChangeLog:

2016-12-09  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/78505
	* trans-stmt.c (gfc_trans_allocate): Add sync all after the execution
	of the whole allocate-statement to adhere to the standard.

gcc/testsuite/ChangeLog:

2016-12-09  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/78505
	* gfortran.dg/coarray_alloc_with_implicit_sync_1.f90: New test.

From-SVN: r243482
2016-12-09 13:46:57 +01:00
Andre Vehreschild
39da58667d trans-array.c (gfc_array_deallocate): Remove wrapper.
gcc/fortran/ChangeLog:

2016-12-09  Andre Vehreschild  <vehre@gcc.gnu.org>

	* trans-array.c (gfc_array_deallocate): Remove wrapper.
	(gfc_trans_dealloc_allocated): Same.
	(structure_alloc_comps): Restructure deallocation of (nested)
	allocatable components.  Insert dealloc of sub-component into the block
	guarded by the if != NULL for the component.
	(gfc_trans_deferred_array): Use the almightly deallocate_with_status.
	* trans-array.h: Remove prototypes.
	* trans-expr.c (gfc_conv_procedure_call): Use the almighty deallocate_
	with_status.
	* trans-openmp.c (gfc_walk_alloc_comps): Likewise.
	(gfc_omp_clause_assign_op): Likewise. 
	(gfc_omp_clause_dtor): Likewise.
	* trans-stmt.c (gfc_trans_deallocate): Likewise.
	* trans.c (gfc_deallocate_with_status): Allow deallocation of scalar
	and arrays as well as coarrays.
	(gfc_deallocate_scalar_with_status): Get the data member for coarrays
	only when freeing an array with descriptor.  And set correct caf_mode
	when freeing components of coarrays.
	* trans.h: Change prototype of gfc_deallocate_with_status to allow
	adding statements into the block guarded by the if (pointer != 0) and
	supply a coarray handle.

gcc/testsuite/ChangeLog:

2016-12-09  Andre Vehreschild  <vehre@gcc.gnu.org>

	* gfortran.dg/coarray_alloc_comp_3.f08: New test.
	* gfortran.dg/coarray_alloc_comp_4.f08: New test.
	* gfortran.dg/finalize_18.f90: Add count for additional guard against
	accessing null-pointer.
	* gfortran.dg/proc_ptr_comp_47.f90: New test.

From-SVN: r243480
2016-12-09 13:32:50 +01:00
Nathan Sidwell
3291363771 re PR c++/78550 (bit field and std::initializer_list)
PR c++/78550
	* convert.c (convert_to_integer_1): Maybe fold conversions to
	integral types with fewer bits than its mode.

	testsuite/
	PR c++/78550
	* g++.dg/cpp1y/pr78550.C: New.

From-SVN: r243479
2016-12-09 12:18:36 +00:00
Paul Thomas
345bd7ebbb re PR fortran/44265 (Link error with reference to parameter array in specification expression)
2016-12-09  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/44265
	* gfortran.h : Add fn_result_spec bitfield to gfc_symbol.
	* resolve.c (flag_fn_result_spec): New function.
	(resolve_fntype): Call it for character result lengths.
	* symbol.c (gfc_new_symbol): Set fn_result_spec to zero.
	* trans-decl.c (gfc_sym_mangled_identifier): Include the
	procedure name in the mangled name for symbols with the
	fn_result_spec bit set.
	(gfc_finish_var_decl): Mark the decls of these symbols
	appropriately for the case where the function is external.
	(gfc_get_symbol_decl): Mangle the name of these symbols.
	(gfc_create_module_variable): Allow them through the assert.
	(gfc_generate_function_code): Remove the assert before the
	initialization of sym->tlink because the frontend no longer
	uses this field.
	* trans-expr.c (gfc_map_intrinsic_function): Add a case to
	treat the LEN_TRIM intrinsic.
	(gfc_trans_string_copy): Deal with Wstringop-overflow warning
	that can occur with constant source lengths at -O3.

2016-12-09  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/44265
	* gfortran.dg/char_result_14.f90: New test.
	* gfortran.dg/char_result_15.f90: New test.

From-SVN: r243478
2016-12-09 11:55:27 +00:00
Martin Liska
cdecc83f3e Escape non-printable chars in strings.
* tree-pretty-print.c (pretty_print_string): Escape non-printable
	chars in strings.
	* gcc.dg/tree-ssa/dump-3.c: New test.

From-SVN: r243477
2016-12-09 10:15:33 +00:00
Jakub Jelinek
52af5e483d re PR middle-end/78726 (Incorrect unsigned arithmetic optimization)
PR tree-optimization/78726
	* tree-ssa-reassoc.c (make_new_ssa_for_def): Add OPCODE and OP
	argument.  For lhs uses in debug stmts, don't replace lhs with
	new_lhs, but with a debug temp set to new_lhs opcode op.
	(make_new_ssa_for_all_defs): Add OPCODE argument, pass OPCODE and
	OP down to make_new_ssa_for_def.
	(zero_one_operation): Call make_new_ssa_for_all_defs even when
	stmts_to_fix is empty, if *def has not changed yet.  Pass
	OPCODE to make_new_ssa_for_all_defs.

	* gcc.c-torture/execute/pr78726.c: New test.
	* gcc.dg/guality/pr78726.c: New test.

From-SVN: r243476
2016-12-09 10:21:36 +01:00
Uros Bizjak
a059c43589 * ChangeLog: Fix a couple of entries.
From-SVN: r243474
2016-12-09 08:55:14 +01:00
GCC Administrator
43d86dc2f5 Daily bump.
From-SVN: r243473
2016-12-09 00:16:20 +00:00
Martin Sebor
8bd9f164e2 PR c/77531 - __attribute__((alloc_size(1,2))) could also warn on multiplication overflow
PR c/77531 - __attribute__((alloc_size(1,2))) could also warn on multiplication overflow
PR c/78284 - warn on malloc with very large arguments

gcc/c-family/ChangeLog:

	PR c/78284
	* c.opt (-Walloc-zero, -Walloc-size-larger-than): New options.

gcc/ChangeLog:

	PR c/78284
	* builtin-attrs.def (ATTR_ALLOC_SIZE, ATTR_RETURNS_NONNULL): New
	identifier tree nodes.
	(ATTR_ALLOCA_SIZE_1_NOTHROW_LEAF_LIST): New attribute list.
	(ATTR_MALLOC_SIZE_1_NOTHROW_LIST): Same.
	(ATTR_MALLOC_SIZE_1_NOTHROW_LEAF_LIST): Same.
	(ATTR_MALLOC_SIZE_1_2_NOTHROW_LEAF_LIST): Same.
	(ATTR_ALLOC_SIZE_2_NOTHROW_LEAF_LIST): Same.
	* builtins.c (expand_builtin_alloca): Call
	maybe_warn_alloc_args_overflow.
	* builtins.def (aligned_alloc, calloc, malloc, realloc):
	Add attribute alloc_size.
	(alloca): Add attribute alloc_size and returns_nonnull.
	* calls.h (maybe_warn_alloc_args_overflow): Declare.
	* calls.c (alloc_max_size, operand_signed_p): New functions.
	(maybe_warn_alloc_args_overflow): Define.
	(initialize_argument_information): Diagnose overflow in functions
	declared with attaribute alloc_size.
	* doc/invoke.texi (Warning Options): Document -Walloc-zero and
	-Walloc-size-larger-than.

gcc/testsuite/ChangeLog:

	PR c/78284
	* gcc.dg/attr-alloc_size-3.c: New test.
	* gcc.dg/attr-alloc_size-4.c: New test.
	* gcc.dg/attr-alloc_size-5.c: New test.
	* gcc.dg/attr-alloc_size-6.c: New test.
	* gcc.dg/attr-alloc_size-7.c: New test.
	* gcc.dg/attr-alloc_size-8.c: New test.
	* gcc.dg/attr-alloc_size-9.c: New test.
	* gcc/testsuite/gcc.dg/errno-1.c: Adjust.

From-SVN: r243470
2016-12-08 16:50:40 -07:00
David Edelsohn
410aa8982f parallel_algorithm_assert2.cc: Move dg-do run first.
* testsuite/25_algorithms/headers/algorithm/
        parallel_algorithm_assert2.cc: Move dg-do run first.

From-SVN: r243468
2016-12-08 17:35:24 -05:00
Uros Bizjak
ccc6bcc7c2 * gcc.target/i386/pr78671.c: Require int128 effective target.
From-SVN: r243465
2016-12-08 22:51:20 +01:00
Steven G. Kargl
d0803c0cf8 re PR fortran/65173 (ICE while compiling wrong code)
2016-12-07  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/65173
	PR fortran/69064
	PR fortran/69859
	PR fortran/78350
	* gfortran.h (gfc_namespace): Remove old_cl_list member.
	* parse.c (use_modules, next_statement): old_cl_list is gone.
	(clear_default_charlen): Remove no longer used function.
	(reject_statement): Do not try ot clean up gfc_charlen structure(s)
	that may have been added to a cl_list list.
	* symbol.c (gfc_new_charlen): old_cl_list structure is gone.

2016-12-07  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/65173
	PR fortran/69064
	PR fortran/69859
	PR fortran/78350
	* gfortran.dg/misplaced_implicit_character.f90: Adjust errors.
	* gfortran.dg/charlen_01.f90: New test.
	* gfortran.dg/charlen_02.f90: Ditto.
	* gfortran.dg/charlen_03.f90: Ditto.
	* gfortran.dg/charlen_04.f90: Ditto.
	* gfortran.dg/charlen_05.f90: Ditto.
	* gfortran.dg/charlen_06.f90: Ditto.
	* gfortran.dg/charlen_07.f90: Ditto.
	* gfortran.dg/charlen_08.f90: Ditto.
	* gfortran.dg/charlen_09.f90: Ditto.
	* gfortran.dg/charlen_10.f90: Ditto.
	* gfortran.dg/charlen_11.f90: Ditto.
	* gfortran.dg/charlen_12.f90: Ditto.
	* gfortran.dg/charlen_13.f90: Ditto.
	* gfortran.dg/charlen_14.f90: Ditto.
	* gfortran.dg/charlen_15.f90: Ditto.
	* gfortran.dg/charlen_16.f90: Ditto.

From-SVN: r243463
2016-12-08 21:26:11 +00:00
Vladimir Makarov
7e964f4902 re PR rtl-optimization/78671 (ICE: in extract_constrain_insn, at recog.c:2213 with -Og -march=skylake-avx512)
2016-12-08  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/78671
	* lra-assign.c (lra-assigns.c): Check prohibited regs for an
	allocno class.

2016-12-08  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/78671
	* gcc.target/i386/pr78671.c: New.

From-SVN: r243462
2016-12-08 21:14:42 +00:00
Martin Sebor
060162e0c4 PR c/78165 - avoid printing type suffix for constants in %E output
gcc/c-family/ChangeLog:

	PR c/78165
           * c-pretty-print (pp_c_integer_constant): Avoid formatting type
             suffix.
gcc/testsuite/ChangeLog:

From-SVN: r243461
2016-12-08 14:08:06 -07:00
Ian Lance Taylor
560bcfdcfd runtime: mark non-x86 aeshashbody parameters as unused
Avoids warnings during the build.
    
    Reviewed-on: https://go-review.googlesource.com/34142

From-SVN: r243459
2016-12-08 20:43:19 +00:00
Wilco Dijkstra
80d435794e This patch fixes an issue in aarch64_classify_address.
This patch fixes an issue in aarch64_classify_address.  TImode and TFmode
can either use a 64-bit LDP/STP or 128-bit LDR/STR.  The addressing mode
must be carefully modelled as the intersection of both.  This is done for
the immediate offsets, however load_store_pair_p must be set as well to
avoid LDP with a PC-relative address if aarch64_pcrelative_literal_loads
is true.

    gcc/
	PR target/78733
	* config/aarch64/aarch64.c (aarch64_classify_address):
	Set load_store_pair_p for TImode and TFmode.

    testsuite/
	* gcc.target/aarch64/pr78733.c: New test.

From-SVN: r243456
2016-12-08 19:18:33 +00:00
Uros Bizjak
7bf65250f1 i386.h (HARD_REGNO_NREGS): Use GENERAL_REGNO_P.
* gcc.target/i386/i386.h (HARD_REGNO_NREGS): Use GENERAL_REGNO_P.
	(HARD_REGNO_NREGS_HAS_PADDING): Ditto.  Simplify macro.

From-SVN: r243455
2016-12-08 20:15:45 +01:00
Joseph Myers
eb6f6eddd4 * es.po: Update.
From-SVN: r243453
2016-12-08 19:03:54 +00:00
Nathan Sidwell
d6b46fca8d re PR c++/78551 (Internal compiler error with constexpr initialization of union)
PR c++/78551
	* constexpr.c (extract_string_elt): New.  Broken out of ...
	(cxx_eval_array_reference): ... here.  Call it.
	(cxx_eval_store_expression): Convert init by STRING_CST into
	CONSTRUCTOR, if needed.

	PR c++/78551
	* g++.dg/cpp1y/pr78551.C: New.

From-SVN: r243448
2016-12-08 18:34:04 +00:00
David Malcolm
f44986d7f5 Introduce emit_status::ensure_regno_capacity
gcc/ChangeLog:
	* emit-rtl.c (gen_reg_rtx): Move regno_pointer_align and
	regno_reg_rtx resizing logic to...
	(emit_status::ensure_regno_capacity): ...this new method,
	and ensure that the buffers are large enough.
	(init_emit): Allocate regno_reg_rtx using ggc_cleared_vec_alloc
	rather than ggc_vec_alloc.
	* function.h (emit_status::ensure_regno_capacity): New method.

From-SVN: r243447
2016-12-08 17:29:41 +00:00
Ian Lance Taylor
453060a906 runtime: copy memory hash code from Go 1.7
Rewrite the AES hashing code from gc assembler to C code using
    intrinsics.  The resulting code generates the same hash code for the
    same input as the gc code--that doesn't matter as such, but testing it
    ensures that the C code does something useful.
    
    Also change mips64pe32le to mips64p32le in configure script--noticed
    during CL review.
    
    Reviewed-on: https://go-review.googlesource.com/34022

From-SVN: r243445
2016-12-08 16:37:54 +00:00
Ian Lance Taylor
b2264b0964 runtime: allocate _panic struct on heap
The gc library allocates a _panic struct on the stack. This does not
    work for gccgo, because when a deferred function recovers the panic we
    unwind the stack up to that point so that returning from the function
    will work correctly.
    
    Allocating on the stack fine if the panic is not recovered, and it
    works fine if the panic is recovered by a function that
    returns. However, it fails if the panic is recovered by a function
    that itself panics, and if that second panic is then recovered by a
    function higher up on the stack. When we unwind the stack to that
    second panic, the g will wind up pointing at a panic farther down on
    the stack. Even then everything will often work fine, except when the
    deferred function catching the second panic makes a bunch of calls
    that use stack space before returning. In that case the code can
    overwrite the panic struct, which will then cause disaster when we
    remove the struct from the linked list, as the link field will be
    garbage. This case is rare enough that all the x86 tests were passing,
    but there was a failure on ppc64le.
    
    Before https://golang.org/cl/33414 we allocated the panic struct on
    the heap, so go back to doing that again.
    
    Fixes golang/go#18228.
    
    Reviewed-on: https://go-review.googlesource.com/34027

From-SVN: r243444
2016-12-08 15:54:30 +00:00
Eric Botcazou
0a7577bbac re PR libstdc++/78264 (ICE in build_noexcept_spec, at cp/except.c:1196)
PR libstdc++/78264
	* include/bits/c++config (_GLIBCXX_NOEXCEPT_PARM): Turn _N into _NE.
	(_GLIBCXX_NOEXCEPT_QUAL): Likewise.

From-SVN: r243443
2016-12-08 15:52:11 +00:00
Ian Lance Taylor
55dccc1e0d compiler: make Slice_construction_expression::do_flatten idempotent
Because of the way we handle call expressions with multiple results,
    it's possible for expressions to be flattened more than once.  In the
    case of Slice_construction_expression, allocating the slice storage
    multiple times caused a compiler crash as one of the
    Temporary_statement's wound up not getting a backend expression.
    
    Test case is https://golang.org/cl/34020.
    
    Reviewed-on: https://go-review.googlesource.com/34026

From-SVN: r243442
2016-12-08 15:51:25 +00:00