Commit Graph

166358 Commits

Author SHA1 Message Date
Paolo Carlini
59ec491477 decl.c (grokdeclarator): Use locations[ds_storage_class] in error messages about ill-formed uses of mutable.
/cp
2019-01-16  Paolo Carlini  <paolo.carlini@oracle.com>

	* decl.c (grokdeclarator): Use locations[ds_storage_class] in
	error messages about ill-formed uses of mutable.

/testsuite
2019-01-16  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/other/pr33558.C: Test location too.
	* g++.dg/other/pr33558-2.C: Likewise.
	* g++.dg/parse/crash4.C: Likewise.
	* g++.old-deja/g++.brendan/err-msg11.C: Likewise.
	* g++.old-deja/g++.mike/p7635.C: Likewise.
	* g++.old-deja/g++.other/decl6.C: Likewise.

From-SVN: r267978
2019-01-16 16:16:54 +00:00
Marek Polacek
2ea2a74dce PR c++/78244 - narrowing conversion in template not detected.
* call.c (perform_implicit_conversion_flags): Set
	IMPLICIT_CONV_EXPR_BRACED_INIT.
	* cp-tree.h (IMPLICIT_CONV_EXPR_BRACED_INIT): New.
	* pt.c (tsubst_copy_and_build): Use it.

	* g++.dg/cpp0x/Wnarrowing13.C: New test.
	* g++.dg/cpp0x/Wnarrowing14.C: New test.

From-SVN: r267976
2019-01-16 15:58:34 +00:00
Uros Bizjak
647c5e3ea7 alpha.c (alpha_gimplify_va_arg): Handle split indirect COMPLEX_TYPE arguments.
* config/alpha/alpha.c (alpha_gimplify_va_arg):
	Handle split indirect COMPLEX_TYPE arguments.

From-SVN: r267973
2019-01-16 16:33:34 +01:00
Richard Earnshaw
638b5fcaa0 __builtin_<add/sub>_overflow issues on AArch64 (redux) (cont)
And the ChangeLog for PR target/86891 fix.

From-SVN: r267972
2019-01-16 15:22:08 +00:00
Richard Earnshaw
f7343f20c5 __builtin_<add/sub>_overflow issues on AArch64 (redux)
Further investigation showed that my previous patch for this issue was
still incomplete.

The problem stemmed from what I suspect was a mis-understanding of the
way overflow is calculated on aarch64 when values are subtracted (and
hence in comparisons).  In this case, unlike addition, the carry flag
is /cleared/ if there is overflow (technically, underflow) and set
when that does not happen.  This patch clears up this issue by using
CCmode for all subtractive operations (this can fully describe the
normal overflow conditions without anything particularly fancy);
clears up the way we express normal unsigned overflow using CC_Cmode
(the result of a sum is less than one of the operands) and adds a new
mode, CC_ADCmode to handle expressing overflow of an add-with-carry
operation, where the standard idiom is no-longer sufficient to
describe the overflow condition.

	PR target/86891
	* config/aarch64/aarch64-modes.def: Add comment about how the carry
	bit is set by add and compare.
	(CC_ADC): New CC_MODE.
	* config/aarch64/aarch64.c (aarch64_select_cc_mode): Use variables
	to cache the code and mode of X.  Adjust the shape of a CC_Cmode
	comparison.  Add detection for CC_ADCmode.
	(aarch64_get_condition_code_1): Update code support for CC_Cmode.  Add
	CC_ADCmode.
	* config/aarch64/aarch64.md (uaddv<mode>4): Use LTU with CCmode.
	(uaddvti4): Comparison result is in CC_ADCmode and the condition is GEU.
	(add<mode>3_compareC_cconly_imm): Delete.  Merge into...
	(add<mode>3_compareC_cconly): ... this.  Restructure the comparison
	to eliminate the need for zero-extending the operands.
	(add<mode>3_compareC_imm): Delete.  Merge into ...
	(add<mode>3_compareC): ... this.  Restructure the comparison to
	eliminate the need for zero-extending the operands.
	(add<mode>3_carryin): Use LTU for the overflow detection.
	(add<mode>3_carryinC): Use CC_ADCmode for the result of the carry out.
	Reexpress comparison for overflow.
	(add<mode>3_carryinC_zero): Update for change to add<mode>3_carryinC.
	(add<mode>3_carryinC): Likewise.
	(add<mode>3_carryinV): Use LTU for carry between partials.
	* config/aarch64/predicates.md (aarch64_carry_operation): Update
	handling of CC_Cmode and add CC_ADCmode.
	(aarch64_borrow_operation): Likewise.

