Commit Graph

148373 Commits

Author SHA1 Message Date
Richard Biener
6831798543 debug.h (gcc_debug_hooks): Add filename parameter to early_finish hook.
2016-09-20  Richard Biener  <rguenther@suse.de>

	* debug.h (gcc_debug_hooks): Add filename parameter to early_finish
	hook.
	* debug.c (do_nothing_debug_hooks): Adjust.
	* dbxout.c (dbx_debug_hooks): Likewise.
	* sdbout.c (sdb_debug_hooks): Likewise.
	* dwarf2out.c (dwarf2_lineno_debug_hooks): Likewise.
	(dwarf2out_finish): Move producer, filename and
	path annotation ...
	(dwarf2out_early_finish): ... here.  Remove in_lto_p special-casing.
	* cgraphunit.c (symbol_table::finalize_compilation_unit): Adjust.

	lto/
	* lto.c (lto_main): Call early_finish with "<artificial>" as
	filename.

From-SVN: r240255
2016-09-20 07:37:53 +00:00
GCC Administrator
b78713939b Daily bump.
From-SVN: r240254
2016-09-20 00:16:21 +00:00
Bernd Edlinger
144a96e4c9 re PR c++/77434 (warn about suspicious precedence of ternary operator (?:))
gcc:
2016-09-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR c++/77434
        * doc/invoke.texi: Document -Wint-in-bool-context.

c-family:
2016-09-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR c++/77434
        * c.opt (Wcond-in-bool-context): New warning.
        * c-common.c (c_common_truthvalue_conversion): Warn on integer
        constants in boolean context.

cp:
2016-09-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR c++/77434
        * cvt.c (cp_convert_and_check): Suppress Wint-in-bool-context here.

testsuite:
2016-09-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR c++/77434
        * c-c++-common/Wint-in-bool-context.c: New test.

From-SVN: r240251
2016-09-19 22:10:11 +00:00
Bernd Edlinger
3385d437fe re PR other/77421 (Bugs found in GCC with the help of PVS-Studio)
2016-09-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR middle-end/77421
        * dwarf2out.c (output_loc_operands): Fix an assertion.

From-SVN: r240250
2016-09-19 21:57:46 +00:00
Joseph Myers
1f2071fafd Define TS 18661-1 CR_DECIMAL_DIG in <float.h>.
TS 18661-1 defines a macro CR_DECIMAL_DIG in <float.h>, for the number
of decimal digits for which conversions between decimal character
strings and (IEEE) binary formats, in both directions, are correctly
rounded.  This patch implements support for this macro in GCC's
<float.h>.

The definition __UINTMAX_MAX__ is the right one for GCC's conversions
of floating constants, since I made those use MPFR to make them
correctly rounding.  The macro also covers standard library functions
such as strtod and printf.  The definition is also correct for current
glibc.  If any targets' libcs support correct rounding in a way that
conforms to TS 18661-1 with a smaller value of CR_DECIMAL_DIG, making
<float.h> reflect that could not be done in isolation without changes
to the interpretation of floating constants as well, since a smaller
CR_DECIMAL_DIG requires double rounding of floating constants (first
to CR_DECIMAL_DIG decimal digits, then to the desired binary format).

Boostrapped with no regressions on x86_64-pc-linux-gnu.

gcc:
	* ginclude/float.h [__STDC_WANT_IEC_60559_BFP_EXT__]
	(CR_DECIMAL_DIG): New macro.

gcc/testsuite:
	* gcc.dg/cr-decimal-dig-1.c: New test.

From-SVN: r240249
2016-09-19 22:53:30 +01:00
Joseph Myers
63012d9a57 Make max_align_t respect _Float128.
The _FloatN, _FloatNx, _DecimalN and _DecimalNx types are specified in
such a way that they are basic types, meaning that max_align_t must be
at least as aligned as those types.

On 32-bit x86, max_align_t is currently 8-byte aligned, but
_Decimal128 and _Float128 are 16-byte aligned, so the alignment of
max_align_t needs to increase to meet the standard requirements for
these types.

