gcc/libitm
Martin Sebor c3684b7b86 PR c++/80560 - warn on undefined memory operations involving non-trivial types
gcc/c-family/ChangeLog:

	PR c++/80560
	* c.opt (-Wclass-memaccess): New option.

gcc/cp/ChangeLog:

	PR c++/80560
	* call.c (first_non_public_field, maybe_warn_class_memaccess): New
	functions.
	(has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
	(build_cxx_call): Call maybe_warn_class_memaccess.

gcc/ChangeLog:

	PR c++/80560
	* dumpfile.c (dump_register): Avoid calling memset to initialize
	a class with a default ctor.
	* gcc.c (struct compiler): Remove const qualification.
	* genattrtab.c (gen_insn_reserv): Replace memset with initialization.
	* hash-table.h: Ditto.
	* ipa-cp.c (allocate_and_init_ipcp_value): Replace memset with
	  assignment.
	* ipa-prop.c (ipa_free_edge_args_substructures): Ditto.
	* omp-low.c (lower_omp_ordered_clauses): Replace memset with
	default ctor.
	* params.h (struct param_info): Make struct members non-const.
	* tree-switch-conversion.c (emit_case_bit_tests): Replace memset
	with default initialization.
	* vec.h (vec_copy_construct, vec_default_construct): New helper
	functions.
	(vec<T>::copy, vec<T>::splice, vec<T>::reserve): Replace memcpy
	with vec_copy_construct.
	(vect<T>::quick_grow_cleared): Replace memset with default ctor.
	(vect<T>::vec_safe_grow_cleared, vec_safe_grow_cleared): Same.
	* doc/invoke.texi (-Wclass-memaccess): Document.

libcpp/ChangeLog:

	PR c++/80560
	* line-map.c (line_maps::~line_maps): Avoid calling htab_delete
	with a null pointer.
	(linemap_init): Avoid calling memset on an object of a non-trivial
	type.

libitm/ChangeLog:

	PR c++/80560
	* beginend.cc (GTM::gtm_thread::rollback): Avoid calling memset
	on an object of a non-trivial type.
	(GTM::gtm_transaction_cp::commit): Use assignment instead of memcpy
	to copy an object.
	* method-ml.cc (orec_iterator::reinit): Avoid -Wclass-memaccess.

gcc/testsuite/ChangeLog:

	PR c++/80560
	* g++.dg/Wclass-memaccess.C: New test.

From-SVN: r249234
2017-06-15 21:48:59 -06:00
..
config target.h (htm_available): Determine vendor from __get_cpuid_max return. 2017-01-19 18:10:40 +01:00
testsuite Load new scanlang.exp 2017-05-12 09:20:37 +00:00
ChangeLog Load new scanlang.exp 2017-05-12 09:20:37 +00:00
Makefile.am re PR other/79046 (g++ -print-file-name=plugin uses full version number in path) 2017-01-17 10:38:48 +01:00
Makefile.in re PR other/79046 (g++ -print-file-name=plugin uses full version number in path) 2017-01-17 10:38:48 +01:00
aatree.cc Update copyright years. 2017-01-01 13:07:43 +01:00
aatree.h Update copyright years. 2017-01-01 13:07:43 +01:00
acinclude.m4 Disable hwcaps on libgfortran 2016-12-12 13:40:21 +00:00
aclocal.m4 Disable hwcaps on libgfortran 2016-12-12 13:40:21 +00:00
alloc.cc Update copyright years. 2017-01-01 13:07:43 +01:00
alloc_c.cc Update copyright years. 2017-01-01 13:07:43 +01:00
alloc_cpp.cc Update copyright years. 2017-01-01 13:07:43 +01:00
barrier.cc Update copyright years. 2017-01-01 13:07:43 +01:00
beginend.cc PR c++/80560 - warn on undefined memory operations involving non-trivial types 2017-06-15 21:48:59 -06:00
clone.cc Update copyright years. 2017-01-01 13:07:43 +01:00
common.h Update copyright years. 2017-01-01 13:07:43 +01:00
config.h.in acinclude.m4 (LIBITM_CHECK_AS_HTM): New. 2013-07-15 12:23:49 -05:00
configure re PR other/79046 (g++ -print-file-name=plugin uses full version number in path) 2017-01-17 10:38:48 +01:00
configure.ac re PR other/79046 (g++ -print-file-name=plugin uses full version number in path) 2017-01-17 10:38:48 +01:00
configure.tgt Update copyright years. 2017-01-01 13:07:43 +01:00
containers.h Update copyright years. 2017-01-01 13:07:43 +01:00
dispatch.h Update copyright years. 2017-01-01 13:07:43 +01:00
eh_cpp.cc Update copyright years. 2017-01-01 13:07:43 +01:00
libitm.h Update copyright years. 2017-01-01 13:07:43 +01:00
libitm.map Support __cxa_free_exception and fix exception handling. 2015-11-20 00:10:08 +00:00
libitm.spec.in
libitm.texi gcc.c (process_command): Update copyright notice dates. 2017-01-01 12:31:28 +01:00
libitm_i.h Fix numerous typos in comments 2017-04-03 23:30:56 +01:00
local.cc Update copyright years. 2017-01-01 13:07:43 +01:00
local_atomic Update copyright years. 2017-01-01 13:07:43 +01:00
method-gl.cc Update copyright years. 2017-01-01 13:07:43 +01:00
method-ml.cc PR c++/80560 - warn on undefined memory operations involving non-trivial types 2017-06-15 21:48:59 -06:00
method-serial.cc Update copyright years. 2017-01-01 13:07:43 +01:00
query.cc Update copyright years. 2017-01-01 13:07:43 +01:00
retry.cc Update copyright years. 2017-01-01 13:07:43 +01:00
useraction.cc Update copyright years. 2017-01-01 13:07:43 +01:00
util.cc Update copyright years. 2017-01-01 13:07:43 +01:00