From-SVN: r267971
2019-01-16 15:18:05 +00:00
Jakub Jelinek
e964d9b23a re PR c/51628 (__attribute__((packed)) is unsafe in some cases (i.e. add -Waddress-of-packed-member, etc.))
PR c/51628
	PR target/88682
	* c-c++-common/pr51628-10.c (unaligned_int128_t): Add
	may_alias attribute.

From-SVN: r267970
2019-01-16 15:18:47 +01:00
Tamar Christina
ee8045e577 Fix Arm big-endian regressions.
gcc/ChangeLog:

	* config/arm/arm-protos.h (neon_vcmla_lane_prepare_operands): Remove patternmode.
	* config/arm/arm.c (neon_vcmla_lane_prepare_operands): Likewise.
	* config/arm/neon.md (neon_vcmla_lane<rot><mode>, neon_vcmla_laneq<rot><mode>,
	neon_vcmlaq_lane<rot><mode>): Remove endianness conversion.

From-SVN: r267969
2019-01-16 11:25:10 +00:00
Martin Liska
99b1b1fac0 Extend locations where to seach for Fortran pre-include.
2019-01-16  Martin Liska  <mliska@suse.cz>

	* Makefile.in: Set TOOL_INCLUDE_DIR and NATIVE_SYSTEM_HEADER_DIR
	for GCC driver.
	* config/gnu-user.h (TARGET_F951_OPTIONS): Add 'finclude%s/' as
	a new argument.
	* gcc.c (add_sysrooted_hdrs_prefix): New function.
	(path_prefix_reset): Move up in the source file.
	(find_fortran_preinclude_file): Make complex search for the
	fortran header files.

From-SVN: r267967
2019-01-16 09:38:21 +00:00
Kewen Lin
0684a81665 Add self to maintainers list.
2019-01-16  Kewen Lin  <linkw@gcc.gnu.org>

    * MAINTAINERS (Write After Approval): Add myself.

From-SVN: r267965
2019-01-16 08:23:05 +00:00
Ulrich Drepper
ec0d53719f PR libstdc++/88738 treat shared_ptr and unique_ptr more like plain old pointers
PR libstdc++/88738
        Warn about unused comparisons of shared_ptr/unique_ptr
        * include/bits/c++config [_GLIBCXX_NODISCARD]: Define.
        * include/bits/shared_ptr.h: Use it for operator ==, !=,
        <, <=, >, >= for shared_ptr.
        * include/bits/unique_ptr.h: Likewise for unique_ptr.

From-SVN: r267964
2019-01-16 08:01:22 +00:00
Tom de Vries
df1de06415 [libbacktrace] Unify function name preference handling
Both read_function_entry and read_referenced_name implement a priority scheme
for names.  The priorities are:
- 1st: DW_AT_linkage_name
- 2nd: Name from DW_AT_abstract_origin or DW_AT_specification
- 3rd: DW_AT_name.

Ensure both functions fully adhere to it.

2019-01-16  Tom de Vries  <tdevries@suse.de>

	* dwarf.c (read_referenced_name): Don't allow DW_AT_name to override any
	name.
	(read_function_entry): Same.  Don't allow name found via
	DW_AT_abstract_origin or case DW_AT_specification to override linkage
	name.

From-SVN: r267963
2019-01-16 07:46:56 +00:00
Xiong Hu Luo
9a60361196 Add myself
From-SVN: r267962
2019-01-16 07:41:23 +00:00
GCC Administrator
c6cdc1ebab Daily bump.
From-SVN: r267961
2019-01-16 00:16:17 +00:00
Nikhil Benesch
5686a6b7a6 godump.c (go_output_typedef): When outputting a typedef...
gcc/:
        * godump.c (go_output_typedef): When outputting a typedef, refer
	to the underlying type by its name and not its structure.
gcc/testsuite:
        * gcc.misc-tests/godump-1.c: Add test case for typedef before
	struct.

From-SVN: r267958
2019-01-15 23:54:37 +00:00
David Malcolm
1abb44f863 Fix ICE on class-template argument deduction (PR c++/88795)
PR c++/88795 reports an ICE building a function_type for a deduction guide
when the substitution into the function signature fails, due to an
error_mark_node being returned from tsubst_arg_types but not being checked
for.  This error_mark_node gets used as the TYPE_ARG_TYPES, leading to
ICEs in various places that assume this is a TREE_LIST.