This patch implements such an increase.  Because max_align_t needs to
be usable for C++ as well as for C, <stddef.h> can't actually refer to
_Float128, but needs to use __float128 (or some other notation for the
type) instead.  And since __float128 is architecture-specific, there
isn't a preprocessor conditional that means "__float128 is available"
(whereas one could test __FLT128_MANT_DIG__ to see if _Float128 is
available; __SIZEOF_FLOAT128__ is available on x86 only).  But I
believe the only case that actually has an alignment problem here is
32-bit x86, and <stddef.h> already has lots of conditional specific to
particular architectures or OSes, so this patch uses a conditional on
__i386__; that also is the minimal change that ensures neither size
nor alignment of max_align_t is changed in any case other than where
it is necessary.  If any other architectures turn out to have such an
issue, it will show up as failures of one of the testcases added by
this patch.

Such an increase is of course an ABI change, but a reasonably safe
one, in that max_align_t doesn't tend to appear in library interfaces
(rather, it's something to use when writing allocators and similar
code; most matches found on codesearch.debian.net look like copies of
the gnulib stddef.h module rather than anything actually using
max_align_t at all).

max_align_t_align has a corresponding change (adding _Float128 to the
types considered).

(I think glibc malloc alignment should also increase to 16-byte on
32-bit x86 so it works for allocating objects of these types, which is
now straightforward given the fix made for 32-bit powerpc.)

Bootstrapped with no regressions on x86_64-pc-linux-gnu, and
spot-tested with -m32 that the new float128-align.c test now compiles
where previously it didn't.

gcc:
	* ginclude/stddef.h (max_align_t) [__i386__]: Add __float128
	element.

gcc/c-family:
	* c-common.c (max_align_t_align): Also consider alignment of
	float128_type_node.

gcc/testsuite:
	* gcc.dg/float128-align.c, gcc.dg/float128x-align.c,
	gcc.dg/float16-align.c, gcc.dg/float32-align.c,
	gcc.dg/float32x-align.c, gcc.dg/float64-align.c,
	gcc.dg/float64x-align.c, gcc.dg/floatn-align.h: New tests.

From-SVN: r240248
2016-09-19 22:51:56 +01:00
Vladimir Makarov
0241082625 re PR rtl-optimization/77416 (LRA rematerializing use of CA reg across function call)
2016-09-19  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/77416
	* lra-remat.c (operand_to_remat): Process hard coded insn
	registers.

2016-09-19  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/77416
	* gcc.target/powerpc/pr77416.c: New.

From-SVN: r240247
2016-09-19 21:38:27 +00:00
Patrick Palka
6101a7ab87 Fix PR c++/77639 (ICE during error recovery)
gcc/cp/ChangeLog:

	PR c++/77639
	* parser.c (cp_parser_class_head): When
	processing_template_parmlist, don't assume that the
	class-head may start an explicit specialization.

gcc/testsuite/ChangeLog:

	PR c++/77639
	* g++.dg/template/error-recovery4.C: New test.

From-SVN: r240245
2016-09-19 18:12:36 +00:00
Jonathan Wakely
d0f5943566 libstdc++/77645 fix deque and vector xmethods for Python 3
PR libstdc++/77645
	* python/libstdcxx/v6/xmethods.py (DequeWorkerBase.__init__)
	(DequeWorkerBase.index, VectorWorkerBase.get): Cast results of
	division to int to work with Python 3.

From-SVN: r240241
2016-09-19 18:09:04 +01:00
Bin Cheng
1993ff76f5 pr57558-1.c: Use unsigned int instead of unsigned long.
gcc/testsuite
	* gcc.dg/vect/pr57558-1.c: Use unsigned int instead of unsigned long.

From-SVN: r240239
2016-09-19 16:35:32 +00:00
Kyrylo Tkachov
5fa9e6441f [simplify-rtx] (GTU (PLUS a C) (C - 1)) --> (LTU a -C)
* simplify-rtx.c (simplify_relational_operation_1): Add transformation
	(GTU (PLUS a C) (C - 1)) --> (LTU a -C).

	* gcc.target/aarch64/gtu_to_ltu_cmp_1.c: New test.
	* gcc.target/aarch64/gtu_to_ltu_cmp_2.c: New test.

From-SVN: r240238
2016-09-19 16:15:57 +00:00
Jonathan Wakely
ee1ab3e3c2 Make libstdc++ tests FAIL on Python errors
* testsuite/lib/gdb-test.exp (gdb-test): Fail if Python error occurs.

