platform/upstream/gcc.git
6 years agoDisable auto_is_implicit_function_template_parm_p while parsing attributes
Alexandre Oliva [Fri, 23 Mar 2018 01:18:48 +0000 (01:18 +0000)]
Disable auto_is_implicit_function_template_parm_p while parsing attributes

We don't want functions to become implicit templates just because of
random uses of auto in unexpected places.  Disabling the special
handling of auto while parsing attributes, for example, makes for
more sensible errors.

for  gcc/cp/ChangeLog

PR c++/84610
PR c++/84642
PR c++/84942
* cp-tree.h (temp_override): New template class, generalizing
a cleanup that was only used...
* parser.c (cp_parser_parameter_declaration_clause):
... here for auto_is_implicit_function_template_parm_p.
(cp_parser_gnu_attributes_opt): Use it here as well.
(cp_parser_std_attribute): Likewise.

From-SVN: r258790

6 years agoDaily bump.
GCC Administrator [Fri, 23 Mar 2018 00:16:19 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r258789

6 years agore PR fortran/84922 (fortran reports inconsistency in rank of arguments in interface...
Steven G. Kargl [Thu, 22 Mar 2018 21:42:07 +0000 (21:42 +0000)]
re PR fortran/84922 (fortran reports inconsistency in rank of arguments in interface and contained procedures)

2018-03-22  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/84922
* decl.c (get_proc_name): If the MODULE prefix appears in interface
body, then it must appear on the contained subroutine or function.
While here, fix nearby mis-indented code.

2018-03-22  Steven G. Kargl  <kargl@gcc.gnu.org

PR fortran/84922
* gfortran.dg/interface_42.f90: New test.
* gfortran.dg/interface_43.f90: New test.

From-SVN: r258784

6 years agors6000-builtin.def: Remove various BU_ALTIVEC_X macro expansions for definition of...
Kelvin Nilsen [Thu, 22 Mar 2018 20:18:35 +0000 (20:18 +0000)]
rs6000-builtin.def: Remove various BU_ALTIVEC_X macro expansions for definition of...

gcc/ChangeLog:

2018-03-22  Kelvin Nilsen  <kelvin@gcc.gnu.org>

* config/rs6000/rs6000-builtin.def: Remove various BU_ALTIVEC_X
macro expansions for definition of ST_INTERNAL_<mode> and
LD_INTERNAL_<mode> builtins.
* config/rs6000/rs6000-protos.h (rs6000_address_for_altivec):
Remove prototype.
* config/rs6000/rs6000.c (altivec_expand_ld_builtin): Delete this
function.
(altivec_expand_st_builtin): Likewise.
(altivec_expand_builtin): Remove calls to deleted functions.
(rs6000_address_for_altivec): Delete this function.
* config/rs6000/vector.md: Remove expands for
vector_altivec_load_<mode> and vector_altivec_store_<mode>.

From-SVN: r258783

6 years ago[ARM][PR target/84826] Fix ICE in extract_insn, at recog.c:2304 on
Sudakshina Das [Thu, 22 Mar 2018 17:24:41 +0000 (17:24 +0000)]
[ARM][PR target/84826] Fix ICE in extract_insn, at recog.c:2304 on
arm-linux-gnueabi

The ICE in the bug report was happening because the macro
USE_RETURN_INSN (FALSE) was returning different values at different points
in the compilation. This was internally occurring because the function
arm_compute_static_chain_stack_bytes () which was dependent on
arm_r3_live_at_start_p () was giving a different value after the cond_exec
instructions were created in ce3 causing the liveness of r3 to escape up
to the start block.

The function arm_compute_static_chain_stack_bytes () should really only
compute the value once duringepilogue/prologue stage. This pass introduces
a new member 'static_chain_stack_bytes' to the target definition of the
struct machine_function which gets calculated in expand_prologue and is the
value that is returned by arm_compute_static_chain_stack_bytes () beyond that.

ChangeLog entries:

*** gcc/ChangeLog ***

2018-03-22  Sudakshina Das  <sudi.das@arm.com>

PR target/84826
* config/arm/arm.h (machine_function): Add static_chain_stack_bytes.
* config/arm/arm.c (arm_compute_static_chain_stack_bytes): Avoid
re-computing once computed.
(arm_expand_prologue): Compute machine->static_chain_stack_bytes.
(arm_init_machine_status): Initialize
machine->static_chain_stack_bytes.

*** gcc/testsuite/ChangeLog ***

2018-03-22  Sudakshina Das  <sudi.das@arm.com>

PR target/84826
* gcc.target/arm/pr84826.c: New test.

From-SVN: r258777

6 years ago[testsuite] Make sure dg-do is before dg-require-effective-target.
Christophe Lyon [Thu, 22 Mar 2018 16:39:36 +0000 (16:39 +0000)]
[testsuite] Make sure dg-do is before dg-require-effective-target.

2018-03-22  Christophe Lyon  <christophe.lyon@linaro.org>

gcc/testsuite/
* gcc.target/arm/addr-modes-float.c: Move dg-do before
dg-require-effective-target.
* gcc.target/arm/addr-modes-int.c: Likewise.
* gcc.target/nios2/lo-addr-tls.c: Likewise.

From-SVN: r258776

6 years agore PR target/84760 (Finish implementation of __builtin_altivec_lvx_v1ti)
Kelvin Nilsen [Thu, 22 Mar 2018 15:42:39 +0000 (15:42 +0000)]
re PR target/84760 (Finish implementation of __builtin_altivec_lvx_v1ti)

gcc/ChangeLog:

2018-03-22  Kelvin Nilsen  <kelvin@gcc.gnu.org>

PR target/84760
* doc/extend.texi: Add four new prototypes for vec_ld.
* config/rs6000/rs6000-builtin.def (LVX_V1TI): Reorder symbol
definitions for more logical presentation.
* config/rs6000/rs6000-c.c: (altivec_overloaded_builtins): Add
entries for V1TI variants of __builtin_altivec_ld builtin.
* config/rs6000/rs6000.c: (altivec_expand_lv_builtin): Add test and
handling of V1TI variant of LVX icode pattern.
(altivec_expand_builtin): Add case for ALTIVEC_BUILTIN_LVX_V1TI.
(rs6000_gimple_fold_builtin): Likewise.
(altivec_init_builtins): Add code to define
__builtin_altivec_lvx_v1ti function.

gcc/testsuite/ChangeLog:

2018-03-22  Kelvin Nilsen  <kelvin@gcc.gnu.org>

PR target/84760
* gcc.target/powerpc/altivec-ld-1.c: New test.

From-SVN: r258774

6 years agoPR libstdc++/85040 fix std::less<void> etc. ambiguities
Jonathan Wakely [Thu, 22 Mar 2018 14:23:27 +0000 (14:23 +0000)]
PR libstdc++/85040 fix std::less<void> etc. ambiguities

PR libstdc++/85040
* include/bits/stl_function.h (greater::__not_overloaded)
(less::__not_overloaded, greater_equal::__not_overloaded)
(less_equal::__not_overloaded): Fix ambiguous specializations.
* testsuite/20_util/function_objects/comparisons_pointer.cc: Add
tests for type with overlaoded operators.

From-SVN: r258773

6 years agopr83126.c: Require pthread for the test.
Bin Cheng [Thu, 22 Mar 2018 14:06:49 +0000 (14:06 +0000)]
pr83126.c: Require pthread for the test.

gcc/testsuite
* gcc.dg/graphite/pr83126.c: Require pthread for the test.

From-SVN: r258768

6 years agoxfail experimental/memory_resource/resource_adaptor.cc on 32-bit Solaris/x86 (PR...
Rainer Orth [Thu, 22 Mar 2018 13:33:29 +0000 (13:33 +0000)]
xfail experimental/memory_resource/resource_adaptor.cc on 32-bit Solaris/x86 (PR libstdc++/77691)

PR libstdc++/77691
* testsuite/experimental/memory_resource/resource_adaptor.cc:
xfail execution on 32-bit Solaris/x86.

From-SVN: r258766

6 years agore PR inline-asm/84941 (internal compiler error: in reg_overlap_mentioned_p, at rtlan...
Jakub Jelinek [Thu, 22 Mar 2018 12:31:46 +0000 (13:31 +0100)]
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()))

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.

* gcc.dg/pr84941.c: New test.

From-SVN: r258764

6 years agoFix PR85025: libgcc/config/i386/shadow-stack-unwind.h is wrong.
Igor Tsimbalist [Thu, 22 Mar 2018 11:22:31 +0000 (12:22 +0100)]
Fix PR85025: libgcc/config/i386/shadow-stack-unwind.h is wrong.

PR target/85025
* config/i386/shadow-stack-unwind.h (_Unwind_Frames_Extra):
Fix a typo, tmp => 255.

From-SVN: r258763

6 years ago[tail-merge] Don't merge bbs with bb_has_abnormal_pred
Tom de Vries [Thu, 22 Mar 2018 10:21:12 +0000 (10:21 +0000)]
[tail-merge] Don't merge bbs with bb_has_abnormal_pred

2018-03-22  Tom de Vries  <tom@codesourcery.com>

PR tree-optimization/84956
* tree-ssa-tail-merge.c (find_clusters_1): Skip bbs with
bb_has_abnormal_pred.

* gcc.dg/pr84956.c: New test.

From-SVN: r258758

6 years agore PR sanitizer/85018 (Many sanitizer tests ICE since r258681)
Jakub Jelinek [Thu, 22 Mar 2018 08:32:12 +0000 (09:32 +0100)]
re PR sanitizer/85018 (Many sanitizer tests ICE since r258681)

PR sanitizer/85018
* dwarf2asm.c (dw2_output_indirect_constant_1): Set
DECL_INITIAL (decl) to decl at the end.
* varasm.c (use_blocks_for_decl_p): Revert the 2018-03-20 change,
adjust the comment.

From-SVN: r258757

6 years agore PR c++/84854 (ICE: unexpected expression in cxx_eval_constant_expression, at cp...
Marek Polacek [Thu, 22 Mar 2018 08:08:07 +0000 (08:08 +0000)]
re PR c++/84854 (ICE: unexpected expression in cxx_eval_constant_expression, at cp/constexpr.c:4774)

PR c++/84854
* semantics.c (finish_if_stmt_cond): Check if the type of the condition
is boolean.

* g++.dg/cpp1z/constexpr-if15.C: New test.
* g++.dg/cpp1z/constexpr-if16.C: New test.

From-SVN: r258756

6 years agoPR c++/81311 - wrong C++17 overload resolution.
Jason Merrill [Thu, 22 Mar 2018 03:53:19 +0000 (23:53 -0400)]
PR c++/81311 - wrong C++17 overload resolution.

* call.c (build_user_type_conversion_1): Remove C++17 code.
(conv_binds_ref_to_prvalue): New.
(build_over_call): Handle C++17 copy elision.
(build_special_member_call): Only do C++17 copy elision here if the
argument is already the right type.

From-SVN: r258755

6 years agoDaily bump.
GCC Administrator [Thu, 22 Mar 2018 00:16:17 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r258754

6 years agoAdjust __builtin_tgmath handling of integer arguments to _FloatN narrowing macros.
Joseph Myers [Wed, 21 Mar 2018 22:29:37 +0000 (22:29 +0000)]
Adjust __builtin_tgmath handling of integer arguments to _FloatN narrowing macros.

When adding __builtin_tgmath to support a better tgmath.h
implementation, I noted that further changes might be needed regarding
the TS 18661 functions that round their results to a narrower type,
because of unresolved issues with how the corresponding type-generic
macros are defined in TS 18661.

The resolution of those issues is still in flux, but the latest
version does indeed require something slightly different from
__builtin_tgmath.  It specifies that integer arguments to type-generic
macros such as f32xadd are treated as _Float64 not double - which was
also present in earlier versions of the resolution - but then it also
specifies different handling for _Float64 arguments and double
arguments, which wasn't in earlier versions.  Specifically, in the
latest version
<http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2213.pdf>, f32xadd
with _Float64 arguments would call f32xaddf64, while f32xadd with
double arguments would call f32xaddf64x.  Since integer arguments are
converted directly to the argument type of the selected function (not
to double / _Float64x unless that ends up as the argument type), this
is a user-visible difference in semantics that means __builtin_tgmath
actually needs to implement treating integer arguments as _Float64 in
this case (the rest of the latest semantics can then be implemented in
the header, with a few inline functions there).

To avoid releasing with the older version of the __builtin_tgmath
semantics that doesn't work with the latest proposed DR#13 resolution,
this patch implements a rule in __builtin_tgmath that maps integer
types to _Float64 (respectively _Complex _Float64 for complex integer
types) where all the specified functions return the same _FloatN or
_FloatNx type.  This does not affect any existing uses of
__builtin_tgmath in glibc's or GCC's tgmath.h since I haven't yet
added any of these type-generic macros to glibc when adding the
corresponding narrowing functions.

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

* doc/extend.texi (__builtin_tgmath): Document when complex
integer types are treated as _Complex _Float64.

gcc/c:
* c-parser.c (c_parser_postfix_expression): For __builtin_tgmath
where all functions return the same _FloatN or _FloatNx type,
treat integer types as _Float64 instead of double.

gcc/testsuite:
* gcc.dg/builtin-tgmath-3.c: New test.

From-SVN: r258751

6 years ago[doc] Remove pasto in __builtin_extend_pointer doc
Tom de Vries [Wed, 21 Mar 2018 22:24:04 +0000 (22:24 +0000)]
[doc] Remove pasto in __builtin_extend_pointer doc

2018-03-21  Tom de Vries  <tom@codesourcery.com>

* doc/extend.texi (__builtin_extend_pointer): Remove pasto.

From-SVN: r258750

6 years ago[PR c++/71965] silence multi-dim array init sorry without tf_error
Alexandre Oliva [Wed, 21 Mar 2018 22:08:34 +0000 (22:08 +0000)]
[PR c++/71965] silence multi-dim array init sorry without tf_error

We shouldn't substitute templates into short-circuited-out concepts
constraints, but we do, and to add insult to injury, we issue a
sorry() error when a concept that shouldn't even have been substituted
attempts to perform a multi-dimensional array initialization with a
new{} expression.

Although fixing the requirements short-circuiting is probably too
risky at this point, we can get closer to the intended effect by
silencing that sorry just as we silence other errors.

for  gcc/cp/ChangeLog

PR c++/71965
* init.c (build_vec_init): Silence error, former sorry,
without tf_error.

for  gcc/testsuite/ChangeLog

PR c++/71965
* g++.dg/concepts/pr71965.C: New.

From-SVN: r258749

6 years ago[PR c++/84610,84642] recover from implicit template parms gracefully
Alexandre Oliva [Wed, 21 Mar 2018 22:08:19 +0000 (22:08 +0000)]
[PR c++/84610,84642] recover from implicit template parms gracefully

If we get a parse error during an attempted fully implicit function
template parse, and need to skip to the end of the statement or block,
we may discard the function parms scope rather than the enclosing
injected implicit template parms scope.  If we rollback a tentative
parse and try something else, we'll no longer be in a function parms
scope, but rather in a template parms scope, but we may still attempt
to synthesize implicit template parms and then fail the assert that
checks we're in a function parms scope.

This patch introduces an alternative to
finish_fully_implicit_template_p, to be used during error recovery,
that floats the implicit template parm scope to the top so that it
gets discarded as we finish and discard the failed implicit template
data, while other scopes are retained as expected.  It also clears the
implicit template parser data as we finish the template, so that it
doesn't linger on referencing discarded or used scopes and parms.

for gcc/cp/ChangeLog

PR c++/84610
PR c++/84642
* parser.c (abort_fully_implicit_template_p): New.
(cp_parser_skip_to_end_of_statement): Use it.
(cp_parser_skip_to_end_of_block_or_statement): Likewise.
(finish_fully_implicit_template_p): Clear
implicit_template_parms and implicit_template_scope.

for  gcc/testsuite/ChangeLog

PR c++/84610
PR c++/84642
* g++.dg/cpp0x/pr84610.C: New.
* g++.dg/cpp0x/pr84642.C: New.

From-SVN: r258748

6 years agore PR c/84999 (ICE in make_vector_type, at tree.c:9561)
Jakub Jelinek [Wed, 21 Mar 2018 21:48:47 +0000 (22:48 +0100)]
re PR c/84999 (ICE in make_vector_type, at tree.c:9561)

PR c/84999
* c-typeck.c (build_binary_op): If c_common_type_for_size fails when
building vector comparison, diagnose it and return error_mark_node.

* c-c++-common/pr84999.c: New test.

From-SVN: r258747

6 years agore PR c++/84972 (ICE: tree check: expected class 'type', have 'exceptional' (error_ma...
Paolo Carlini [Wed, 21 Mar 2018 21:19:03 +0000 (21:19 +0000)]
re PR c++/84972 (ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in extended_tree, at tree.h:5545)

/cp
2018-03-21  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/84972
* decl.c (maybe_deduce_size_from_array_init): Set TREE_TYPE to
error_mark_node when check_array_designated_initializer fails.

/testsuite
2018-03-21  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/84972
* g++.dg/ext/desig10.C: New.

From-SVN: r258746

6 years agore PR fortran/84957 (ICE in gfc_sym_type, at fortran/trans-types.c:2255)
Thomas Koenig [Wed, 21 Mar 2018 21:12:41 +0000 (21:12 +0000)]
re PR fortran/84957 (ICE in gfc_sym_type, at fortran/trans-types.c:2255)

2018-03-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
Harald Anlauf  <anlauf@gmx.de>

PR fortran/84957
* trans-types.c (gfc_sym_type): Do not dereference NULL pointer.

2018-03-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
Harald Anlauf  <anlauf@gmx.de>

PR fortran/84957
* gfortran.dg/pr84957.f90: New test.

Co-Authored-By: Harald Anlauf <anlauf@gmx.de>
From-SVN: r258745

6 years agore PR tree-optimization/84960 (ICE in GIMPLE pass: isolate-paths)
Jakub Jelinek [Wed, 21 Mar 2018 20:53:16 +0000 (21:53 +0100)]
re PR tree-optimization/84960 (ICE in GIMPLE pass: isolate-paths)

PR tree-optimization/84960
* tree-cfg.c (remove_bb): Don't move forced labels into bb->prev_bb
if it is ENTRY block, move them into single succ of ENTRY in that case.

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

From-SVN: r258744

6 years agopoly_span_traits fixes (PR 84811)
Richard Sandiford [Wed, 21 Mar 2018 20:52:15 +0000 (20:52 +0000)]
poly_span_traits fixes (PR 84811)

This patch fixes incorrect results for HOST_WIDE_INT positions
at opposite extremes when used with HOST_WIDE_INT sizes.  It also
fixes UB when comparing such positions with unsigned HOST_WIDE_INT
sizes (although the results in that case were wrapv-correct).

2018-03-20  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
PR tree-optimization/84811
* poly-int.h (poly_span_traits): Remove the T3 parameter and
promote HOST_WIDE_INT T2 - T1 results to unsigned HOST_WIDE_INT.
(maybe_in_range_p, known_in_range_p, ranges_known_overlap_p):
(known_subrange_p): Update accordingly.  Cast each value involved
in the size comparison, rather than casting the result of the
subtraction.

gcc/testsuite/
PR tree-optimization/84811
* gcc.dg/torture/pr84811.c: New test.

From-SVN: r258743

6 years agore PR tree-optimization/84982 (logically inverting bools into local array results...
Jakub Jelinek [Wed, 21 Mar 2018 20:20:40 +0000 (21:20 +0100)]
re PR tree-optimization/84982 (logically inverting bools into local array results in bitwise negation)

PR tree-optimization/84982
* gimple-ssa-store-merging.c (invert_op): Handle boolean inversion
by flipping the least significant bit rather than all bits from
bitpos to bitpos + bitsize - 1.

* c-c++-common/pr84982.c: New test.

From-SVN: r258742

6 years agore PR c++/84961 (ICE error: SSA_NAME_DEF_STMT is wrong)
Jakub Jelinek [Wed, 21 Mar 2018 20:19:33 +0000 (21:19 +0100)]
re PR c++/84961 (ICE error: SSA_NAME_DEF_STMT is wrong)

PR c++/84961
* cp-tree.h (genericize_compound_lvalue): Declare.
* typeck.c (genericize_compound_lvalue): New function.
(unary_complex_lvalue, cp_build_modify_expr): Use it.
* semantics.c (finish_asm_stmt): Replace MODIFY_EXPR, PREINCREMENT_EXPR
and PREDECREMENT_EXPR in output and "m" constrained input operands with
COMPOUND_EXPR.  Call cxx_mark_addressable on the rightmost
COMPOUND_EXPR operand.

* c-c++-common/pr43690.c: Don't expect errors on "m" (--x) and
"m" (++x) in C++.
* g++.dg/torture/pr84961-1.C: New test.
* g++.dg/torture/pr84961-2.C: New test.

From-SVN: r258741

6 years ago[PR c++/85008] ICE looking for clone
Nathan Sidwell [Wed, 21 Mar 2018 19:22:10 +0000 (19:22 +0000)]
[PR c++/85008] ICE looking for clone

https://gcc.gnu.org/ml/gcc-patches/2018-03/msg01129.html
PR c++/85008
* tree.c (decl_linkage): Use DECL_CLONED_FUNCTION_P.
* decl2.c (vague_linkage_p): Likewise.

PR c++/85008
* g++.dg/pr85008.C: New.

From-SVN: r258738

6 years agoPR 84615 Regressions due to type mismatch with character functions
Janne Blomqvist [Wed, 21 Mar 2018 18:46:44 +0000 (20:46 +0200)]
PR 84615 Regressions due to type mismatch with character functions

Since the kind of the hidden character length variable is not part of
the character variable definition, we must ensure that character
lengths are always of the same kind in interfaces, regardless of how
they were declared in the source. This patch ensures this when calling
a procedure.

Regtested on x86_64-pc-linux-gnu and i686-pc-linux-gnu.

gcc/fortran/ChangeLog:

2018-03-21  Janne Blomqvist  <jb@gcc.gnu.org>

PR fortran/84615
* trans-expr.c (gfc_conv_procedure_call): Convert charlen to
gfc_charlen_type_node when calling procedure.

gcc/testsuite/ChangeLog:

2018-03-21  Janne Blomqvist  <jb@gcc.gnu.org>

PR fortran/84615
* gfortran.dg/char_result_17.f90: New test.

From-SVN: r258736

6 years agoC++: show private field accessor hints with -g and optimization (PR c++/84994)
David Malcolm [Wed, 21 Mar 2018 18:21:39 +0000 (18:21 +0000)]
C++: show private field accessor hints with -g and optimization (PR c++/84994)

gcc/cp/ChangeLog:
PR c++/84994
* constexpr.c (constexpr_fn_retval): Make non-"static".
* cp-tree.h (constexpr_fn_retval): New decl.
* search.c (direct_accessor_p): Update leading comment.
(reference_accessor_p): Likewise.
(field_accessor_p): Replace check that function body is a
RETURN_EXPR with a call to constexpr_fn_retval.  Fix
indentation of "field_type" decl.

gcc/testsuite/ChangeLog:
PR c++/84994
* g++.dg/other/accessor-fixits-1.C: Move to...
* g++.dg/torture/accessor-fixits-1.C: ...here.
* g++.dg/other/accessor-fixits-2.C: Move to...
* g++.dg/torture/accessor-fixits-2.C: ...here.
* g++.dg/other/accessor-fixits-3.C: Move to...
* g++.dg/torture/accessor-fixits-3.C: ...here.
* g++.dg/other/accessor-fixits-4.C: Move to...
* g++.dg/torture/accessor-fixits-4.C: ...here.
* g++.dg/other/accessor-fixits-5.C: Move to...
* g++.dg/torture/accessor-fixits-5.C: ...here.
* g++.dg/torture/accessor-fixits-6.C: New testcase.
* g++.dg/torture/accessor-fixits-7.C: New testcase.
* g++.dg/torture/accessor-fixits-8.C: New testcase.

From-SVN: r258731

6 years agoRemove long-dead deprecation documentation
Nathan Sidwell [Wed, 21 Mar 2018 18:06:38 +0000 (18:06 +0000)]
Remove long-dead deprecation documentation

https://gcc.gnu.org/ml/gcc-patches/2018-03/msg01083.html
* doc/extend.texi (Deprecated Features): Remove mention of
long-deleted deprecations.

From-SVN: r258730

6 years agoxfail gcc.dg/tree-ssa/pr84512.c on 64-bit sparc
Rainer Orth [Wed, 21 Mar 2018 17:56:46 +0000 (17:56 +0000)]
xfail gcc.dg/tree-ssa/pr84512.c on 64-bit sparc

* gcc.dg/tree-ssa/pr84512.c: xfail on 64-bit SPARC.

From-SVN: r258729

6 years agoEnable jit on Solaris: soname option and EXTRA_GCC_LIBS (PR jit/84288)
Rainer Orth [Wed, 21 Mar 2018 17:39:16 +0000 (17:39 +0000)]
Enable jit on Solaris: soname option and EXTRA_GCC_LIBS (PR jit/84288)

gcc/jit:
PR jit/84288
* Make-lang.in ($(LIBGCCJIT_FILENAME)): Add $(EXTRA_GCC_LIBS).

gcc:
PR jit/84288
* configure.ac (gcc_cv_ld_soname) <*-*-solaris2*>: Set.
* configure: Regenerate.

From-SVN: r258727

6 years ago[ARM] Fix test pr82989.c for big endian and mthumb
Sudakshina Das [Wed, 21 Mar 2018 17:14:48 +0000 (17:14 +0000)]
[ARM] Fix test pr82989.c for big endian and mthumb

The test pr82989.c which was added in one of previous commits is failing for
mthumb and big-endian configurations. The aim of this test was to check that
NEON instructions are not being used for simple shift operations. The scanning
of lsl and lsr instructions and checking its counts were just too restrictive
for different configurations. So I have now simplified the test to only check
for the absence of NEON instructions.

*** gcc/testsuite/ChangeLog ***

2018-03-21  Sudakshina Das  <sudi.das@arm.com>

PR target/82989
* gcc.target/arm/pr82989.c: Change dg scan-assembly directives.

From-SVN: r258723

6 years ago[PR c++/84804] ICE with default arg, template friend & lambda
Nathan Sidwell [Wed, 21 Mar 2018 15:58:00 +0000 (15:58 +0000)]
[PR c++/84804] ICE with default arg, template friend & lambda

https://gcc.gnu.org/ml/gcc-patches/2018-03/msg01108.html
PR c++/84804
* name-lookup.c (do_pushtag): Permit lambdas to be pushed into
complete classes.

PR c++/84804
* g++.dg/lookup/pr84804.C: New.

From-SVN: r258722

6 years agoMakefile.am (check-runtime): Pass -test.timeout with GOTOOLS_TEST_TIMEOUT.
Uros Bizjak [Wed, 21 Mar 2018 15:46:37 +0000 (16:46 +0100)]
Makefile.am (check-runtime): Pass -test.timeout with GOTOOLS_TEST_TIMEOUT.

* Makefile.am (check-runtime): Pass -test.timeout
with GOTOOLS_TEST_TIMEOUT.
* Makefile.in: Rebuild.

From-SVN: r258721

6 years agoPR c++/84850 - -Wclass-memaccess on a memcpy in a copy assignment operator with no...
Martin Sebor [Wed, 21 Mar 2018 15:14:02 +0000 (15:14 +0000)]
PR c++/84850 - -Wclass-memaccess on a memcpy in a copy assignment operator with no nontrivial bases or members

gcc/cp/ChangeLog:

PR c++/84850
* call.c (first_non_public_field): New template and function.
(first_non_trivial_field): New function.
(maybe_warn_class_memaccess): Call them.

gcc/testsuite/ChangeLog:

PR c++/84850
* g++.dg/Wclass-memaccess-3.C: New test.
* g++.dg/Wclass-memaccess-4.C: New test.

From-SVN: r258719

6 years agoC++: show private field accessor hints for const accesses (PR c++/84892)
David Malcolm [Wed, 21 Mar 2018 13:09:09 +0000 (13:09 +0000)]
C++: show private field accessor hints for const accesses (PR c++/84892)

gcc/cp/ChangeLog:
PR c++/84892
* search.c (field_accessor_p): Use class_of_this_parm rather than
type_of_this_parm, to check that "this" is a "const T *", rather
than a "T *const".

gcc/testsuite/ChangeLog:
PR c++/84892
* g++.dg/other/accessor-fixits-1.C
(test_access_const_t1_color): New.
(test_deref_const_t1_color): New.
* g++.dg/other/accessor-fixits-5.C: New testcase.

From-SVN: r258716

6 years agoMAINTAINERS with no port
Nathan Sidwell [Wed, 21 Mar 2018 12:39:05 +0000 (12:39 +0000)]
MAINTAINERS with no port

https://gcc.gnu.org/ml/gcc-patches/2018-03/msg01093.html
* MAINTAINERS: Move maintainers of now-removed picochip and score
ports to write after approval.

From-SVN: r258715

6 years agoFix some libstdc++ testsuite failures
Jonathan Wakely [Wed, 21 Mar 2018 12:32:14 +0000 (12:32 +0000)]
Fix some libstdc++ testsuite failures

* testsuite/20_util/function_objects/comparisons_pointer.cc: Use
VERIFY instead of assert.
* testsuite/20_util/hash/84998.cc: New test.
* testsuite/23_containers/vector/cons/destructible_debug_neg.cc: New
copy of test adjusted for Debug Mode.
* testsuite/23_containers/vector/cons/destructible_neg.cc: Do not run
test in Debug Mode.

From-SVN: r258714

6 years ago[parloops] Handle canonicalize_loop_ivs failure
Tom de Vries [Wed, 21 Mar 2018 12:25:03 +0000 (12:25 +0000)]
[parloops] Handle canonicalize_loop_ivs failure

2018-03-21  Tom de Vries  <tom@codesourcery.com>

PR tree-optimization/83126
* tree-parloops.c (num_phis): New function.
(gen_parallel_loop): Detect and handle canonicalize_loop_ivs failure.

* gcc.dg/graphite/pr83126.c: New test.

From-SVN: r258713

6 years agoDeprecate some C++ extensions
Nathan Sidwell [Wed, 21 Mar 2018 11:04:36 +0000 (11:04 +0000)]
Deprecate some C++ extensions

https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00995.html
* doc/extend.texi (Deprecated Features): Update deprecared flags,
mention anon-struct/union members and trailing attributes.

cp/
* class.c (finish_struct_anon_r): Refactor, deprecate anything
other than public non-static data members.
* parser.c (cp_parser_init_declarator): Deprecate attributes after
parenthesized initializer.

testsuite/
* g++.dg/ext/anon-struct6.C: Adjust.
* g++.dg/ext/deprecate-1.C: New.
* g++.dg/ext/deprecate-2.C: New.
* g++.dg/lookup/pr84602.C: Adjust.
* g++.dg/lookup/pr84962.C: Adjust.
* g++.old-deja/g++.other/anon4.C

From-SVN: r258712

6 years ago[PR c++/84836] ICE with local scopes
Nathan Sidwell [Wed, 21 Mar 2018 10:59:28 +0000 (10:59 +0000)]
[PR c++/84836] ICE with local scopes

https://gcc.gnu.org/ml/gcc-patches/2018-03/msg01082.html
PR c++/84836
* name-lookup.c (update_binding): Correct logic for local binding
update.

PR c++/84836
* g++.dg/lookup/pr84836.C: New.

From-SVN: r258711

6 years agore PR tree-optimization/84969 (Wrong code with -ftree-loop-distribute-patterns)
Bin Cheng [Wed, 21 Mar 2018 10:42:34 +0000 (10:42 +0000)]
re PR tree-optimization/84969 (Wrong code with -ftree-loop-distribute-patterns)

PR tree-optimization/84969
* tree-loop-distribution.c (fuse_memset_builtins): Don't reorder
builtin memset partitions if they set different rhs values.

gcc/testsuite
* gcc.dg/tree-ssa/pr84969.c: New test.

From-SVN: r258710

6 years agore PR rtl-optimization/84989 (_mm512_broadcast_f32x4 triggers ICE in simplify_const_u...
Jakub Jelinek [Wed, 21 Mar 2018 10:13:29 +0000 (11:13 +0100)]
re PR rtl-optimization/84989 (_mm512_broadcast_f32x4 triggers ICE in simplify_const_unary_operation, at simplify-rtx.c:1731)

PR rtl-optimization/84989
* simplify-rtx.c (simplify_unary_operation_1): Don't try to simplify
VEC_DUPLICATE with scalar result mode.

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

From-SVN: r258709

6 years agoCommit missing Changelogs for PR target/82518 fix.
Kyrylo Tkachov [Wed, 21 Mar 2018 09:36:24 +0000 (09:36 +0000)]
Commit missing Changelogs for PR target/82518 fix.

From-SVN: r258708

6 years agoPR target/82518: Fix testcase.
Christophe Lyon [Wed, 21 Mar 2018 09:26:03 +0000 (09:26 +0000)]
PR target/82518: Fix testcase.

2018-03-21  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/arm/pr82518.c: Require arm_neon_hw.

From-SVN: r258707

6 years agotest_summary: handle single quotes
Christophe Lyon [Wed, 21 Mar 2018 08:47:12 +0000 (08:47 +0000)]
test_summary: handle single quotes

2018-03-21  Christophe Lyon  <christophe.lyon@linaro.org>

* test_summary: Match possible single quotes in configure path.

From-SVN: r258706

6 years agoRemove superfluous return statement (PR ipa/84963).
Martin Liska [Wed, 21 Mar 2018 08:26:49 +0000 (09:26 +0100)]
Remove superfluous return statement (PR ipa/84963).

2018-03-21  Martin Liska  <mliska@suse.cz>

PR ipa/84963
* ipa-icf.c (sem_item_optimizer::fixup_points_to_sets): Remove
not intended return statement.
2018-03-21  Martin Liska  <mliska@suse.cz>

PR ipa/84963
* gfortran.dg/goacc/pr84963.f90: New test.

From-SVN: r258705

6 years agoFix compile-time hog in MPX boundary checking (PR target/84988).
Martin Liska [Wed, 21 Mar 2018 08:26:05 +0000 (09:26 +0100)]
Fix compile-time hog in MPX boundary checking (PR target/84988).

2018-03-21  Martin Liska  <mliska@suse.cz>

PR target/84988
* tree-chkp.c (CHKP_ARRAY_MAX_CHECK_STEPS): Define a new macro.
(chkp_find_bound_slots_1): Limit number of iterations.

From-SVN: r258704

6 years agoPR c++/71638, ICE with NSDMI and reference.
Marek Polacek [Wed, 21 Mar 2018 07:09:22 +0000 (07:09 +0000)]
PR c++/71638, ICE with NSDMI and reference.

* constexpr.c (cxx_eval_bare_aggregate): Update constructor's flags
even when we replace an element.

* g++.dg/cpp0x/nsdmi14.C: New test.
* g++.dg/cpp1y/nsdmi-aggr10.C: New test.

From-SVN: r258703

6 years agovect-strided-shift-1.c: Add dg-skip-if for MIPS with -mpaired-single directives.
Chenghua Xu [Wed, 21 Mar 2018 03:21:05 +0000 (03:21 +0000)]
vect-strided-shift-1.c: Add dg-skip-if for MIPS with -mpaired-single directives.

2018-03-21  Chenghua Xu  <paul.hua.gm@gmail.com>

       * gcc.dg/vect/vect-strided-shift-1.c: Add dg-skip-if for
       MIPS with -mpaired-single directives.

From-SVN: r258702

6 years agore PR fortran/85001 (ICE in gfc_build_array_type, at fortran/trans-types.c:1420)
Steven G. Kargl [Wed, 21 Mar 2018 01:07:43 +0000 (01:07 +0000)]
re PR fortran/85001 (ICE in gfc_build_array_type, at fortran/trans-types.c:1420)

2018-03-20  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/85001
* interface.c (symbol_rank): Remove bogus null pointer check that
crept in when translating a ternary operator into an if-else
constructor.

2018-03-20  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/85001
* gfortran.dg/interface_41.f90: New test.

From-SVN: r258698

6 years agoDaily bump.
GCC Administrator [Wed, 21 Mar 2018 00:16:14 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r258697

6 years agore PR target/84838 (Minor grammar fixes for x86 options)
David H. Gutteridge [Tue, 20 Mar 2018 22:22:28 +0000 (22:22 +0000)]
re PR target/84838 (Minor grammar fixes for x86 options)

PR target/84838
* Minor grammar fixes for x86 options.

From-SVN: r258694

6 years agore PR libstdc++/84998 (std::hash<std::bitset<N>> fails in Debug Mode)
François Dumont [Tue, 20 Mar 2018 21:45:14 +0000 (21:45 +0000)]
re PR libstdc++/84998 (std::hash<std::bitset<N>> fails in Debug Mode)

2018-03-20  François Dumont  <fdumont@gcc.gnu.org>

PR libstdc++/84998
* include/bits/stl_bvector.h: Fix std::hash friend declaration.
* include/std/bitset: Likewise.
* include/bits/stl_map.h (std::map<>): Fix _Rb_tree_merge_helper friend
declaration.
* include/bits/stl_multimap.h (std::multimap<>): Likewise.
* include/bits/stl_multiset.h (std::multiset<>): Likewise.
* include/bits/stl_set.h (std::set<>): Likewise.
* include/bits/unordered_map.h (std::unordered_map<>): Fix
_Hash_merge_helper friend declaration.
(std::unordered_multimap<>): Likewise.
* include/bits/unordered_set.h (std::unordered_set<>): Likewise.
(std::unordered_multiset<>): Likewise.

From-SVN: r258693

6 years agore PR debug/84875 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2348 on s390x)
Jakub Jelinek [Tue, 20 Mar 2018 21:07:13 +0000 (22:07 +0100)]
re PR debug/84875 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2348 on s390x)

PR debug/84875
* dce.c (delete_unmarked_insns): Don't remove frame related noop moves
holding REG_CFA_RESTORE notes, instead turn them into a USE.

* gcc.dg/pr84875.c: New test.

From-SVN: r258692

6 years agore PR c++/84927 (ICE with NSDMI and reference)
Marek Polacek [Tue, 20 Mar 2018 18:13:38 +0000 (18:13 +0000)]
re PR c++/84927 (ICE with NSDMI and reference)

PR c++/84927
* constexpr.c (cxx_eval_bare_aggregate): Update constructor's flags
as we evaluate the elements.
(cxx_eval_constant_expression): Verify constructor's flags
unconditionally.

* g++.dg/cpp1y/nsdmi-aggr9.C: New test.

From-SVN: r258691

6 years agoPR c++/84978, ICE with NRVO.
Jason Merrill [Tue, 20 Mar 2018 18:05:59 +0000 (14:05 -0400)]
PR c++/84978, ICE with NRVO.

* cvt.c (cp_get_fndecl_from_callee): Add fold parameter.
(cp_get_callee_fndecl_nofold): New.
* cp-gimplify.c (cp_genericize_r): Use it instead.
* call.c (check_self_delegation): Likewise.

From-SVN: r258689

6 years agore PR target/83789 (__builtin_altivec_lvx fails for powerpc for altivec-4.c)
Peter Bergner [Tue, 20 Mar 2018 17:25:09 +0000 (12:25 -0500)]
re PR target/83789 (__builtin_altivec_lvx fails for powerpc for altivec-4.c)

PR target/83789
* config/rs6000/altivec.md (altivec_lvx_<mode>_2op): Delete define_insn.
(altivec_lvx_<mode>_1op): Likewise.
(altivec_stvx_<mode>_2op): Likewise.
(altivec_stvx_<mode>_1op): Likewise.
(altivec_lvx_<VM2:mode>): New define_expand.
(altivec_stvx_<VM2:mode>): Likewise.
(altivec_lvx_<VM2:mode>_2op_<P:mptrsize>): New define_insn.
(altivec_lvx_<VM2:mode>_1op_<P:mptrsize>): Likewise.
(altivec_stvx_<VM2:mode>_2op_<P:mptrsize>): Likewise.
(altivec_stvx_<VM2:mode>_1op_<P:mptrsize>): Likewise.
* config/rs6000/rs6000-p8swap.c (rs6000_gen_stvx): Use new expanders.
(rs6000_gen_lvx): Likewise.
* config/rs6000/rs6000.c (altivec_expand_lv_builtin): Likewise.
(altivec_expand_stv_builtin): Likewise.
(altivec_expand_builtin): Likewise.
* config/rs6000/vector.md: Likewise.

From-SVN: r258688

6 years agoThis PR shows that we get the load/store_lanes logic wrong for arm big-endian.
Kyrylo Tkachov [Tue, 20 Mar 2018 17:13:16 +0000 (17:13 +0000)]
This PR shows that we get the load/store_lanes logic wrong for arm big-endian.

It is tricky to get right. Aarch64 does it by adding the appropriate lane-swapping
operations during expansion.

I'd like to do the same on arm eventually, but we'd need to port and validate the VTBL-generating
code and add it to all the right places and I'm not comfortable enough doing it for GCC 8, but I am keen
in getting the wrong-code fixed.
As I say in the PR, vectorisation on armeb is already severely restricted (we disable many patterns on BYTES_BIG_ENDIAN)
and the load/store_lanes patterns really were not working properly at all, so disabling them is not
a radical approach.

The way to do that is to return false in ARRAY_MODE_SUPPORTED_P for BYTES_BIG_ENDIAN.

Bootstrapped and tested on arm-none-linux-gnueabihf.
Also tested on armeb-none-eabi.

     PR target/82518
     * config/arm/arm.c (arm_array_mode_supported_p): Return false for
     BYTES_BIG_ENDIAN.

     * lib/target-supports.exp (check_effective_target_vect_load_lanes):
     Disable for armeb targets.
     * gcc.target/arm/pr82518.c: New test.

From-SVN: r258687

6 years ago[PR c++/84962] ICE with anon-struct member
Nathan Sidwell [Tue, 20 Mar 2018 16:01:08 +0000 (16:01 +0000)]
[PR c++/84962] ICE with anon-struct member

https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00961.html
PR c++/84962
* name-lookup.c (pushdecl_class_level): Push anon-struct's
member_vec, if there is one.

PR c++/84962
* g++.dg/lookup/pr84962.C: New.

From-SVN: r258686

6 years ago[PR c++/84970] lookup marking
Nathan Sidwell [Tue, 20 Mar 2018 15:57:30 +0000 (15:57 +0000)]
[PR c++/84970] lookup marking

https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00973.html
PR c++/84970
* cp-tree.h (lookup_list_keep): Declare.
* tree.c (lookup_list_keep): New, broken out of ...
(build_min): ... here.  Call it.
* decl.c (cp_finish_decl): Call lookup_list_keep.

PR c++/84970
* g++.dg/lookup/pr84970.C: New.

From-SVN: r258685

6 years agore PR target/84986 (Performance regression: loop no longer vectorized (x86-64))
Richard Biener [Tue, 20 Mar 2018 14:35:46 +0000 (14:35 +0000)]
re PR target/84986 (Performance regression: loop no longer vectorized (x86-64))

2018-03-20  Richard Biener  <rguenther@suse.de>

PR target/84986
* config/i386/i386.c (ix86_add_stmt_cost): Only cost
sign-conversions as zero, fall back to standard scalar_stmt
cost for the rest.

* gcc.dg/vect/costmodel/x86_64/costmodel-pr84986.c: New testcase.

From-SVN: r258684

6 years agoHandle -fno-guess-branch-probability properly in predict.c (PR ipa/84825).
Martin Liska [Tue, 20 Mar 2018 14:14:17 +0000 (15:14 +0100)]
Handle -fno-guess-branch-probability properly in predict.c (PR ipa/84825).

2018-03-20  Martin Liska  <mliska@suse.cz>

PR ipa/84825
* predict.c (rebuild_frequencies): Handle case when we have
PROFILE_ABSENT, but flag_guess_branch_prob is false.
2018-03-20  Martin Liska  <mliska@suse.cz>

PR ipa/84825
* g++.dg/ipa/pr84825.C: New test.

From-SVN: r258683

6 years agoRemove ICEing test-case.
Martin Liska [Tue, 20 Mar 2018 14:13:17 +0000 (15:13 +0100)]
Remove ICEing test-case.

2018-03-20  Martin Liska  <mliska@suse.cz>

* gcc.dg/lto/chkp-ctor-merge_0.c: Remove.

From-SVN: r258682

6 years agore PR target/84990 (Boostrap broken with --enable-checking=release and Ada)
Jakub Jelinek [Tue, 20 Mar 2018 13:00:48 +0000 (14:00 +0100)]
re PR target/84990 (Boostrap broken with --enable-checking=release and Ada)

PR target/84990
* dwarf2asm.c (dw2_output_indirect_constant_1): Temporarily turn off
flag_section_anchors.
* varasm.c (use_blocks_for_decl_p): Remove hack for
dw2_force_const_mem.

From-SVN: r258681

6 years agoPR c++/84937 - ICE with class deduction and auto.
Jason Merrill [Tue, 20 Mar 2018 12:44:49 +0000 (08:44 -0400)]
PR c++/84937 - ICE with class deduction and auto.

* pt.c (rewrite_template_parm): Fix auto handling.

From-SVN: r258680

6 years agoforce-parallel-4.c: XFAIL one parallelizable loop.
Richard Biener [Tue, 20 Mar 2018 12:42:59 +0000 (12:42 +0000)]
force-parallel-4.c: XFAIL one parallelizable loop.

2018-03-20  Richard Biener  <rguenther@suse.de>

* testsuite/libgomp.graphite/force-parallel-4.c: XFAIL one
parallelizable loop.

From-SVN: r258679

6 years agore PR target/84845 (ICE: in extract_insn, at recog.c:2304: unrecognizable insn at...
Jakub Jelinek [Tue, 20 Mar 2018 10:59:26 +0000 (11:59 +0100)]
re PR target/84845 (ICE: in extract_insn, at recog.c:2304: unrecognizable insn at -O2 and above at aarch64)

PR target/84845
* config/aarch64/aarch64.md (*aarch64_reg_<mode>3_neg_mask2): Rename
to ...
(*aarch64_<optab>_reg_<mode>3_neg_mask2): ... this.  If pseudos can't
be created, use lowpart_subreg of operands[0] rather than operands[0]
itself.
(*aarch64_reg_<mode>3_minus_mask): Rename to ...
(*aarch64_ashl_reg_<mode>3_minus_mask): ... this.
(*aarch64_<optab>_reg_di3_mask2): Use const_int_operand predicate
and n constraint instead of aarch64_shift_imm_di and Usd.
(*aarch64_reg_<optab>_minus<mode>3): Rename to ...
(*aarch64_<optab>_reg_minus<mode>3): ... this.

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

From-SVN: r258678

6 years ago[ARM][PR82989] Fix unexpected use of NEON instructions for shifts
Sudakshina Das [Tue, 20 Mar 2018 10:54:42 +0000 (10:54 +0000)]
[ARM][PR82989] Fix unexpected use of NEON instructions for shifts

This patch fixes PR82989 so that we avoid NEON instructions when
-mneon-for-64bits is not enabled. This is more of a short term fix
for the real deeper problem of making an early decision of choosing
or rejecting NEON instructions. There is now a new ticket PR84467 to
deal with the longer term solution.
(Please refer to the discussion in the bug report for more details).

Sudi

*** gcc/ChangeLog ***

2018-03-20  Sudakshina Das  <sudi.das@arm.com>

PR target/82989
* config/arm/neon.md (ashldi3_neon): Update ?s for constraints
to favor GPR over NEON registers.
(<shift>di3_neon): Likewise.

*** gcc/testsuite/ChangeLog ***

2018-03-20  Sudakshina Das  <sudi.das@arm.com>

PR target/82989
* gcc.target/arm/pr82989.c: New test.

From-SVN: r258677

6 years ago[nvptx] Fix bar.sync position
Tom de Vries [Tue, 20 Mar 2018 10:31:23 +0000 (10:31 +0000)]
[nvptx] Fix bar.sync position

2018-03-20  Tom de Vries  <tom@codesourcery.com>

PR target/84952
* config/nvptx/nvptx.c (nvptx_single): Don't neuter bar.sync.
(nvptx_process_pars): Emit bar.sync asap and alap.

From-SVN: r258676

6 years ago* c-ada-spec.c (pp_ada_tree_identifier): Deal specifically with _Bool.
Eric Botcazou [Tue, 20 Mar 2018 09:44:21 +0000 (09:44 +0000)]
* c-ada-spec.c (pp_ada_tree_identifier): Deal specifically with _Bool.

From-SVN: r258675

6 years ago[nvptx] Fix prevent_branch_around_nothing
Tom de Vries [Tue, 20 Mar 2018 09:14:07 +0000 (09:14 +0000)]
[nvptx] Fix prevent_branch_around_nothing

2018-03-20  Tom de Vries  <tom@codesourcery.com>

PR target/84954
* config/nvptx/nvptx.c (prevent_branch_around_nothing): Also update
seen_label if seen_label is already set.

From-SVN: r258674

6 years agore PR target/84945 (UBSAN: gcc/config/i386/i386.c:33312:22: runtime error: shift...
Jakub Jelinek [Tue, 20 Mar 2018 08:14:42 +0000 (09:14 +0100)]
re PR target/84945 (UBSAN: gcc/config/i386/i386.c:33312:22: runtime error: shift exponent 32 is too large for 32-bit type 'int')

PR target/84945
* config/i386/i386.c (fold_builtin_cpu): For features above 31
use __cpu_features2 variable instead of __cpu_model.__cpu_features[0].
Use 1U instead of 1.  Formatting fixes.

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

* config/i386/cpuinfo.h (__cpu_features2): Declare.
* config/i386/cpuinfo.c (__cpu_features2): New variable for
ifndef SHARED only.
(set_feature): Define.
(get_available_features): Use set_feature macro.  Set __cpu_features2
to the second word of features ifndef SHARED.

From-SVN: r258673

6 years agoPR target/81647: Fix testcase.
Christophe Lyon [Tue, 20 Mar 2018 08:11:35 +0000 (08:11 +0000)]
PR target/81647: Fix testcase.

2018-03-20  Christophe Lyon  <christophe.lyon@linaro.org>

PR target/81647
* gcc.target/aarch64/pr81647.c: Require fenv_exceptions.

From-SVN: r258672

6 years agore PR c/84953 (misleading warning from strpbrk(x,""))
Jakub Jelinek [Tue, 20 Mar 2018 07:55:41 +0000 (08:55 +0100)]
re PR c/84953 (misleading warning from strpbrk(x,""))

PR c/84953
* builtins.c (fold_builtin_strpbrk): For strpbrk(x, "") use type
instead of TREE_TYPE (s1) for the return value.

* gcc.dg/pr84953.c: New test.

From-SVN: r258671

6 years agoDaily bump.
GCC Administrator [Tue, 20 Mar 2018 00:16:14 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r258670

6 years agore PR tree-optimization/84946 (UBSAN: in mem_valid_for_store_merging ../../gcc/gimple...
Jakub Jelinek [Mon, 19 Mar 2018 20:49:57 +0000 (21:49 +0100)]
re PR tree-optimization/84946 (UBSAN: in mem_valid_for_store_merging ../../gcc/gimple-ssa-store-merging.c:3951)

PR tree-optimization/84946
* gimple-ssa-store-merging.c (mem_valid_for_store_merging): Compute
bitsize + bitsize in poly_uint64 rather than poly_int64.

From-SVN: r258665

6 years agore PR sanitizer/78651 (Incorrect exception handling when catch clause uses local...
Jakub Jelinek [Mon, 19 Mar 2018 20:48:39 +0000 (21:48 +0100)]
re PR sanitizer/78651 (Incorrect exception handling when catch clause uses local class and PIC and sanitizer are active)

PR sanitizer/78651
* dwarf2asm.c: Include fold-const.c.
(dw2_output_indirect_constant_1): Set DECL_INITIAL (decl) to ADDR_EXPR
of decl rather than decl itself.

From-SVN: r258664

6 years agore PR sanitizer/84761 (AddressSanitizer is not compatible with glibc 2.27 on x86)
Jakub Jelinek [Mon, 19 Mar 2018 20:47:29 +0000 (21:47 +0100)]
re PR sanitizer/84761 (AddressSanitizer is not compatible with glibc 2.27 on x86)

PR sanitizer/84761
* sanitizer_common/sanitizer_linux_libcdep.cc (__GLIBC_PREREQ):
Define if not defined.
(DL_INTERNAL_FUNCTION): Don't define.
(InitTlsSize): For __i386__ if not compiled against glibc 2.27+
determine at runtime whether to use regparm(3), stdcall calling
convention for older glibcs or normal calling convention for
newer glibcs for call to _dl_get_tls_static_info.

From-SVN: r258663

6 years agore PR rtl-optimization/84643 (gcc/optabs.c:6549:26: runtime error: load of value...
Jakub Jelinek [Mon, 19 Mar 2018 20:46:23 +0000 (21:46 +0100)]
re PR rtl-optimization/84643 (gcc/optabs.c:6549:26: runtime error: load of value 131075, which is not a valid value for type 'memmodel')

PR rtl-optimization/84643
* memmodel.h (enum memmodel): Add MEMMODEL_MAX enumerator.

From-SVN: r258662

6 years agore PR c++/84927 (ICE with NSDMI and reference)
Marek Polacek [Mon, 19 Mar 2018 20:46:16 +0000 (20:46 +0000)]
re PR c++/84927 (ICE with NSDMI and reference)

PR c++/84927
* constexpr.c (cxx_eval_bare_aggregate): Update constructor's flags
as we evaluate the elements.
(cxx_eval_constant_expression): Verify constructor's flags
unconditionally.

* g++.dg/cpp1y/nsdmi-aggr9.C: New test.

From-SVN: r258661

6 years agore PR c++/84925 (ICE with segfault in __PRETTY_FUNCTION__)
Marek Polacek [Mon, 19 Mar 2018 20:34:45 +0000 (20:34 +0000)]
re PR c++/84925 (ICE with segfault in __PRETTY_FUNCTION__)

PR c++/84925
* pt.c (enclosing_instantiation_of): Check if fn is null.

* g++.dg/cpp1z/lambda-__func__.C: New test.

From-SVN: r258660

6 years agoPR c++/71834 - template-id with too few arguments.
Jason Merrill [Mon, 19 Mar 2018 20:32:57 +0000 (16:32 -0400)]
PR c++/71834 - template-id with too few arguments.

* pt.c (coerce_template_parms): Check fixed_parameter_pack_p.

From-SVN: r258659

6 years agore PR sanitizer/78651 (Incorrect exception handling when catch clause uses local...
Maxim Ostapenko [Mon, 19 Mar 2018 19:59:56 +0000 (19:59 +0000)]
re PR sanitizer/78651 (Incorrect exception handling when catch clause uses local class and PIC and sanitizer are active)

2018-03-19  Maxim Ostapenko  <m.ostapenko@samsung.com>

gcc/

PR sanitizer/78651
* dwarf2asm.c (dw2_output_indirect_constant_1): Disable ASan before
calling assemble_variable.

gcc/testsuite/

PR sanitizer/78651
* g++.dg/asan/pr78651.C: New test.

From-SVN: r258658

6 years ago[testsuite] Add nvptx xfail to pr84512.c
Tom de Vries [Mon, 19 Mar 2018 19:12:53 +0000 (19:12 +0000)]
[testsuite] Add nvptx xfail to pr84512.c

2018-03-19  Tom de Vries  <tom@codesourcery.com>

* gcc.dg/tree-ssa/pr84512.c: Don't require effective target
vect_int_mult.  Add nvptx xfail for PR84958.

From-SVN: r258656

6 years ago[PR c++/84835] ICE with generic lambda in extern "C"
Nathan Sidwell [Mon, 19 Mar 2018 18:56:22 +0000 (18:56 +0000)]
[PR c++/84835] ICE with generic lambda in extern "C"

https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00890.html
PR c++/84835
* lambda.c (maybe_add_lambda_conv_op): Force C++ linkage.
* pt.c (build_template_decl): Propagate language linkage.

PR c++/84835
* g++.dg/cpp1y/pr84835.C: New.

From-SVN: r258655

6 years ago[PR81647][AARCH64] Fix handling of Unordered Comparisons in aarch64-simd.md
Sudakshina Das [Mon, 19 Mar 2018 18:50:32 +0000 (18:50 +0000)]
[PR81647][AARCH64] Fix handling of Unordered Comparisons in aarch64-simd.md

This patch fixes the inconsistent behavior observed at -O3 for the unordered
comparisons. According to the online docs (https://gcc.gnu.org/onlinedocs
/gcc-7.2.0/gccint/Unary-and-Binary-Expressions.html), all of the following
should not raise an FP exception:
- UNGE_EXPR
- UNGT_EXPR
- UNLE_EXPR
- UNLT_EXPR
- UNEQ_EXPR
Also ORDERED_EXPR and UNORDERED_EXPR should only return zero or one.

The aarch64-simd.md handling of these were generating exception raising
instructions such as fcmgt. This patch changes the instructions that are
emitted in order to not give out the exceptions. We first check each
operand for NaNs and force any elements containing NaN to zero before using
them in the compare.

Example: UN<cc> (a, b) -> UNORDERED (a, b)
  | (cm<cc> (isnan (a) ? 0.0 : a, isnan (b) ? 0.0 : b))

The ORDERED_EXPR is now handled as (cmeq (a, a) & cmeq (b, b)) and
UNORDERED_EXPR as ~ORDERED_EXPR and UNEQ as (~ORDERED_EXPR | cmeq (a,b)).

ChangeLog Entries:

*** gcc/ChangeLog ***

2018-03-19  Sudakshina Das  <sudi.das@arm.com>

PR target/81647
* config/aarch64/aarch64-simd.md (vec_cmp<mode><v_int_equiv>): Modify
instructions for UNLT, UNLE, UNGT, UNGE, UNEQ, UNORDERED and ORDERED.

*** gcc/testsuite/ChangeLog ***

2018-03-19  Sudakshina Das  <sudi.das@arm.com>

PR target/81647
* gcc.target/aarch64/pr81647.c: New.

From-SVN: r258653

6 years ago* es.po, sv.po: Update.
Joseph Myers [Mon, 19 Mar 2018 18:29:34 +0000 (18:29 +0000)]
* es.po, sv.po: Update.

From-SVN: r258651

6 years agoRISC-V: Fix bootstrap failure.
Jim Wilson [Mon, 19 Mar 2018 18:08:24 +0000 (18:08 +0000)]
RISC-V: Fix bootstrap failure.

gcc/
PR bootstrap/84856
* config/riscv/riscv.c (riscv_function_arg_boundary): Use
PREFERRED_STACK_BOUNDARY instead of STACK_BOUNDARY.
(riscv_first_stack_step): Likewise.
(riscv_option_override): Use STACK_BOUNDARY instead of
MIN_STACK_BOUNDARY.
* config/riscv/riscv.h (STACK_BOUNDARY): Renamed from
MIN_STACK_BOUNDARY.
(BIGGEST_ALIGNMENT): Set to 128.
(PREFERRED_STACK_BOUNDARY): Renamed from STACK_BOUNDARY.
(RISCV_STACK_ALIGN): Use PREFERRED_STACK_BOUNDARY instead of
STACK_BOUNDARY.

From-SVN: r258650

6 years agore PR tree-optimization/84933 (ICE in set_value_range, at tree-vrp.c:288 since r257852)
Richard Biener [Mon, 19 Mar 2018 14:11:05 +0000 (14:11 +0000)]
re PR tree-optimization/84933 (ICE in set_value_range, at tree-vrp.c:288 since r257852)

2018-03-19  Richard Biener  <rguenther@suse.de>

PR tree-optimization/84933
* tree-vrp.c (set_and_canonicalize_value_range): Treat out-of-bound
values as -INF/INF when canonicalizing an ANTI_RANGE to a RANGE.

* g++.dg/pr84933.C: New testcase.

From-SVN: r258646

6 years agore PR tree-optimization/84859 (bogus -Warray-bounds on a memcpy in a loop)
Richard Biener [Mon, 19 Mar 2018 14:08:58 +0000 (14:08 +0000)]
re PR tree-optimization/84859 (bogus -Warray-bounds on a memcpy in a loop)

2018-03-19  Richard Biener  <rguenther@suse.de>

PR tree-optimization/84859
* tree-ssa-phiopt.c (single_trailing_store_in_bb): New function.
(cond_if_else_store_replacement): Perform sinking operation on
single-store BBs regardless of MAX_STORES_TO_SINK setting.
Generalize what a BB with a single eligible store is.

* gcc.dg/tree-ssa/pr84859.c: New testcase.
* gcc.dg/tree-ssa/pr35286.c: Disable cselim.
* gcc.dg/tree-ssa/split-path-6.c: Likewise.
* gcc.dg/tree-ssa/split-path-7.c: Likewise.

From-SVN: r258645

6 years ago[C++/84812] ICE with local fn decl
Nathan Sidwell [Mon, 19 Mar 2018 14:07:07 +0000 (14:07 +0000)]
[C++/84812] ICE with local fn decl

https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00872.html
PR c++/84812
* name-lookup.c (set_local_extern_decl_linkage): Defend against
ambiguous lookups.

PR c++/84812
* g++.dg/lookup/pr84812.C: New.

From-SVN: r258644

6 years agore PR tree-optimization/84929 (ICE at -O3 on valid code on x86_64-linux-gnu: tree...
Richard Biener [Mon, 19 Mar 2018 12:49:30 +0000 (12:49 +0000)]
re PR tree-optimization/84929 (ICE at -O3 on valid code on x86_64-linux-gnu: tree check: expected polynomial_chrec, have nop_expr in analyze_siv_subscript_cst_affine, at tree-data-ref.c:3018)

2018-03-19  Richard Biener  <rguenther@suse.de>

PR tree-optimization/84929
* tree-data-ref.c (analyze_siv_subscript_cst_affine): Guard
chrec_is_positive against non-chrec arg.

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

From-SVN: r258643

6 years agore PR target/84711 (AArch32 big-endian fails when taking subreg of a vector mode...
Tamar Christina [Mon, 19 Mar 2018 09:14:25 +0000 (09:14 +0000)]
re PR target/84711 (AArch32 big-endian fails when taking subreg of a vector mode to a scalar mode.)

gcc/
2018-03-19  Tamar Christina  <tamar.christina@arm.com>

PR target/84711
* config/arm/arm.c (arm_can_change_mode_class): revert r258554.

gcc/testsuite/
2018-03-19  Tamar Christina  <tamar.christina@arm.com>

PR target/84711
* gcc.target/arm/big-endian-subreg.c: Delete.

From-SVN: r258642

6 years agore PR fortran/84931 (Expansion of array constructor with constant implied-do-object...
Thomas Koenig [Mon, 19 Mar 2018 07:04:35 +0000 (07:04 +0000)]
re PR fortran/84931 (Expansion of array constructor with constant implied-do-object goes sideways)

2018-03-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/84931
* simplify.c (gfc_convert_constant): Correctly handle iterators
for type conversion.

2018-03-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/84931
* gfortran.dg/array_constructor_52.f90: New test.

From-SVN: r258641

6 years agoDaily bump.
GCC Administrator [Mon, 19 Mar 2018 00:16:19 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r258640

6 years agoapi.xml: www.fsf.org has moved to https.
Gerald Pfeifer [Sun, 18 Mar 2018 23:52:00 +0000 (23:52 +0000)]
api.xml: www.fsf.org has moved to https.

* doc/xml/api.xml: www.fsf.org has moved to https. Also omit
trailing slash for domain level link.
* doc/xml/faq.xml: Ditto.
* doc/xml/manual/appendix_free.xml (software): Ditto.
* doc/xml/manual/intro.xml: Ditto.
* doc/xml/manual/spine.xml: Ditto.
* doc/xml/spine.xml: Ditto.

From-SVN: r258637