This patch checks the result of tsubst_arg_types and propagates the failure
if it returns error_mark_node.  It also adds an assertion to
build_function_type, to fail faster if passed in error_mark_node.

gcc/cp/ChangeLog:
	PR c++/88795
	* pt.c (build_deduction_guide): Bail out if tsubst_arg_types
	fails.

gcc/testsuite/ChangeLog:
	PR c++/88795
	* g++.dg/template/pr88795.C: New test.

gcc/ChangeLog:
	PR c++/88795
	* tree.c (build_function_type): Assert that arg_types is not
	error_mark_node.

From-SVN: r267957
2019-01-15 23:29:15 +00:00
Ian Lance Taylor
b7ec44e82b runtime: add padding to FFI type of struct ending with zero-sized field
CL 157557 changes the compiler to add one byte padding to
    non-empty struct ending with a zero-sized field. Add the same
    padding to the FFI type, so reflect.Call works.
    
    This fixes test/fixedbugs/issue26335.go in the main repo.
    
    Reviewed-on: https://go-review.googlesource.com/c/158018

From-SVN: r267956
2019-01-15 23:21:24 +00:00
Iain Buclaw
5e95646e73 [D] Move building of typeof(null) values to a common function.
gcc/d/ChangeLog:

	* d-codegen.cc (build_typeof_null_value): New function.
	* d-tree.h (build_typeof_null_value): Declare.
	* d-convert.cc (convert_expr): Use build_typeof_null_value.
	* expr.cc (ExprVisitor::visit(NullExp)): Likewise.

From-SVN: r267955
2019-01-15 23:02:43 +00:00
Thomas Koenig
37879e0161 re PR fortran/43136 (Excess copy-in/copy-out with character argument)
2019-01-15  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/43136
	* resolve.c (resolve_array_ref): Add equal_length argument; set it
	if the length of the substring equals that of the orignal
	variable.
	(resolve_ref): Remove the substring if it is equal in length to
	the original variable, unless it is an EXPR_SUBSTRING).

2019-01-15  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/43136
	* gfortran.dg/actual_array_substr_3.f90: New test.

From-SVN: r267954
2019-01-15 22:20:26 +00:00
Thomas Koenig
0335cc372c re PR fortran/43072 (unneeded temporary (s=s+f(a)))
2019-01-15  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/43072
	* resolve.c (resolve_array_ref): Add equal_length argument; set it
	if the length of the substring equals that of the orignal
	variable.
	(resolve_ref): Remove the substring if it is equal in length to
	the original variable, unless it is an EXPR_SUBSTRING).

2019-01-15  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/43072
	* gfortran.dg/actual_array_substr_3.f90: New test.

From-SVN: r267953
2019-01-15 22:18:55 +00:00
Ian Lance Taylor
6a0c8e77f2 compiler, runtime: panic on uncomparable map key, even if map is empty
This ports https://golang.org/cl/155918 from the master repo.
    
        runtime: panic on uncomparable map key, even if map is empty
    
        Reorg map flags a bit so we don't need any extra space for the extra flag.
    
    This is a pre-req for updating libgo to the Go 1.12beta2 release.
    
    Reviewed-on: https://go-review.googlesource.com/c/157858

From-SVN: r267950
2019-01-15 20:32:39 +00:00
Steven G. Kargl
a81a6d5836 re PR fortran/81849 (Size of automatic array argument specified by host-associated variable.)
2019-01-15  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/81849
	* resolve.c (resolve_symbol): Host associated varaibles can appear
	in the specification statement of a RESULT array.

2019-01-15  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/81849
	* gfortran.dg/pr81849.f90: New test.

From-SVN: r267948
2019-01-15 20:17:35 +00:00
Paul Thomas
92f3a180aa trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Deal with exprs that are indirect references; ie.
2019-01-15  Paul Thomas  <pault@gcc.gnu.org>

	* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Deal with exprs
	that are indirect references; ie. dummy arguments.

2019-01-15  Paul Thomas  <pault@gcc.gnu.org>

	* gfortran.dg/ISO_Fortran_binding_2.c : Change reference to
	ISO_Fortran_binding_2.h.