From-SVN: r240237
2016-09-19 16:59:04 +01:00
Segher Boessenkool
f37cb70b6b Fix lra_p text
* target.def (lra_p): Wordsmithing.
	* doc/tm.texi: Regenerate.

From-SVN: r240236
2016-09-19 17:54:12 +02:00
Jonathan Wakely
a0a1009abf Improve pretty printer for std::variant
* python/libstdcxx/v6/printers.py (SingleObjContainerPrinter): Allow
	display_hint to be set by subclasses.
	(StdVariantPrinter): Use array for display_hint. Adjust output to be
	more similar to std::any and std::optional output.
	(register_type_printers): Add type printers for basic_string_view
	typedefs and experimental::any. Adjust type printers for
	fundamentals_v1 templates to match fundamentals_v2 and later.
	* testsuite/libstdc++-prettyprinters/cxx17.cc: New.

From-SVN: r240234
2016-09-19 16:49:27 +01:00
Jonathan Wakely
019270bcb3 libstdc++/77645 Fix xmethods for std::list
PR libstdc++/77645
	* python/libstdcxx/v6/xmethods.py (DequeWorkerBase.index): Rename
	argument.
	(ListWorkerBase.get_value_from_node): Define new method.
	(ListFrontWorker.__call__, ListBackWorker.__call__): Use it.

From-SVN: r240233
2016-09-19 16:49:19 +01:00
Jakub Jelinek
fc15d9ecb4 re PR ipa/77587 (C compiler produces incorrect stack alignment with __attribute__((weak)))
PR target/77587
	* cgraph.c (cgraph_node::rtl_info): Pass &avail to
	ultimate_alias_target call, return NULL if avail < AVAIL_AVAILABLE.
	Call ultimate_alias_target just once, not up to 4 times.

	* gcc.dg/pr77587.c: New test.
	* gcc.dg/pr77587a.c: New file.

Co-Authored-By: Jan Hubicka <jh@suse.cz>

From-SVN: r240232
2016-09-19 16:36:38 +02:00
Andre Vehreschild
3c9f5092c6 libcaf.h: Add caf_reference_type.
libgfortran/ChangeLog:

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

	* caf/libcaf.h: Add caf_reference_type.
	* caf/mpi.c: Adapted signature of caf_register().
	* caf/single.c (struct caf_single_token): Added to keep the pointer
	to the memory registered and array descriptor.
	(caf_internal_error): Added convenience interface.
	(_gfortran_caf_register): Adapted to work with caf_single_token and
	return memory in the array descriptor.
	(_gfortran_caf_deregister): Same.
	(assign_char1_from_char4): Fixed style.
	(convert_type): Fixed incorrect conversion.
	(_gfortran_caf_get): Adapted to work with caf_single_token.
	(_gfortran_caf_send): Same.
	(_gfortran_caf_sendget): Same.
	(copy_data): Added to stop repeating it in all _by_ref functions.
	(get_for_ref): Recursive getting of coarray data using a chain of
	references.
	(_gfortran_caf_get_by_ref): Driver for computing the memory needed for
	the get and checking properties of the operation.
	(send_by_ref): Same as get_for_ref but for sending data.
	(_gfortran_caf_send_by_ref): Same like caf_get_by_ref but for sending.
	(_gfortran_caf_sendget_by_ref): Uses get_by_ref and send_by_ref to
	implement sendget for reference chains.
	(_gfortran_caf_atomic_define): Adapted to work with caf_single_token.
	(_gfortran_caf_atomic_ref): Likewise.
	(_gfortran_caf_atomic_cas): Likewise.
	(_gfortran_caf_atomic_op): Likewise.
	(_gfortran_caf_event_post): Likewise.
	(_gfortran_caf_event_wait): Likewise.
	(_gfortran_caf_event_query): Likewise.
	(_gfortran_caf_lock): Likewise.
	(_gfortran_caf_unlock): Likewise.


