Bernd Schmidt [Wed, 17 Feb 2016 13:13:08 +0000 (13:13 +0000)]
Backport PR69522 use-after-free fix.
c/
PR c/69522
* c-parser.c (c_parser_braced_init): New arg outer_obstack. All
callers changed. If nested_p is true, use it to call
finish_implicit_inits.
* c-tree.h (finish_implicit_inits): Declare.
* c-typeck.c (finish_implicit_inits): New function. Move code
from ...
(push_init_level): ... here.
(set_designator, process_init_element): Call finish_implicit_inits.
Jakub Jelinek [Thu, 11 Feb 2016 09:23:58 +0000 (10:23 +0100)]
backport: re PR middle-end/67653 (ICE on valid code on x86_64-linux-gnu: verify_gimple failed)
Backported from mainline
2016-01-21 Jakub Jelinek <jakub@redhat.com>
PR middle-end/67653
* gimplify.c (gimplify_asm_expr): Warn if it is too late to
attempt to mark memory input operand addressable and
call prepare_gimple_addressable in that case. Don't adjust
input_location for diagnostics, use error_at instead.
* c-c++-common/pr67653.c: New test.
* gcc.dg/torture/pr29119.c: Add dg-warning.
Jakub Jelinek [Thu, 11 Feb 2016 09:22:21 +0000 (10:22 +0100)]
backport: re PR tree-optimization/69214 (ICE (segfault) at -Os on x86_64-linux-gnu in "fail_abnormal_edge_coalesce")
Backported from mainline
2016-01-11 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/69214
* tree-vrp.c (simplify_cond_using_ranges): Don't propagate
innerop into a comparison if SSA_NAME_OCCURS_IN_ABNORMAL_PHI.
Formatting fix.
Jakub Jelinek [Thu, 11 Feb 2016 09:14:43 +0000 (10:14 +0100)]
backport: re PR fortran/69128 (OpenMP workshare problem with SUM())
Backported from mainline
2016-01-08 Jakub Jelinek <jakub@redhat.com>
PR fortran/69128
* trans.h (OMPWS_SCALARIZER_BODY): Define.
(OMPWS_NOWAIT): Renumber.
* trans-stmt.c (gfc_trans_where_3): Only set OMPWS_SCALARIZER_WS
if OMPWS_SCALARIZER_BODY is not set already, and set also
OMPWS_SCALARIZER_BODY until the final loop creation.
* trans-expr.c (gfc_trans_assignment_1): Likewise.
* trans-openmp.c (gfc_trans_omp_workshare): Also clear
OMPWS_SCALARIZER_BODY.
* trans-array.c (gfc_trans_scalarized_loop_end): Don't create
OMP_FOR if OMPWS_SCALARIZER_BODY is set.
Jakub Jelinek [Thu, 11 Feb 2016 09:12:52 +0000 (10:12 +0100)]
backport: re PR target/69015 (ICE: RTL check: expected code 'code_label', have 'return' in find_cond_trap, at ifcvt.c:3715 with -fno-if-conversion and __builtin_trap())
Backported from mainline
2016-01-01 Jakub Jelinek <jakub@redhat.com>
PR target/69015
* ifcvt.c (find_cond_trap): Give up if returnjump_p (jump).
Jakub Jelinek [Thu, 11 Feb 2016 09:11:58 +0000 (10:11 +0100)]
backport: re PR rtl-optimization/68376 (wrong code at -O1 and above on x86_64-linux-gnu)
Backported from mainline
2015-12-10 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/68376
PR rtl-optimization/68670
* ifcvt.c (noce_try_abs): For one_cmpl allow < 0, >= 0
or > -1 conditions regardless of negate, and disallow
all other conditions.
* gcc.c-torture/execute/pr68376-2.c (f5, f6, f7, f8): New
tests.
(main): Call them.
* gcc.dg/pr68670-1.c: New test.
* gcc.dg/pr68670-2.c: New test.
2015-11-19 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/68376
* ifcvt.c (noce_try_abs): Disable one_cmpl optimization if
encountering x <= 0 ? ~x : x or x > 0 ? ~x : x.
* gcc.c-torture/execute/pr68376-1.c: New test.
* gcc.c-torture/execute/pr68376-2.c: New test.
Jakub Jelinek [Thu, 11 Feb 2016 09:09:58 +0000 (10:09 +0100)]
backport: re PR tree-optimization/68680 (On-stack VLA does not cause instrumentation with -fstack-protector)
Backported from mainline
2015-12-04 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/68680
* calls.c (special_function_p): Return ECF_MAY_BE_ALLOCA for
BUILT_IN_ALLOCA{,_WITH_ALIGN}. Don't check for __builtin_alloca
by name.
Jakub Jelinek [Thu, 11 Feb 2016 09:09:00 +0000 (10:09 +0100)]
backport: re PR preprocessor/57580 (Repeated _Pragma message directives in macro causes problems)
Backported from mainline
2015-12-03 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/57580
* c-ppoutput.c (print): Change printed field to bool.
(init_pp_output): Set print.printed to false instead of 0.
(scan_translation_unit): Fix up formatting. Set print.printed
to true after printing something other than newline.
(scan_translation_unit_trad): Set print.printed to true instead of 1.
(maybe_print_line_1): Set print.printed to false instead of 0.
(print_line_1): Likewise.
(do_line_change): Set print.printed to true instead of 1.
(cb_define, dump_queued_macros, cb_include, cb_def_pragma,
dump_macro): Set print.printed to false after printing newline.
* c-c++-common/cpp/pr57580.c: New test.
* c-c++-common/gomp/pr57580.c: New test.
Jakub Jelinek [Thu, 11 Feb 2016 09:08:03 +0000 (10:08 +0100)]
backport: re PR debug/66432 (libgomp.c/appendix-a/a.29.1.c -O2 -g: type mismatch between an SSA_NAME and its symbol)
Backported from mainline
2015-11-21 Jakub Jelinek <jakub@redhat.com>
PR debug/66432
* tree-inline.c (copy_debug_stmt): If
gimple_debug_source_bind_get_value is DECL_ORIGIN of a PARM_DECL
in decl_debug_args, don't call remap_gimple_op_r on it.
Jakub Jelinek [Thu, 11 Feb 2016 09:03:34 +0000 (10:03 +0100)]
backport: re PR preprocessor/60736 (Crash in preprocessor including stdc-predef.h when it does not exist on glibc-based systems)
Backported from mainline
2015-11-19 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/60736
* include/cpplib.h (cpp_errno_filename): New prototype.
* errors.c (cpp_errno): Don't handle msgid "" specially, use
_(msgid) instead of msgid as argument to cpp_error.
(cpp_errno_filename): New function.
* files.c (read_file_guts): Use cpp_errno_filename instead of
cpp_errno.
(open_file_failed): Likewise. Use file->name if file->path is NULL
in diagnostics.
Jonathan Wakely [Wed, 10 Feb 2016 11:25:33 +0000 (11:25 +0000)]
Constrain std::valarray functions and operators
PR libstdc++/69116
* include/bits/valarray_before.h (__fun, __fun_with_valarray): Only
define result_type for types which can be safely used with valarrays.
* testsuite/26_numerics/valarray/69116.cc: New.
Jakub Jelinek [Thu, 4 Feb 2016 13:59:27 +0000 (14:59 +0100)]
backport: re PR target/69644 (ICE with -O on __sync_bool_compare_and_swap with short in extract_insn, at recog.c:2286)
Backported from mainline
2016-02-03 Jakub Jelinek <jakub@redhat.com>
PR target/69644
* config/rs6000/rs6000.c (rs6000_expand_atomic_compare_and_swap):
Force oldval into register if it does not satisfy reg_or_short_operand
predicate. Fix up formatting.
Uros Bizjak [Fri, 29 Jan 2016 19:52:30 +0000 (20:52 +0100)]
backport: re PR target/69551 (Wrong code with single element vector insert)
Backport from mainline
2016-01-29 Jakub Jelinek <jakub@redhat.com>
PR target/69551
* config/i386/i386.c (ix86_expand_vector_set) <case V4SImode>: For
SSE1, copy target into the temporary reg first before recursing
on it.
testsuite/ChangeLog:
Backport from mainline
2016-01-29 Jakub Jelinek <jakub@redhat.com>
PR target/69551
* gcc.target/i386/pr69551.c: New test.
Uros Bizjak [Fri, 29 Jan 2016 18:25:13 +0000 (19:25 +0100)]
re PR target/69459 (wrong code with -O2 and vector arithmetics @ x86_64)
PR target/69459
* config/i386/constraints.md (C): Only accept constant zero operand.
(BC): New constraint.
* config/i386/sse.md (*mov<mode>_internal): Use BC constraint
instead of C constraint.
* doc/md.texi (Machine Constraints): Update description
of C constraint.
testsuite/ChangeLog:
PR target/69459
* gcc.target/i386/pr69459.c: New test.
Kyrylo Tkachov [Fri, 22 Jan 2016 15:42:30 +0000 (15:42 +0000)]
[ARM] Fix PR target/69403: Bug in thumb2_ior_scc_strict_it pattern
Backport from mainline
2016-01-22 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/69403
* config/arm/thumb2.md (*thumb2_ior_scc_strict_it): Convert to
define_insn_and_split. Ensure operands[1] and operands[0] do not
get assigned the same register.
Bernd Schmidt [Fri, 22 Jan 2016 14:49:22 +0000 (14:49 +0000)]
Backport PR63681 fix
PR target/63681
* cfgrtl.c (cfg_layout_initialize): Weaken assert to only trigger if
flag_reorder_blocks_and_partition.
* hw-doloop.c (reorg_loops): Avoid reordering if that flag is set.
James Greenhalgh [Tue, 12 Jan 2016 14:04:26 +0000 (14:04 +0000)]
Backport: [Patch AArch64] Reinstate CANNOT_CHANGE_MODE_CLASS to fix pr67609
gcc/
Backport from mainline.
2015-12-09 James Greenhalgh <james.greenhalgh@arm.com>
PR rtl-optimization/67609
* config/aarch64/aarch64.c
(aarch64_cannot_change_mode_class): Don't permit word_mode
subregs of full vector modes.
* config/aarch64/aarch64.md (aarch64_movdi_<mode>low): Use
zero_extract rather than truncate.
(aarch64_movdi_<mode>high): Likewise.
gcc/testsuite/
Backport from mainline.
2015-12-09 James Greenhalgh <james.greenhalgh@arm.com>
Martin Jambor [Mon, 11 Jan 2016 09:59:48 +0000 (10:59 +0100)]
[PR 66616] Check for thunks when adding extra constants to clones
2016-01-11 Martin Jambor <mjambor@suse.cz>
PR ipa/66616
* ipa-cp.c (propagate_constants_accross_call): Move thuk check...
(call_passes_through_thunk_p): ...here.
(find_more_scalar_values_for_callers_subset): Perform thunk checks
like propagate_constants_accross_call does.
* cgraphclones.c (duplicate_thunk_for_node): Copy can_change_signature
flag from the node to the new flag.