From-SVN: r267946
2019-01-15 19:52:08 +00:00
Marek Polacek
51177d3d64 re PR c++/88866 (g++.dg/cpp0x/variadic126.C fails with -std=c++2a)
PR c++/88866
	* g++.dg/cpp0x/variadic126.C: Tweak dg-error.

From-SVN: r267944
2019-01-15 18:35:01 +00:00
Jason Merrill
f60026c5a9 * g++.dg/ext/utf-cvt-char8_t.C: Pass -fsigned-char.
From-SVN: r267942
2019-01-15 13:26:00 -05:00
Richard Sandiford
99063eeecb PR inline-asm/52813 revisited
The original patch for this PR made it an error to list the stack
pointer in the clobber list of an inline asm.  However, the general
feeling seemed to be that going straight to a hard error was too harsh,
since there's quite a bit of existing code that has the clobber.

This patch implements the compromise discussed on IRC of making it
a -Wdeprecated warning instead.

2019-01-15  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	PR inline-asm/52813
	* doc/extend.texi: Document that listing the stack pointer in the
	clobber list of an asm is a deprecated feature.
	* common.opt (Wdeprecated): Moved from c-family/c.opt.
	* cfgexpand.c (asm_clobber_reg_is_valid): Issue a -Wdeprecated
	warning instead of an error for clobbers of the stack pointer.
	Add a note explaining why.

gcc/c-family/
	PR inline-asm/52813
	* c.opt (Wdeprecated): Move documentation and variable to common.opt.

gcc/d/
	PR inline-asm/52813
	* lang.opt (Wdeprecated): Reference common.opt instead of c.opt.

gcc/testsuite/
	PR inline-asm/52813
	* gcc.target/i386/pr52813.c (test1): Turn the diagnostic into a
	-Wdeprecated warning and expect a following note:.

From-SVN: r267941
2019-01-15 16:46:54 +00:00
Richard Biener
17f781605e re PR debug/88046 (ICE in add_data_member_location_attribute at gcc/dwarf2out.c:19237 since r261885)
2019-01-15  Richard Biener  <rguenther@suse.de>

	PR debug/88046
	* dwarf2out.c (gen_member_die): Do not generate inheritance
	DIEs late.

	* g++.dg/lto/pr88046_0.C: New testcase.

From-SVN: r267940
2019-01-15 16:06:42 +00:00
Richard Biener
41bc37bad8 re PR tree-optimization/88855 (ICE: verify_ssa failed (error: SSA_NAME_OCCURS_IN_ABNORMAL_PHI should be set))
2019-01-15  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/88855
	* tree-if-conv.c (combine_blocks): Collect
	SSA_NAME_OCCURS_IN_ABNORMAL_PHI from propagated out virtuals.

	* gcc.dg/pr88855.c: New testcase.

From-SVN: r267939
2019-01-15 15:37:29 +00:00
Jonathan Wakely
10ddff67d3 Update value of __cpp_lib_shared_ptr_arrays macro
* include/bits/shared_ptr_base.h (__cpp_lib_shared_ptr_arrays): Define
	as 201611L, because P0497R0 changes are supported.
	* include/std/version (__cpp_lib_shared_ptr_arrays): Likewise.

From-SVN: r267938
2019-01-15 13:13:11 +00:00
Jonathan Wakely
6e3dd211ca Fix more missing or incorrect feature test macros
* include/bits/erase_if.h [__cplusplus > 201703L]
	(__cpp_lib_erase_if): Only define for C++2a.
	* include/std/iterator [__cplusplus >= 201402L && !_GLIBCXX_DEBUG]
	(__cpp_lib_null_iterators): Define.
	* include/std/version [__cplusplus >= 201402L && !_GLIBCXX_DEBUG]
	(__cpp_lib_null_iterators): Define.
	[__cpp_impl_destroying_delete] (__cpp_lib_destroying_delete): Define.

From-SVN: r267937
2019-01-15 12:58:19 +00:00
Jonathan Wakely
56a9eaf9ab Fix missing or incorrect feature test macros
* doc/xml/manual/status_cxx2017.xml: Document P0032R3 and P0307R2
	status.
	* include/bits/stl_uninitialized.h (__cpp_lib_raw_memory_algorithms):
	Define.
	* include/std/any (__cpp_lib_any): Define as 201606L, because P0032R3
	changes are supported.
	* include/std/optional (__cpp_lib_optional): Likewise.
	* include/std/variant (__cpp_lib_variant): Likewise.
	* include/std/version [!__STRICT_ANSI__]
	(__cpp_lib_uncaught_exceptions): Define as long integer.
	[__cplusplus >= 201703L] (__cpp_lib_any)
	(__cpp_lib_raw_memory_algorithms, __cpp_lib_uncaught_exceptions)
	(__cpp_lib_variant): Define for C++17.
	[__cplusplus >= 201703L] (__cpp_lib_optional): Update value and define
	as long integer.
	* libsupc++/exception (__cpp_lib_uncaught_exceptions): Define as long
	integer.

