Martin Liska [Fri, 8 Jul 2016 20:22:22 +0000 (22:22 +0200)]
Do not consider COMPLEX_TYPE as fold_convertible_p
Backported from mainline
2016-07-08 Martin Liska <mliska@suse.cz>
PR middle-end/71606
* fold-const.c (fold_convertible_p): As COMPLEX_TYPE
folding produces SAVE_EXPRs, thus return false for the type.
Backported from mainline
2016-07-08 Martin Liska <mliska@suse.cz>
Jakub Jelinek [Thu, 7 Jul 2016 21:54:34 +0000 (23:54 +0200)]
backport: re PR fortran/71704 (ICE with -fopenmp and some omp constructs)
Backported from mainline
2016-06-30 Jakub Jelinek <jakub@redhat.com>
PR fortran/71704
* parse.c (matchs, matcho): If spec_only, only gfc_match the keyword
and if successful, goto do_spec_only.
(matchds, matchdo): Define.
(decode_omp_directive): Add spec_only local var and set it.
Use matchds or matchdo macros instead of matchs or matcho
for declare target, declare simd, declare reduction and threadprivate
directives. Return ST_GET_FCN_CHARACTERISTICS if a non-declarative
directive could be matched.
(next_statement): For ST_GET_FCN_CHARACTERISTICS restore
gfc_current_locus from old_locus even if there is no label.
Jakub Jelinek [Thu, 7 Jul 2016 21:53:12 +0000 (23:53 +0200)]
backport: re PR middle-end/71626 (ICE at -O1 and above on x86_64-linux-gnu (in output_constant_pool_2, at varasm.c:3837))
Backported from mainline
2016-06-28 Jakub Jelinek <jakub@redhat.com>
PR middle-end/71626
* config/i386/i386.c (ix86_expand_vector_move): For SUBREG of
a constant, force its SUBREG_REG into memory or register instead
of whole op1.
* gcc.c-torture/execute/pr71626-1.c: New test.
* gcc.c-torture/execute/pr71626-2.c: New test.
Jakub Jelinek [Thu, 7 Jul 2016 21:51:57 +0000 (23:51 +0200)]
backport: re PR middle-end/71494 (label as value in nested function)
Backported from mainline
2016-06-10 Jakub Jelinek <jakub@redhat.com>
PR middle-end/71494
* tree-nested.c (convert_nonlocal_reference_stmt): For GIMPLE_GOTO
without LABEL_DECL, set *handled_ops_p to false instead of true.
Jakub Jelinek [Thu, 7 Jul 2016 21:49:58 +0000 (23:49 +0200)]
backport: re PR rtl-optimization/70222 (Test miscompiled with -O1)
Backported from mainline
2016-03-15 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/70222
* combine.c (simplify_shift_const_1): For A >> B >> C LSHIFTRT
optimization if mode is different from result_mode, queue up masking
of the result in outer_op. Formatting fix.
* gcc.c-torture/execute/pr70222-1.c: New test.
* gcc.c-torture/execute/pr70222-2.c: New test.
Jakub Jelinek [Thu, 7 Jul 2016 21:49:12 +0000 (23:49 +0200)]
backport: re PR tree-optimization/70169 (ICE at -O1 and above on x86_64-linux-gnu in gen_lsm_tmp_name, at tree-ssa-loop.c:791)
Backported from mainline
2016-03-11 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/70169
* tree-ssa-loop.c (gen_lsm_tmp_name): Handle FUNCTION_DECL and
LABEL_DECL like VAR_DECL. Emit nothing instead of gcc_unreachable
for unknown codes.
Jakub Jelinek [Thu, 7 Jul 2016 21:47:40 +0000 (23:47 +0200)]
backport: re PR rtl-optimization/69891 (wrong code with -mstringop-strategy=libcall @ i686)
Backported from mainline
2016-02-26 Jakub Jelinek <jakub@redhat.com>
Eric Botcazou <ebotcazou@adacore.com>
PR rtl-optimization/69891
* dse.c (scan_insn): If we can't figure out memset arguments
or they are non-constant, call clear_rhs_from_active_local_stores.
Jakub Jelinek [Thu, 7 Jul 2016 21:46:54 +0000 (23:46 +0200)]
backport: re PR c++/67767 (-Wsuggest-attribute=noreturn suggests noreturn for function which already has noreturn and cold.)
Backported from mainline
2016-02-19 Jakub Jelinek <jakub@redhat.com>
PR c++/67767
* parser.c (cp_parser_std_attribute_spec_seq): Don't assume
attr_spec is always single element chain, chain all the attributes
properly together in the right order.
Jakub Jelinek [Thu, 7 Jul 2016 21:46:16 +0000 (23:46 +0200)]
backport: re PR tree-optimization/69802 (gcc ICE at -O1 and above on valid code on x86_64-linux-gnu with “seg fault”)
Backported from mainline
2016-02-16 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/69802
* tree-ssa-reassoc.c (update_range_test): If op is
SSA_NAME_IS_DEFAULT_DEF, give up unless tem is a positive
op == 1 test of precision 1 integral op, otherwise handle
that case as op itself. Fix up formatting.
(optimize_range_tests_to_bit_test, optimize_range_tests): Fix
up formatting.
Richard Biener [Thu, 7 Jul 2016 11:46:08 +0000 (11:46 +0000)]
Backport PRs 70022, 70484, 70931, 71452
2016-07-07 Richard Biener <rguenther@suse.de>
Backport from mainline
2016-04-04 Richard Biener <rguenther@suse.de>
PR rtl-optimization/70484
* rtl.h (canon_output_dependence): Declare.
* alias.c (canon_output_dependence): New function.
* dse.c (record_store): Use canon_output_dependence rather
than canon_true_dependence.
* gcc.dg/torture/pr70484.c: New testcase.
2016-06-08 Richard Biener <rguenther@suse.de>
PR tree-optimization/71452
* tree-ssa.c (non_rewritable_lvalue_p): Make sure that the
type used for the SSA rewrite has enough precision to cover
the dynamic type of the location.
Jakub Jelinek [Thu, 30 Jun 2016 09:17:17 +0000 (11:17 +0200)]
re PR middle-end/71693 (ICE: verify_gimple failed (type mismatch in shift expression, -O0, -O1, -O2, -O3))
PR middle-end/71693
* fold-const.c (fold_binary_loc) <case RROTATE_EXPR>: Cast
TREE_OPERAND (arg0, 0) and TREE_OPERAND (arg0, 1) to type
first when permuting bitwise operation with rotate. Cast
TREE_OPERAND (arg0, 0) to type when cancelling two rotations.
Martin Jambor [Thu, 19 May 2016 15:17:10 +0000 (17:17 +0200)]
[PR 70646] Store size to inlining predicate conditions
2016-05-19 Martin Jambor <mjambor@suse.cz>
PR ipa/70646
* ipa-inline.h (condition): New field size.
* ipa-inline-analysis.c (add_condition): New parameter SIZE, use it
for comaprison and store it into the new condition.
(evaluate_conditions_for_known_args): Use condition size to check
access sizes for all but CHANGED conditions.
(unmodified_parm_1): New parameter size_p, store access size into it.
(unmodified_parm): Likewise.
(unmodified_parm_or_parm_agg_item): Likewise.
(eliminated_by_inlining_prob): Pass NULL to unmodified_parm as size_p.
(set_cond_stmt_execution_predicate): Extract access sizes and store
them to conditions.
(set_switch_stmt_execution_predicate): Likewise.
(will_be_nonconstant_expr_predicate): Likewise.
(will_be_nonconstant_predicate): Likewise.
(inline_read_section): Stream condition size.
(inline_write_summary): Likewise.
* lto-streamer.h (LTO_minor_version): Bump.
* ipa-prop.c (ipa_load_from_parm_agg): Added size_p parameter, pass it
to ipa_load_from_parm_agg_1.
* ipa-prop.h (ipa_load_from_parm_agg): Update declaration.
PR c++/70498
* cp-demangle.c: Parse numbers as integer instead of long to avoid
overflow after sanity checks. Include <limits.h> if available.
(INT_MAX): Define if necessary.
(d_make_template_param): Takes integer argument instead of long.
(d_make_function_param): Likewise.
(d_append_num): Likewise.
(d_identifier): Likewise.
(d_number): Parse as and return integer.
(d_compact_number): Handle overflow.
(d_source_name): Change variable type to integer for parsed number.
(d_java_resource): Likewise.
(d_special_name): Likewise.
(d_discriminator): Likewise.
(d_unnamed_type): Likewise.
* testsuite/demangle-expected: Add regression test cases.
2016-04-08 Marcel Böhme <boehme.marcel@gmail.com>
PR c++/69687
* cplus-dem.c: Include <limits.h> if available.
(INT_MAX): Define if necessary.
(remember_type, remember_Ktype, register_Btype, string_need):
Abort if we detect cases where we the size of the allocation would
overflow.
PR c++/70492
* cplus-dem.c (gnu_special): Handle case where consume_count returns
-1.