Jonathan Wakely [Wed, 8 Aug 2018 15:40:26 +0000 (16:40 +0100)]
PR libstdc++/60555 std::system_category() should recognise POSIX errno values
Backport from mainline
2018-08-03 Jonathan Wakely <jwakely@redhat.com>
* src/c++11/system_error.cc
(system_error_category::default_error_condition): Add workaround for
ENOTEMPTY and EEXIST having the same value on AIX.
* testsuite/19_diagnostics/error_category/system_category.cc: Add
extra testcases for EDOM, EILSEQ, ERANGE, EEXIST and ENOTEMPTY.
Backport from mainline
2018-08-01 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/60555
* src/c++11/system_error.cc
(system_error_category::default_error_condition): New override to
check for POSIX errno values.
* testsuite/19_diagnostics/error_category/generic_category.cc: New
* testsuite/19_diagnostics/error_category/system_category.cc: New
test.
Jonathan Wakely [Wed, 8 Aug 2018 15:40:17 +0000 (16:40 +0100)]
Fix std::codecvt_utf8<wchar_t> for Mingw
Backport from mainline
2018-05-19 Jonathan Wakely <jwakely@redhat.com>
* src/c++11/codecvt.cc (__codecvt_utf8_base<wchar_t>::do_in)
[__SIZEOF_WCHAR_T__==2 && __BYTE_ORDER__!=__ORDER_BIG_ENDIAN__]: Set
little_endian element in bitmask.
* testsuite/22_locale/codecvt/codecvt_utf8/69703.cc: Run all tests.
* testsuite/22_locale/codecvt/codecvt_utf8/wchar_t/1.cc: New.
Jonathan Wakely [Wed, 8 Aug 2018 15:40:11 +0000 (16:40 +0100)]
PR libstdc++/66145 allow catching iostream errors as cxx11 ios::failure
Define a new exception type derived from the gcc4-compatible ios::failure
which also aggregates an object of the ios::failure[abi:cxx11] type.
Make __throw_ios_failure throw this new type for iostream errors
that raise exceptions. Provide custom type info for the new type so that
it can be caught by handlers for ios::failure[abi:cxx11] type
as well as handlers for the gcc4-compatible ios::failure and its bases.
Backport from mainline
2018-04-10 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/85222
* src/c++11/cxx11-ios_failure.cc (__construct_ios_failure)
(__destroy_ios_failure, is_ios_failure_handler): New functions.
* src/c++11/ios.cc (__throw_ios_failure): Remove definition.
(_GLIBCXX_USE_CXX11_ABI): Don't define here.
* src/c++98/Makefile.am [ENABLE_DUAL_ABI]: Add special rules for
ios_failure.cc to rewrite type info for __ios_failure.
* src/c++98/Makefile.in: Regenerate.
* src/c++98/ios_failure.cc [_GLIBCXX_USE_DUAL_ABI]
(__iosfailure, __iosfailure_type_info): New types.
(__throw_ios_failure): Define here.
* testsuite/27_io/ios_base/failure/dual_abi.cc: New.
* testsuite/27_io/basic_ios/copyfmt/char/1.cc: Revert changes to
add -D_GLIBCXX_USE_CXX11_ABI=0 to dg-options.
* testsuite/27_io/basic_ios/exceptions/char/1.cc: Likewise.
* testsuite/27_io/basic_istream/extractors_arithmetic/char/
exceptions_failbit.cc: Likewise.
* testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/
exceptions_failbit.cc: Likewise.
* testsuite/27_io/basic_istream/extractors_other/char/
exceptions_null.cc: Likewise.
* testsuite/27_io/basic_istream/extractors_other/wchar_t/
exceptions_null.cc: Likewise.
* testsuite/27_io/basic_istream/sentry/char/12297.cc: Likewise.
* testsuite/27_io/basic_istream/sentry/wchar_t/12297.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_other/char/
exceptions_null.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_other/wchar_t/
exceptions_null.cc: Likewise.
* testsuite/27_io/ios_base/storage/2.cc: Likewise.
Backport from mainline
PR target/84168
2017-09-28 Joseph Myers <joseph@codesourcery.com>
* config/aarch64/aarch64.c (aarch64_elf_asm_constructor)
(aarch64_elf_asm_destructor): Pass SECTION_NOTYPE to get_section
when creating .init_array and .fini_array sections with priority
specified.
Kelvin Nilsen [Tue, 26 Jun 2018 17:24:54 +0000 (17:24 +0000)]
backport: rs6000-c.c (altivec_overloaded_builtins): Change behavior of vec_packsu (vector unsigned long long...
gcc/ChangeLog:
2018-06-26 Kelvin Nilsen <kelvin@gcc.gnu.org>
Backported from mainline
2018-06-20 Kelvin Nilsen <kelvin@gcc.gnu.org>
* config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Change
behavior of vec_packsu (vector unsigned long long, vector unsigned
long long) to match behavior of vec_packs with same signature.
gcc/testsuite/ChangeLog:
2018-06-26 Kelvin Nilsen <kelvin@gcc.gnu.org>
Backported from mainline
2018-06-20 Kelvin Nilsen <kelvin@gcc.gnu.org>
* gcc.target/powerpc/builtins-1.c: Add dg directive to scan
for vpkudus.
Jakub Jelinek [Mon, 25 Jun 2018 17:55:15 +0000 (19:55 +0200)]
re PR target/84786 ([miscompilation] vunpcklpd accessing xmm16-22 targeting KNL)
PR target/84786
* config/i386/sse.md (vshift_count): New mode attr.
(<shift_insn><mode>3<mask_name>): Use <vshift_count>N instead of vN
as last operand's constraint for VI2_AVX2_AVX512BW shifts. Use YvN
instead of vN as last operand's constraint for VI48_AVX2 shifts.
Jakub Jelinek [Mon, 25 Jun 2018 17:53:50 +0000 (19:53 +0200)]
backport: re PR tree-optimization/86231 (vrp_meet causes wrong-code)
Backported from mainline
2018-06-20 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/86231
* tree-vrp.c (union_ranges): For ( [ ) ] or ( )[ ] range and
anti-range don't overwrite *vr0min before using it to compute *vr0max.
* gcc.dg/tree-ssa/vrp119.c: New test.
* gcc.c-torture/execute/pr86231.c: New test.
Jakub Jelinek [Mon, 25 Jun 2018 17:48:47 +0000 (19:48 +0200)]
backport: re PR rtl-optimization/85431 (UBSAN: ../../gcc/dse.c:303:15: runtime error: shift exponent 64 is too large for 64-bit type 'long unsigned int')
Backported from mainline
2018-04-17 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/85431
* dse.c (record_store): Ignore zero width stores.
Jakub Jelinek [Mon, 25 Jun 2018 17:47:56 +0000 (19:47 +0200)]
backport: re PR rtl-optimization/85300 (ICE in exact_int_to_float_conversion_p, at simplify-rtx.c:895)
Backported from mainline
2018-04-10 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/85300
* combine.c (subst): Handle subst of CONST_SCALAR_INT_P new_rtx also
into FLOAT and UNSIGNED_FLOAT like ZERO_EXTEND, return a CLOBBER if
simplify_unary_operation fails.
Jakub Jelinek [Mon, 25 Jun 2018 17:45:48 +0000 (19:45 +0200)]
backport: re PR tree-optimization/85257 (wrong code with -O -fno-tree-ccp and reading zeroed vector member)
Backported from mainline
2018-04-07 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/85257
* fold-const.c (native_encode_vector): If not all elts could fit
and off is -1, return 0 rather than offset.
* tree-ssa-sccvn.c (vn_reference_lookup_3): Pass
(offset - offset2) / BITS_PER_UNIT as 4th argument to
native_encode_expr. Verify len * BITS_PER_UNIT >= maxsizei. Don't
adjust buffer in native_interpret_expr call.
Jakub Jelinek [Mon, 25 Jun 2018 17:41:34 +0000 (19:41 +0200)]
backport: re PR c++/84791 (ICE with broken OpenMP reduction clause)
Backported from mainline
2018-03-30 Jakub Jelinek <jakub@redhat.com>
PR c++/84791
* semantics.c (finish_omp_reduction_clause): If
OMP_CLAUSE_REDUCTION_PLACEHOLDER is error_mark_node, return true
even if processing_template_decl.
Jakub Jelinek [Mon, 25 Jun 2018 17:37:02 +0000 (19:37 +0200)]
backport: re PR inline-asm/84941 (internal compiler error: in reg_overlap_mentioned_p, at rtlanal.c:1870 (reg_overlap_mentioned_p()/match_asm_constraints_1()))
Backported from mainline
2018-03-22 Jakub Jelinek <jakub@redhat.com>
PR inline-asm/84941
* function.c (match_asm_constraints_1): Don't do the optimization
if input isn't a REG, SUBREG, MEM or constant.
Jakub Jelinek [Mon, 25 Jun 2018 17:34:55 +0000 (19:34 +0200)]
backport: re PR target/84899 (ICE: in final_scan_insn_1, at final.c:3139 (error: could not split insn))
Backported from mainline
2018-03-16 Jakub Jelinek <jakub@redhat.com>
PR target/84899
* postreload.c (reload_combine_recognize_pattern): Perform
INTVAL addition in unsigned HOST_WIDE_INT type to avoid UB and
truncate_int_for_mode the result for the destination's mode.
Jakub Jelinek [Mon, 25 Jun 2018 17:32:10 +0000 (19:32 +0200)]
backport: re PR c++/84222 ([[deprecated]] class complains about internal class usage)
Backported from mainline
2018-03-15 Jakub Jelinek <jakub@redhat.com>
PR c++/84222
* cp-tree.h (cp_warn_deprecated_use): Declare.
* tree.c (cp_warn_deprecated_use): New function.
* typeck2.c (build_functional_cast): Use it.
* decl.c (grokparms): Likewise.
(grokdeclarator): Likewise. Temporarily push nested class scope
around grokparms call for out of class member definitions.
* g++.dg/warn/deprecated.C (T::member3): Change dg-warning to dg-bogus.
* g++.dg/warn/deprecated-6.C (T::member3): Likewise.
* g++.dg/warn/deprecated-13.C: New test.
Jakub Jelinek [Mon, 25 Jun 2018 17:31:23 +0000 (19:31 +0200)]
backport: re PR target/84772 (powerpc-spe: Spurious "is used uninitialized" warning, or possibly incorrect codegen for va_arg(long double))
Backported from mainline
2018-03-09 Jakub Jelinek <jakub@redhat.com>
PR target/84772
* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Mark va_arg_tmp
temporary TREE_ADDRESSABLE before gimplification of BUILT_IN_MEMCPY.
Jakub Jelinek [Mon, 25 Jun 2018 17:30:03 +0000 (19:30 +0200)]
backport: re PR c++/84076 (Warning about objects through POD mistakenly claims the object is a pointer)
Backported from mainline
2018-03-09 Jason Merrill <jason@redhat.com>
Jakub Jelinek <jakub@redhat.com>
PR c++/84076
* call.c (convert_arg_to_ellipsis): Instead of cp_build_addr_expr
build ADDR_EXPR with REFERENCE_TYPE.
(build_over_call): For purposes of check_function_arguments, if
argarray[j] is ADDR_EXPR with REFERENCE_TYPE created above, use
its operand rather than the argument itself.
Jakub Jelinek [Mon, 25 Jun 2018 17:28:32 +0000 (19:28 +0200)]
backport: re PR tree-optimization/84739 (ICE in get_value_for_expr, at tree-ssa-ccp.c:649)
Backported from mainline
2018-03-08 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/84739
* tree-tailcall.c (find_tail_calls): Check call arguments against
DECL_ARGUMENTS (current_function_decl) rather than
DECL_ARGUMENTS (func) when checking for tail recursion.
Jakub Jelinek [Mon, 25 Jun 2018 17:27:47 +0000 (19:27 +0200)]
backport: re PR target/84700 (ICE on 32-bit BE powerpc targets w/ -misel -O1)
Backported from mainline
2018-03-05 Jakub Jelinek <jakub@redhat.com>
PR target/84700
* combine.c (combine_simplify_rtx): Don't try to simplify if
if_then_else_cond returned non-NULL, but either true_rtx or false_rtx
are equal to x.
Jakub Jelinek [Mon, 25 Jun 2018 17:26:53 +0000 (19:26 +0200)]
backport: re PR c++/84662 (internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in is_bitfield_expr_with_lowered_type, at cp/typeck.c:1944)
Backported from mainline
2018-03-02 Jakub Jelinek <jakub@redhat.com>
PR c++/84662
* pt.c (tsubst_copy_and_build) <case TEMPLATE_ID_EXPR>: Use
RETURN instead of return.
<case POINTER_PLUS_EXPR>: Likewise.
<case CONVERT_EXPR>: If op0 is error_mark_node, just return
it instead of wrapping it into CONVERT_EXPR.
Jakub Jelinek [Mon, 25 Jun 2018 17:25:41 +0000 (19:25 +0200)]
backport: re PR inline-asm/84625 (ICE with empty constraint and vector constant)
Backported from mainline
2018-03-02 Jakub Jelinek <jakub@redhat.com>
PR inline-asm/84625
* config/i386/i386.c (ix86_print_operand): Use conditional
output_operand_lossage instead of gcc_assert if CONST_VECTOR is not
zero vector.
Jakub Jelinek [Mon, 25 Jun 2018 17:23:21 +0000 (19:23 +0200)]
backport: re PR c++/84448 (ICE with broken condition in parallel for loop)
Backported from mainline
2018-02-19 Jakub Jelinek <jakub@redhat.com>
PR c++/84448
* parser.c (cp_parser_binary_expression): For no_toplevel_fold_p, if
either operand is error_mark_node, set current.lhs to that instead of
creating a binary op with error_mark_node operands.
Jakub Jelinek [Mon, 25 Jun 2018 17:21:47 +0000 (19:21 +0200)]
backport: re PR c/82210 (Having _Alignas in a struct with VLAs causes writing to one array to overwrite another)
Backported from mainline
2018-02-13 Jakub Jelinek <jakub@redhat.com>
PR c/82210
* stor-layout.c (place_field): For variable length fields, adjust
offset_align afterwards not just based on the field's alignment,
but also on the size.