From-SVN: r267936
2019-01-15 12:01:12 +00:00
Jonathan Wakely
04fdd1fdec * doc/xml/manual/status_cxx2020.xml: Update P1123R0 status.
From-SVN: r267935
2019-01-15 10:34:18 +00:00
Tom de Vries
d41d952c9b [nvptx] Handle assignment to gang-level reduction variable
2019-01-15  Tom de Vries  <tdevries@suse.de>

	PR target/80547
	* config/nvptx/nvptx.c (nvptx_goacc_reduction_init): Handle
	lhs == NULL_TREE for gang-level reduction.

	* testsuite/libgomp.oacc-c-c++-common/gang-reduction-var-assignment.c:
	New test.

From-SVN: r267934
2019-01-15 10:11:16 +00:00
Richard Biener
4882e5bada re PR ipa/88788 (Infinite loop in malloc_candidate_p_1 since r264838)
2019-01-15  Richard Biener  <rguenther@suse.de>
	    Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

	PR ipa/88788
	* ipa-pure-const.c (malloc_candidate_p_1): Add parameter visited and
	return true if SSA_NAME is already marked in visited bitmap.
	(malloc_candidate_p): Pass visited to malloc_candidate_p_1.

Co-Authored-By: Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>

From-SVN: r267933
2019-01-15 09:37:22 +00:00
Paolo Carlini
079a66801b decl.c (start_decl): Improve error location.
/cp
2019-01-15  Paolo Carlini  <paolo.carlini@oracle.com>

	* decl.c (start_decl): Improve error location.
	* decl2.c (grokfield): Likewise.

/testsuite
2019-01-15  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/diagnostic/typedef-initialized.C: New.

/cp
2019-01-15  Paolo Carlini  <paolo.carlini@oracle.com>

	* decl.c (grokdeclarator): Move further up the location_t loc
	declaration and use the location when building a TYPE_DECL for
	a typedef name.
	* decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in the error
	about an ill-formed bit-field as typedef.

/testsuite
2019-01-15  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/diagnostic/bitfld3.C: New.

From-SVN: r267932
2019-01-15 09:36:43 +00:00
Jakub Jelinek
93aa3c4aca re PR tree-optimization/88775 (Optimize std::string assignment)
PR tree-optimization/88775
	* match.pd (cmp (convert1?@2 addr@0) (convert2? addr@1)): Optimize
	equal == 0 equality pointer comparisons some more if compared in
	integral types and either one points to an automatic var and the
	other to a global, or we can prove at least one points to the middle
	or both point to start or both point to end.

	* gcc.dg/tree-ssa/pr88775-1.c: New test.
	* gcc.dg/tree-ssa/pr88775-2.c: New test.

From-SVN: r267931
2019-01-15 09:11:00 +01:00
Andi Kleen
6facd01f98 Lower sampling rate for autofdo bootstrap
autofdo create_gcov uses a lot of memory for large sample files.
Since gcc runs quite long the sample files generated during
the bootstrap are fairly ig.

Currently I can't even build make autoprofiledbootstrap on my system at
home because create_gcov needs more than 12GB and runs out of memory.

This should probably be fixed in create_gcov, but for now
lowering the sampling rate works well enough for me. The bootstrap
run is long enough that it gets good enough data in any case.

gcc/:
2019-01-14  Andi Kleen  <ak@linux.intel.com>

	* Makefile.in: Lower autofdo sampling rate by 10x.
	* Makefile.tpl: Dito.

From-SVN: r267930
2019-01-15 03:49:45 +00:00
GCC Administrator
708efa49eb Daily bump.
From-SVN: r267929
2019-01-15 00:16:22 +00:00
Marek Polacek
f80aa3999d PR c++/88825 - ICE with bogus function return type deduction.
* typeck.c (can_do_nrvo_p): Check error_mark_node.

	* g++.dg/cpp1y/auto-fn55.C: New test.