gcc/testsuite/ChangeLog:

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

	* gfortran.dg/coarray/alloc_comp_4.f90: New test.
	* gfortran.dg/coarray_38.f90:
	* gfortran.dg/coarray_alloc_comp_1.f08: New test.
	* gfortran.dg/coarray_alloc_comp_2.f08: New test.
	* gfortran.dg/coarray_allocate_7.f08: New test.
	* gfortran.dg/coarray_allocate_8.f08: New test.
	* gfortran.dg/coarray_allocate_9.f08: New test.
	* gfortran.dg/coarray_lib_alloc_1.f90: Adapted scan-tree-dumps to expect
	new caf_register.
	* gfortran.dg/coarray_lib_alloc_2.f90: Same.
	* gfortran.dg/coarray_lib_alloc_3.f90: Same.
	* gfortran.dg/coarray_lib_comm_1.f90: Adapted scan-tree-dumps to expect
	get_by_refs.
	* gfortran.dg/coarray_lib_token_3.f90: Same as for coarray_lib_alloc2.
	* gfortran.dg/coarray_lock_7.f90: Same.
	* gfortran.dg/coarray_poly_5.f90: Same.
	* gfortran.dg/coarray_poly_6.f90: Same.
	* gfortran.dg/coarray_poly_7.f90: Same.
	* gfortran.dg/coarray_poly_8.f90: Same.
	* gfortran.dg/coindexed_1.f90: Changed errors expected.

gcc/fortran/ChangeLog:

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

	* expr.c (gfc_check_assign): Added flag to control whether datatype
	conversion is allowed.
	* gfortran.h: Added caf-token-tree to gfc_component.  Changed
	prototypes mostly to add whether datatype conversion is allowed.
	* gfortran.texi: Added documentation for the caf_reference_t and the
	caf_*_by_ref function.
	* primary.c (caf_variable_attr): Similar to gfc_variable_attr but
	focused on the needs of coarrays.
	(gfc_caf_attr): Same.
	* resolve.c (resolve_ordinary_assign): Set the conversion allowed
	flag when not in a coarray.
	* trans-array.c (gfc_array_init_size): Moved setting of array
	descriptor's datatype before the alloc, because caf_register needs it.
	(gfc_array_allocate): Changed notion of whether an array is a coarray.
	(gfc_array_deallocate): Same.
	(gfc_alloc_allocatable_for_assignment): Added setting of coarray's
	array descriptor datatype before the register.  And using deregister/
	register to mimmick a realloc for coarrays.
	* trans-decl.c (gfc_build_builtin_function_decls): Corrected signatures
	of old caf-functions and added signature definitions of the _by_ref
	ones.
	(generate_coarray_sym_init): Adapted to new caf_register signature.
	* trans-expr.c (gfc_conv_scalar_to_descriptor): Make sure a constant
	is translated to an lvalue expression before use in an array
	descriptor.
	(gfc_get_ultimate_alloc_ptr_comps_caf_token): New function.  Get the
	last allocatable component's coarray token.
	(gfc_get_tree_for_caf_expr): For top-level object get the coarray
	token and check for unsupported features.
	(gfc_get_caf_token_offset): Getting the offset might procude new
	statements, which now are stored in the pre and post of the current se.
	(gfc_caf_get_image_index): For this image return a call to
	caf_this_image.
	(expr_may_alias_variables): Check that the result is set for testing
	its properties.
	(alloc_scalar_allocatable_for_assignment): Added auto allocation of
	coarray components.
	(gfc_trans_assignment_1): Rewrite an assign to a coarray object to
	be a sendget.
	* trans-intrinsic.c (conv_caf_vector_subscript_elem): Corrected
	wrong comment.
	(compute_component_offset): Compute the correct offset a structure
	member.
	(conv_expr_ref_to_caf_ref): Convert to a chain of refs into
	caf_references.
	(gfc_conv_intrinsic_caf_get): Call caf_get_by_ref instead of caf_get.
	(conv_caf_send): Call caf_*_by_ref for coarrays that need
	reallocation.
	(gfc_conv_intrinsic_function): Adapted to new signuature of the caf
	drivers.
	(conv_intrinsic_atomic_op): Add pre and post statements correctly.
	(conv_intrinsic_atomic_ref): Same.
	(conv_intrinsic_atomic_cas): Same.
	(conv_intrinsic_event_query): Same.
	* trans-stmt.c (gfc_trans_lock_unlock): Same.
	(gfc_trans_event_post_wait): Same.
	(gfc_trans_allocate): Support allocation of allocatable coarrays.
	(gfc_trans_deallocate): And there deallocation.
	* trans-types.c (gfc_typenode_for_spec): Added flag to control whether
	a component is part of coarray.  When so, then add space to store a
	coarray token.
	(gfc_build_array_type): Same.
	(gfc_get_array_descriptor_base): Same.
	(gfc_get_array_type_bounds): Same.
	(gfc_sym_type): Same.
	(gfc_get_derived_type): Same.
	(gfc_get_caf_reference_type): Declare the caf_reference_type.
	* trans-types.h: Prototype changes only.
	* trans.c (gfc_allocate_using_lib): Use the updated caf_register
	signature.
	(gfc_allocate_allocatable): Same.
	(gfc_deallocate_with_status): Same.
	* trans.h: Defined the runtime types for caf_reference_t and the enums.