From-SVN: r267926
2019-01-14 22:01:24 +00:00
Jakub Jelinek
a30d019637 c-cppbuiltin.c (c_cpp_builtin): Define __cpp_guaranteed_copy_elision and __cpp_nontype_template_parameter_auto.
* c-cppbuiltin.c (c_cpp_builtin): Define __cpp_guaranteed_copy_elision
	and __cpp_nontype_template_parameter_auto.  Add a comment that
	__cpp_template_auto is deprecated.

	* g++.dg/cpp1z/feat-cxx1z.C: Add tests for
	__cpp_guaranteed_copy_elision and __cpp_nontype_template_parameter_auto
	feature test macros.
	* g++.dg/cpp2a/feat-cxx2a.C: Likewise.

From-SVN: r267925
2019-01-14 21:12:11 +01:00
Marek Polacek
345364cf7f PR c++/88830 - ICE with abstract class.
* decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR.
	Fix formatting.

	* g++.dg/other/abstract7.C: New test.

From-SVN: r267924
2019-01-14 20:09:10 +00:00
Tom Honermann
2d91f79dc9 Implement P0482R5, char8_t: A type for UTF-8 characters and strings
gcc/cp/
	* cvt.c (type_promotes_to): Handle char8_t promotion.
	* decl.c (grokdeclarator): Handle invalid type specifier
	combinations involving char8_t.
	* lex.c (init_reswords): Add char8_t as a reserved word.
	* mangle.c (write_builtin_type): Add name mangling for char8_t (Du).
	* parser.c (cp_keyword_starts_decl_specifier_p)
	(cp_parser_simple_type_specifier): Recognize char8_t as a simple
	type specifier.
	(cp_parser_string_literal): Use char8_array_type_node for the type
	of CPP_UTF8STRING.
	(cp_parser_set_decl_spec_type): Tolerate char8_t typedefs in system
	headers.
	* rtti.c (emit_support_tinfos): type_info support for char8_t.
	* tree.c (char_type_p): Recognize char8_t as a character type.
	* typeck.c (string_conv_p): Handle conversions of u8 string
	literals of char8_t type.
	(check_literal_operator_args): Handle UDLs with u8 string literals
	of char8_t type.
	* typeck2.c (ordinary_char_type_p): New.
	(digest_init_r): Disallow initializing a char array with a u8 string
	literal.
gcc/c-family/
	* c-common.c (c_common_reswords): Add char8_t.
	(fix_string_type): Use char8_t for the type of u8 string literals.
	(c_common_get_alias_set): char8_t doesn't alias.
	(c_common_nodes_and_builtins): Define char8_t as a builtin type in
	C++.
	(c_stddef_cpp_builtins): Add __CHAR8_TYPE__.
	(keyword_begins_type_specifier): Add RID_CHAR8.
	* c-common.h (rid): Add RID_CHAR8.
	(c_tree_index): Add CTI_CHAR8_TYPE and CTI_CHAR8_ARRAY_TYPE.
	Define D_CXX_CHAR8_T and D_CXX_CHAR8_T_FLAGS.
	Define char8_type_node and char8_array_type_node.
	* c-cppbuiltin.c (cpp_atomic_builtins): Predefine
	__GCC_ATOMIC_CHAR8_T_LOCK_FREE.
	(c_cpp_builtins): Predefine __cpp_char8_t.
	* c-lex.c (lex_string): Use char8_array_type_node as the type of
	CPP_UTF8STRING.
	(lex_charconst): Use char8_type_node as the type of CPP_UTF8CHAR.
	* c-opts.c: If not otherwise specified, enable -fchar8_t when
	targeting C++2a.
	* c.opt: Add the -fchar8_t command line option.
libiberty/
	* cp-demangle.c (cplus_demangle_builtin_types)
	(cplus_demangle_type): Add name demangling for char8_t (Du).
	* cp-demangle.h: Increase D_BUILTIN_TYPE_COUNT to accommodate the
	new char8_t type.

From-SVN: r267923
2019-01-14 14:55:51 -05:00
Martin Sebor
23db6ced33 PR target/88638 - FAIL: fsf-nsstring-format-1.s on darwin
gcc/c-family/ChangeLog:

	PR target/88638
	* c-attribs.c (positional_argument): Call valid_format_string_type_p
	and issue errors if it fails.
	* c-common.h (valid_format_string_type_p): Declare.
	* c-format.c (valid_stringptr_type_p): Rename...
	(valid_format_string_type_p): ...to this and make extern.
	(handle_format_arg_attribute): Adjust to new name.
	(check_format_string): Same.