From-SVN: r240231
2016-09-19 15:45:40 +02:00
Fritz Reese
e79e6763c6 re PR fortran/77584 (Unclassifiable statement error with procedure pointer using template named "structure_")
2016-09-19  Fritz Reese  <fritzoreese@gmail.com>

	PR fortran/77584
	* gcc/fortran/decl.c (match_record_decl, gfc_match_decl_type_spec):
	Fixes to handling of structure/record from declaration-type-spec.

	* gcc/testsuite/gfortran.dg/dec_structure_15.f90: New testcase.

From-SVN: r240230
2016-09-19 11:32:09 +00:00
Andrew Stubbs
471a0d47ae Fix zero-length parameter bug in pex_run.
2016-09-19  Andrew Stubbs  <ams@codesourcery.com>

	libiberty/
	* pex-win32.c (argv_to_cmdline): Quote zero-length parameters.

	libiberty/testsuite/
	* test-pexecute.c (main): Insert check for zero-length parameters.

From-SVN: r240229
2016-09-19 10:02:56 +00:00
Richard Biener
321e76fbf8 dwarf2out.c (early_dwarf_finished): New global.
2016-09-16  Richard Biener  <rguenther@suse.de>

	* dwarf2out.c (early_dwarf_finished): New global.
	(set_early_dwarf::set_early_dwarf): Assert early_dwarf_finished
	is false.
	(dwarf2out_early_finish): Set early_dwarf_finished at the end,
	if called from LTO exit early.
	(dwarf2out_late_global_decl): When being during the early
	debug phase do not add locations but only const value attributes.
	Adjust the way we generate early DIEs for LTO.

	lto/
	* lto.c (lto_main): Invoke early_finish debug hook.

From-SVN: r240228
2016-09-19 07:20:16 +00:00
Richard Biener
ae5276392f re PR tree-optimization/77605 (wrong code at -O3 on x86_64-linux-gnu)
2016-09-19  Richard Biener  <rguenther@suse.de>

	PR middle-end/77605
	* tree-data-ref.c (analyze_subscript_affine_affine): Use the
	proper niter to bound the loops.

	* gcc.dg/torture/pr77605.c: New testcase.

From-SVN: r240227
2016-09-19 06:55:17 +00:00
Richard Biener
ed4fd95729 re PR tree-optimization/77514 (ICE in VN_INFO_GET, at tree-ssa-sccvn.c:406 w/ -O2 (and above))
2016-09-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/77514
	* tree-ssa-pre.c (create_expression_by_pieces): Optimize
	search for folded stmt.

From-SVN: r240226
2016-09-19 06:54:10 +00:00
Louis Krupp
cdf060f898 pr68078.f90: XFAIL run on Darwin
2016-09-18  Louis Krupp  <louis.krupp@zoho.com>

	* gfortran.dg/pr68078.f90: XFAIL run on Darwin

From-SVN: r240225
2016-09-19 06:25:25 +00:00
GCC Administrator
9752f791d7 Daily bump.
From-SVN: r240224
2016-09-19 00:16:16 +00:00
Jan Hubicka
b720e91919 passes.def (pass_early_thread_jumps): Schedule after forwprop.
* passes.def (pass_early_thread_jumps): Schedule after forwprop.
	* tree-pass.h (make_pass_early_thread_jumps): Declare.
	* tree-ssa-threadbackward.c (fsm_find_thread_path,
	fsm_find_thread_path, profitable_jump_thread_path,
	fsm_find_control_statement_thread_paths,
	find_jump_threads_backwards): Add speed_p parameter.
	(pass_data_early_thread_jumps): New pass.
	(make_pass_early_thread_jumps): New function.

	* g++.dg/predict-loop-exit-1.C: Disable early jump threading.
	* g++.dg/predict-loop-exit-2.C: Disable early jump threading.
	* g++.dg/predict-loop-exit-3.C: Disable early jump threading.
	* gcc.dg/tree-ssa/pr69196-1.c: Disable early jump threading.
	* gcc.dg/tree-ssa/vrp01.c: Disable early jump threading.
	* gcc.dg/tree-ssa/ssa-dom-thread-2b.c: Disable early jump threading.
	* gcc.dg/tree-ssa/pr68198.c: Scan ethread dump.
	* gcc.dg/tree-ssa/ssa-thread-13.c: Scan ethread dump.
	* gcc.dg/tree-ssa/vrp56.c: Scan ethread dump.
	* gcc.dg/tree-ssa/vrp92.c: Scan ethread dump.
	* gcc.dg/uninit-15.c: Swap xfailed and non-xfailed alternative.

From-SVN: r240221
2016-09-18 18:44:53 +00:00
Kirill Yukhin
bdabae3950 pr68633.c: Fix expected result.
gcc/testsuite/
	* gcc.target/i386/pr68633.c: Fix expected result.

From-SVN: r240220
2016-09-18 12:56:19 +00:00
Louis Krupp
493ba8208e re PR fortran/68078 (segfault with allocate and stat for derived types with default initialization)
2016-09-17  Louis Krupp  <louis.krupp@gmail.com>

	PR fortran/68078
	* gfortran.dg/pr68078.f90: New test.
	* gfortran.dg/set_vm_limit.c: New, called by pr68078.

2016_09_17  Louis Krupp  <louis.krupp@zoho.com>

	PR fortran/68078
	* resolve.c (resolve_allocate_expr): Check that derived type
	pointer, object or array has been successfully allocated before
	initializing.

From-SVN: r240219
2016-09-18 05:52:23 +00:00
GCC Administrator
ee569f061c Daily bump.
From-SVN: r240218
2016-09-18 00:16:20 +00:00
Jonathan Wakely
0089537230 Define pretty printers for C++17 library components
* python/libstdcxx/v6/printers.py (StdVariantPrinter): Define.
	(StdExpAnyPrinter, StdExpOptionalPrinter, StdExpStringViewPrinter):
	Register for C++17 components in namespace std. Strip inline namespace
	from typename.

From-SVN: r240215
2016-09-17 16:20:23 +01:00
Andreas Schwab
70428957af ia64.h (ASM_OUTPUT_DWARF_OFFSET): Add cast.
* config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Add cast.
* config/i386/cygming.h (ASM_OUTPUT_DWARF_OFFSET): Likewise.

From-SVN: r240214
2016-09-17 09:39:37 +00:00
GCC Administrator
c08fe0e826 Daily bump.
From-SVN: r240213
2016-09-17 00:16:13 +00:00
Jonathan Wakely
de42c9ac8a Remove bogus entry in ChangeLog added by git-svn
From-SVN: r240206
2016-09-16 23:11:50 +01:00
Jonathan Wakely
3096abe0d6 Fix documentation for overflow-checking builtins
* doc/extend.texi (Integer Overflow Builtins): Fix type of out
	parameters for functions taking long long arguments.

From-SVN: r240205
2016-09-16 23:11:46 +01:00
Jonathan Wakely
6ee3fd9742 Fix typo in Libstdc++ Profile Mode docs
* doc/xml/manual/profile_mode.xml: Fix typo.
	* doc/html/manual/profile_mode_devel.html: Regenerate.

From-SVN: r240204
2016-09-16 23:09:15 +01:00
Eric Botcazou
714c237756 recog.c (rest_of_handle_split_after_reload): Delete.
* recog.c (rest_of_handle_split_after_reload): Delete.
	(pass_split_after_reload::gate): New method.
	(pass_split_after_reload::execute): Call split_all_insns directly.

From-SVN: r240203
2016-09-16 21:39:05 +00:00
Jonathan Wakely
6e395fcb44 Fix documentation for overflow-checking builtins
* doc/extend.texi (Integer Overflow Builtins): Fix type of out
	parameters for functions taking long long arguments.

From-SVN: r240200
2016-09-16 22:36:30 +01:00
Bill Schmidt
9a42726b2e re PR target/77613 (Powerpc64le: redundant swaps in autovectorised loop)
[gcc]