gcc/testsuite/ChangeLog:

	PR target/88638
	* gcc.dg/format/attr-8.c: New test.
	* gcc.dg/darwin-cfstring-format-1.c: Adjust diagnostics.
	* gcc.dg/format/attr-3.c: Same.
	* obj-c++.dg/fsf-nsstring-format-1.mm: Same.
	* objc.dg/fsf-nsstring-format-1.m: Same.

gcc/ChangeLog:

	PR target/88638
	* doc/extend.texi (Darwin Format Checks): Clarify.

From-SVN: r267922
2019-01-14 11:44:00 -07:00
Martin Liska
15f4e33db7 Fix location of tls_wrapper_fn (PR gcov-profile/88263).
2019-01-14  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/88263
	* decl2.c (get_tls_wrapper_fn): Use DECL_SOURCE_LOCATION
	as location of the TLS wrapper.
2019-01-14  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/88263
	* g++.dg/gcov/pr88263-2.C: New test.

From-SVN: r267921
2019-01-14 18:40:34 +00:00
Martin Sebor
97d4188719 invoke.texi (-Wmemset-transposed-args): Fix typos, adjust wording.
gcc/ChangeLog:

	* invoke.texi (-Wmemset-transposed-args): Fix typos, adjust wording.

From-SVN: r267920
2019-01-14 11:26:32 -07:00
Richard Biener
7cc0fa5de7 genmatch.c (dt_simplify::gen_1): Change dumping dependent on whether we are in (simplify ...) or (match ...) context.
2019-01-14  Richard Biener  <rguenther@suse.de>

	* genmatch.c (dt_simplify::gen_1): Change dumping dependent on
	whether we are in (simplify ...) or (match ...) context.

From-SVN: r267917
2019-01-14 13:11:43 +00:00
Jakub Jelinek
a49a975f0e re PR rtl-optimization/88796 (-fstack-protector* kills RTL DSE opportunities)
PR rtl-optimization/88796
	* emit-rtl.h (struct rtl_data): Add stack_protect_guard_decl field.
	* cfgexpand.c (stack_protect_prologue): Initialize
	crtl->stack_protect_guard_decl.
	* function.c (stack_protect_epilogue): Use it instead of calling
	targetm.stack_protect_guard again.
	* dse.c (check_mem_read_rtx): Ignore MEM_VOLATILE_P reads from
	MEMs with MEM_EXPR equal to crtl->stack_protect_guard or
	crtl->stack_protect_guard_decl.
	* config/i386/i386.c (ix86_stack_protect_guard): Set TREE_THIS_VOLATILE
	on the returned MEM_EXPR.

	* gcc.target/i386/pr88796.c: New test.

From-SVN: r267916
2019-01-14 13:01:01 +01:00
Jakub Jelinek
7227b597ac Undo undesirable part of r267850 2019-01-11 commit.
From-SVN: r267914
2019-01-14 11:47:09 +01:00
Iain Buclaw
2b5e01fa09 [D] Merge upstream dmd cd2034cd7
One fix in the asm statement parser to stop parsing if the end of the
statement has been reached, and moves all inline asm tests to gdc.dg.
These being adjusted where necessary to test the GCC style instead.

gcc/testsuite/ChangeLog:

2019-01-14  Iain Buclaw  <ibuclaw@gdcproject.org>

	* gdc.dg/asm1.d: New test.
	* gdc.dg/asm2.d: New test.
	* gdc.dg/asm3.d: New test.
	* gdc.dg/asm4.d: New test.
	* lib/gdc.exp (gdc_init): Set gcc_error_prefix and gcc_warning_prefix.

From-SVN: r267913
2019-01-14 10:38:00 +00:00
Jerry DeLisle
9c5f89006f re PR libfortran/88776 (Namelist read from stdin: loss of data)
2019-01-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/88776
	* io/open.c (newunit): Free format buffer if the unit specified is for
	stdin, stdout, or stderr.

	* gfortran.dg/namelist_96.f90: New test.

From-SVN: r267910
2019-01-14 00:22:00 +00:00
GCC Administrator
bff1a7315d Daily bump.
From-SVN: r267909
2019-01-14 00:16:12 +00:00