2016-09-16  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR target/77613
	* config/rs6000/rs6000.c (rtx_is_swappable_p): Add support for
	splat with truncate.

[gcc/testsuite]

2016-09-16  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR target/77613
	* gcc.target/powerpc/swaps-p8-25.c: New.

From-SVN: r240199
2016-09-16 21:28:52 +00:00
Jakub Jelinek
8f03e02f36 re PR c++/77482 (Segfault when compiling ill-formed constexpr code)
PR c++/77482
	* error.c (dump_simple_decl): Only check DECL_DECLARED_CONCEPT_P
	if DECL_LANG_SPECIFIC is non-NULL.  Fix up formatting.

	* g++.dg/cpp0x/constexpr-77482.C: New test.

From-SVN: r240198
2016-09-16 22:25:17 +02:00
Jakub Jelinek
e80cb545aa re PR c++/77379 (incorrect mangling for non-virtual adjustor thunk (missing abi tag))
PR c++/77379
	* g++.dg/abi/abi-tag23.C: Adjust scan-assembler regex for differing
	thunk offsets.
	* g++.dg/abi/abi-tag23a.C: Likewise.

From-SVN: r240197
2016-09-16 22:23:15 +02:00
Jakub Jelinek
1c2f613fbc re PR c++/77338 (ICE on invalid C++11 code on x86_64-linux-gnu: Segmentation fault)
PR c++/77338
	* constexpr.c (cxx_eval_constant_expression) <case PARM_DECL>: Only
	call is_really_empty_class on complete types.

	* g++.dg/cpp0x/decltype-77338.C: New test.

From-SVN: r240196
2016-09-16 22:22:35 +02:00
Jakub Jelinek
e7d6117809 re PR c++/77375 (constant object with mutable subobject allocated in read-only memory)
PR c++/77375
	* class.c (check_bases): Set CLASSTYPE_HAS_MUTABLE if any TYPE_HAS_MUTABLE_P
	for any bases.

	* g++.dg/cpp0x/mutable1.C: New test.

From-SVN: r240195
2016-09-16 22:21:29 +02:00
Jason Merrill
146ec50fd5 Add inline functions for various bitwise operations.
* hwint.h (least_bit_hwi, pow2_or_zerop, pow2p_hwi, ctz_or_zero):
	New.
	* hwint.c (exact_log2): Use pow2p_hwi.
	(ctz_hwi, ffs_hwi): Use least_bit_hwi.
	* alias.c (memrefs_conflict_p): Use pow2_or_zerop.
	* builtins.c (get_object_alignment_2, get_object_alignment)
	(get_pointer_alignment, fold_builtin_atomic_always_lock_free): Use
	least_bit_hwi.
	* calls.c (compute_argument_addresses, store_one_arg): Use
	least_bit_hwi.
	* cfgexpand.c (expand_one_stack_var_at): Use least_bit_hwi.
	* combine.c (force_to_mode): Use least_bit_hwi.
	* emit-rtl.c (set_mem_attributes_minus_bitpos, adjust_address_1):
	Use least_bit_hwi.
	* expmed.c (synth_mult, expand_divmod): Use ctz_or_zero, ctz_hwi.
	(init_expmed_one_conv): Use pow2p_hwi.
	* fold-const.c (round_up_loc, round_down_loc): Use pow2_or_zerop.
	(fold_binary_loc): Use pow2p_hwi.
	* function.c (assign_parm_find_stack_rtl): Use least_bit_hwi.
	* gimple-fold.c (gimple_fold_builtin_memory_op): Use pow2p_hwi.
	* gimple-ssa-strength-reduction.c (replace_ref): Use least_bit_hwi.
	* hsa-gen.c (gen_hsa_addr_with_align, hsa_bitmemref_alignment):
	Use least_bit_hwi.
	* ipa-cp.c (ipcp_alignment_lattice::meet_with_1): Use least_bit_hwi.
	* ipa-prop.c (ipa_modify_call_arguments): Use least_bit_hwi.
	* omp-low.c (oacc_loop_fixed_partitions)
	(oacc_loop_auto_partitions): Use least_bit_hwi.
	* rtlanal.c (nonzero_bits1): Use ctz_or_zero.
	* stor-layout.c (place_field): Use least_bit_hwi.
	* tree-pretty-print.c (dump_generic_node): Use pow2p_hwi.
	* tree-sra.c (build_ref_for_offset): Use least_bit_hwi.
	* tree-ssa-ccp.c (ccp_finalize): Use least_bit_hwi.
	* tree-ssa-math-opts.c (bswap_replace): Use least_bit_hwi.
	* tree-ssa-strlen.c (handle_builtin_memcmp): Use pow2p_hwi.
	* tree-vect-data-refs.c (vect_analyze_group_access_1)
	(vect_grouped_store_supported, vect_grouped_load_supported)
	(vect_permute_load_chain, vect_shift_permute_load_chain)
	(vect_transform_grouped_load): Use pow2p_hwi.
	* tree-vect-generic.c (expand_vector_divmod): Use ctz_or_zero.
	* tree-vect-patterns.c (vect_recog_divmod_pattern): Use ctz_or_zero.
	* tree-vect-stmts.c (vectorizable_mask_load_store): Use
	least_bit_hwi.
	* tsan.c (instrument_expr): Use least_bit_hwi.
	* var-tracking.c (negative_power_of_two_p): Use pow2_or_zerop.

From-SVN: r240194
2016-09-16 15:20:44 -04:00
Jakub Jelinek
299910482f re PR libgcc/71744 (Concurrently throwing exceptions is not scalable)
PR libgcc/71744
	* unwind-dw2-fde.c (ATOMIC_FDE_FAST_PATH): Define if __register_frame*
	is not the primary registry and atomics are available.
	(any_objects_registered): New variable.
	(__register_frame_info_bases, __register_frame_info_table_bases):
	Atomically store 1 to any_objects_registered after registering first
	unwind info.
	(_Unwind_Find_FDE): Return early if any_objects_registered is 0.

From-SVN: r240193
2016-09-16 21:17:47 +02:00
Jonathan Wakely
84c08ec96a Replace modulus with mask operation in over-aligned new
2016-09-16  Jonathan Wakely  <jwakely@redhat.com>
	    Marc Glisse  <marc.glisse@inria.fr>

	* libsupc++/new_opa.cc [_GLIBCXX_HAVE_ALIGNED_ALLOC]
	(operator new(size_t, align_val_t)): Replace modulus operator with
	mask.

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

From-SVN: r240192
2016-09-16 19:09:14 +01:00
Steven G. Kargl
8d987deb5b re PR fortran/77612 (ICE on invalid character len in contained procedure)
2016-09-16  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/77612
	* decl.c (char_len_param_value): Check parent namespace for 
	seen_implicit_none.


2016-09-16  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/77612
	* gfortran.dg/pr77612.f90: New test.

From-SVN: r240191
2016-09-16 17:55:38 +00:00
Jonathan Wakely
426042f5f2 Adjust arguments to aligned_alloc or posix_memalign
* libsupc++/new_opa.cc [_GLIBCXX_HAVE_POSIX_MEMALIGN] (aligned_alloc):
	Increase alignment if less than sizeof(void*).
	[_GLIBCXX_HAVE_ALIGNED_ALLOC] (operator new(size_t, align_val_t)):
	Increase size if not a multiple of alignment.

From-SVN: r240187
2016-09-16 13:11:19 +01:00
Senthil Kumar Selvaraj
2c3d35a661 Fix testsuite failure for avr target
The test has integer literals that only fit on a target with int size 32+.

gcc/testsuite/

2016-09-16  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

	* gcc.dg/torture/pr70421.c: Require int32plus.

From-SVN: r240186
2016-09-16 11:42:59 +00:00
Marek Polacek
5b73d2ab55 * c-typeck.c (lvalue_p): Use true and false instead of 1 and 0.
From-SVN: r240185
2016-09-16 10:18:06 +00:00
Andreas Schwab
4561967700 ia64.h (ASM_OUTPUT_DWARF_OFFSET): Use parameter OFFSET, not offset.
* config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Use parameter
	OFFSET, not offset.
	* config/i386/cygming.h (ASM_OUTPUT_DWARF_OFFSET): Likewise.

From-SVN: r240176
2016-09-16 08:38:14 +00:00
Jakub Jelinek
bcf0905aa7 re PR middle-end/77475 (unnecessary or misleading context in reporting command line problems)
PR middle-end/77475
	* gcc.target/i386/pr65990.c: Adjust dg-error regexp.

From-SVN: r240175
2016-09-16 10:13:51 +02:00