Backported from mainline
2017-11-25 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/81553
* combine.c (simplify_if_then_else): In (if_then_else COND (OP Z C1) Z)
to (OP Z (mult COND (C1 * STORE_FLAG_VALUE))) optimization, if OP
is a shift where C1 has different mode than the whole shift, use C1's
mode for MULT rather than the shift's mode.
* gcc.c-torture/compile/pr81553.c: New test.
From-SVN: r255717
Backported from mainline
2017-11-24 Jakub Jelinek <jakub@redhat.com>
PR fortran/81304
* trans-openmp.c (gfc_trans_omp_array_reduction_or_udr): Set
attr.implicit_type in intrinsic_sym to avoid undesirable warning.
* testsuite/libgomp.fortran/pr81304.f90: New test.
From-SVN: r255716
Backported from mainline
2017-11-24 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/83014
* ubsan.c (ubsan_type_descriptor): Use pp_unsigned_wide_integer
instead of pp_printf with HOST_WIDE_INT_PRINT_DEC. Avoid calling
tree_to_uhwi twice.
* gcc.dg/ubsan/pr83014.c: New test.
From-SVN: r255715
Backported from mainline
2017-11-24 Jakub Jelinek <jakub@redhat.com>
* tree-object-size.c (pass_through_call): Do not handle
BUILT_IN_STPNCPY_CHK which is not a pass through call.
* gcc.dg/builtin-object-size-18.c: New test.
From-SVN: r255714
Backported from mainline
2017-11-23 Jakub Jelinek <jakub@redhat.com>
* parser.c (cp_parser_omp_declare): Change return type to bool from
void, return true for declare simd.
(cp_parser_pragma): Return cp_parser_omp_declare returned value
rather than always false.
From-SVN: r255713
Backported from mainline
2017-11-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/82253
* expr.c (expand_assignment): For CONCAT to_rtx, complex type from and
bitpos/bitsize covering the whole destination, use store_expr only if
the complex mode is the same. Otherwise, use expand_normal and if
it returns CONCAT, subreg each part separately instead of trying to
subreg the whole result.
* gfortran.dg/pr82253.f90: New test.
From-SVN: r255711
Backported from mainline
2017-11-22 Jakub Jelinek <jakub@redhat.com>
PR debug/83084
* valtrack.c (propagate_for_debug_subst, propagate_for_debug): Reset
debug insns if they would contain UNSPEC_VOLATILE or volatile asm.
(dead_debug_insert_temp): Likewise, but also ignore even non-volatile
asm.
* g++.dg/opt/pr83084.C: New test.
From-SVN: r255710
Backported from mainline
2017-11-21 James Cowgill <James.Cowgill@imgtec.com>
Jakub Jelinek <jakub@redhat.com>
PR target/82880
* config/mips/frame-header-opt.c (mips_register_frame_header_opt):
Remove static keyword from f variable.
* gcc.dg/opts-8.c: New test.
From-SVN: r255709
Backported from mainline
2017-11-21 Jakub Jelinek <jakub@redhat.com>
PR c++/83059
* c-common.c (get_atomic_generic_size): Use TREE_INT_CST_LOW
instead of tree_to_uhwi, formatting fix.
* c-c++-common/pr83059.c: New test.
From-SVN: r255708
Backported from mainline
2017-11-20 Jakub Jelinek <jakub@redhat.com>
PR c++/82781
* constexpr.c (cxx_eval_vector_conditional_expression): New function.
(cxx_eval_constant_expression) <case VEC_COND_EXPR>: Use it instead
of cxx_eval_conditional_expression.
* g++.dg/ext/constexpr-pr82781.C: New test.
From-SVN: r255707
2017-12-15 Richard Biener <rguenther@suse.de>
PR bootstrap/83439
* tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
Adjust remaining gimple_set_modified to use the modified
variable instead.
From-SVN: r255704
2017-12-15 Richard Biener <rguenther@suse.de>
Backport from mainline
PR tree-optimization/82060
* tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
Move devirtualization after stmt folding and before EH/AB/noreturn
cleanup to get the stmt refs canonicalized. Use a bool instead
of gimple_modified_p since that doesn't work for NOPs. Schedule
NOPs generated by folding for removal.
* g++.dg/torture/pr82060.C: New testcase.
From-SVN: r255682
2017-12-15 Richard Biener <rguenther@suse.de>
Backport from mainline
2017-09-05 Richard Biener <rguenther@suse.de>
PR tree-optimization/82102
* tree-ssa-pre.c (eliminate): Check if lhs is NULL.
* gcc.dg/torture/pr82102.c: New testcase.
2017-09-13 Richard Biener <rguenther@suse.de>
PR middle-end/82128
* gimple-fold.c (gimple_fold_call): Update SSA name in-place to
default-def to avoid breaking iterator update with the weird
interaction with cgraph_update_edges_for_call_stmt_node.
* g++.dg/pr82128.C: New testcase.
From-SVN: r255678
2017-12-15 Richard Biener <rguenther@suse.de>
Backport from mainline
2017-11-24 Richard Biener <rguenther@suse.de>
PR tree-optimization/82402
* tree-vect-loop-manip.c (create_lcssa_for_virtual_phi): Properly
set SSA_NAME_OCCURS_IN_ABNORMAL_PHI.
* gcc.dg/torture/pr82402.c: New testcase.
2017-10-24 Richard Biener <rguenther@suse.de>
PR tree-optimization/82697
* tree-ssa-phiopt.c (cond_store_replacement): Use alias-set
zero for conditional load and unconditional store.
* gcc.dg/torture/pr82697.c: New testcase.
2017-11-02 Richard Biener <rguenther@suse.de>
PR middle-end/82765
* varasm.c (decode_addr_const): Make offset HOST_WIDE_INT.
Truncate ARRAY_REF index and element size.
* gcc.dg/pr82765.c: New testcase.
2017-11-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/82902
* tree-ssa-phiprop.c (propagate_with_phi): Test proper type.
* g++.dg/torture/pr82902.C: New testcase.
From-SVN: r255677
gcc/
Backport from mainline
2017-10-02 Peter Bergner <bergner@vnet.ibm.com>
PR target/80210
* config/rs6000/rs6000.c (rs6000_option_override_internal): Rewrite
function to not use the have_cpu variable. Do not set cpu_index,
rs6000_cpu_index or rs6000_tune_index if we end up using TARGET_DEFAULT
or the default cpu.
(rs6000_valid_attribute_p): Remove duplicate initializations of
old_optimize and func_optimize.
(rs6000_pragma_target_parse): Call rs6000_activate_target_options ().
(rs6000_activate_target_options): Make global.
* config/rs6000/rs6000-protos.h (rs6000_activate_target_options): Add
prototype.
gcc/testsuite/
Backport from mainline
2017-10-02 Peter Bergner <bergner@vnet.ibm.com>
PR target/80210
* gcc.target/powerpc/pr80210-2.c: New test.
From-SVN: r255655
PR libstdc++/59568
* include/std/complex (operator>>): Only use putback if a character
was successfully extracted and only set the value if a number was
successfully extracted.
* testsuite/26_numerics/complex/inserters_extractors/char/59568.cc:
New test.
From-SVN: r255633
gcc/
Backport from mainline
2017-12-13 Peter Bergner <bergner@vnet.ibm.com>
* config/rs6000/ppc-auxv.h (PPC_FEATURE2_HTM_NO_SUSPEND): New define.
* config/rs6000/rs6000.c (cpu_supports_info): Use it.
gcc/testsuite/
Backport from mainline
2017-12-13 Peter Bergner <bergner@vnet.ibm.com>
* gcc.target/powerpc/cpu-builtin-1.c (htm-no-suspend): Add test.
From-SVN: r255622
* gcc-interface/decl.c (gnat_to_gnu_entity): Robustify test for types
descendant of System.Address.
(gnat_to_gnu_subprog_type): Likewise.
From-SVN: r255600
[gcc]
2017-12-11 Michael Meissner <meissner@linux.vnet.ibm.com>
Back port from trunk
2017-12-01 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/81959
* config/rs6000/rs6000.c (rs6000_address_for_fpconvert): Check for
whether we can allocate pseudos before trying to fix an address.
* config/rs6000/rs6000.md (float_<mode>si2_hw): Make sure the
memory address is indexed or indirect.
(floatuns_<mode>si2_hw2): Likewise.
[gcct/testsuite]
2017-12-11 Michael Meissner <meissner@linux.vnet.ibm.com>
Back port from trunk
2017-12-01 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/81959
* gcc.target/powerpc/pr81959.c: New test.
From-SVN: r255545
ChangeLog entry are as follow:
*** gcc/ChangeLog ***
2017-12-11 Sudakshina Das <sudi.das@arm.com>
Backported from trunk
2017-12-01 Sudakshina Das <sudi.das@arm.com>
* config/arm/vfp.md (*movhf_vfp_fp16): Add conds attribute.
*** gcc/testsuite/ChangeLog ***
2017-12-11 Sudakshina Das <sudi.das@arm.com>
Backported from trunk
2017-12-01 Sudakshina Das <sudi.das@arm.com>
* gcc.target/arm/armv8_2-fp16-move-2.c: New test.
From-SVN: r255541
2017-12-10 Tom de Vries <tom@codesourcery.com>
backport from trunk:
2017-09-16 Tom de Vries <tom@codesourcery.com>
PR c/81875
* c-parser.c (c_parser_omp_for_loop): Fold only operands of cond, not
cond itself.
* testsuite/libgomp.c/pr81875.c: New test.
From-SVN: r255531
gcc/testsuite/ChangeLog:
2017-12-07 Kelvin Nilsen <kelvin@gcc.gnu.org>
Backport from trunk
2017-05-08 Kelvin Nilsen <kelvin@gcc.gnu.org>
PR target/80101
* gcc.target/powerpc/pr80101-1.c: New test.
gcc/ChangeLog:
2017-12-07 Kelvin Nilsen <kelvin@gcc.gnu.org>
Backport from trunk
2017-05-08 Kelvin Nilsen <kelvin@gcc.gnu.org>
PR target/80101
* config/rs6000/power6.md: Replace store_data_bypass_p calls with
rs6000_store_data_bypass_p in seven define_bypass directives and
in several comments.
* config/rs6000/rs6000-protos.h: Add prototype for
rs6000_store_data_bypass_p function.
* config/rs6000/rs6000.c (rs6000_store_data_bypass_p): New
function implements slightly different (rs6000-specific) semantics
than store_data_bypass_p, returning false rather than aborting
with assertion error when arguments do not satisfy the
requirements of store data bypass.
(rs6000_adjust_cost): Replace six calls of store_data_bypass_p with
rs6000_store_data_bypass_p.
From-SVN: r255465
2017-12-05 Max Filippov <jcmvbkbc@gmail.com>
Backport from mainline
2017-12-05 Max Filippov <jcmvbkbc@gmail.com>
* config/xtensa/xtensa.c (xtensa_asan_shadow_offset): New
function.
(TARGET_ASAN_SHADOW_OFFSET): New macro definition.
* config/xtensa/xtensa.h (FRAME_GROWS_DOWNWARD): Set to 1 if
ASAN is enabled.
From-SVN: r255422
gcc/
2017-12-05 Max Filippov <jcmvbkbc@gmail.com>
Backport from mainline
2017-05-08 Max Filippov <jcmvbkbc@gmail.com>
* config/xtensa/xtensa-protos.h
(xtensa_initial_elimination_offset): New declaration.
* config/xtensa/xtensa.c (xtensa_initial_elimination_offset):
New function. Move its body from the INITIAL_ELIMINATION_OFFSET
macro definition, add case for FRAME_POINTER_REGNUM when
FRAME_GROWS_DOWNWARD.
* config/xtensa/xtensa.h (FRAME_GROWS_DOWNWARD): New macro
definition.
(INITIAL_ELIMINATION_OFFSET): Replace body with call to
xtensa_initial_elimination_offset.
From-SVN: r255421
Add X86_TUNE_EMIT_VZEROUPPER to indicate if vzeroupper instruction should
be inserted before a transfer of control flow out of the function. It is
turned on by default unless we are tuning for KNL. Users can always use
-mzeroupper or -mno-zeroupper to override X86_TUNE_EMIT_VZEROUPPER.
2017-12-04 Sebastian Peryt <sebastian.peryt@intel.com>
H.J. Lu <hongjiu.lu@intel.com>
gcc/
Bakcported from trunk
PR target/82941
PR target/82942
PR target/82990
* config/i386/i386.c (pass_insert_vzeroupper): Remove
TARGET_AVX512F check from gate condition.
(ix86_check_avx256_register): Changed to ...
(ix86_check_avx_upper_register): ... this. Add extra check for
VALID_AVX512F_REG_OR_XI_MODE.
(ix86_avx_u128_mode_needed): Changed
ix86_check_avx256_register to ix86_check_avx_upper_register.
(ix86_check_avx256_stores): Changed to ...
(ix86_check_avx_upper_stores): ... this. Changed
ix86_check_avx256_register to ix86_check_avx_upper_register.
(ix86_avx_u128_mode_after): Changed
avx_reg256_found to avx_upper_reg_found. Changed
ix86_check_avx256_stores to ix86_check_avx_upper_stores.
(ix86_avx_u128_mode_entry): Changed
ix86_check_avx256_register to ix86_check_avx_upper_register.
(ix86_avx_u128_mode_exit): Ditto.
(ix86_option_override_internal): Set MASK_VZEROUPPER if
neither -mzeroupper nor -mno-zeroupper is used and
TARGET_EMIT_VZEROUPPER is set.
* config/i386/i386.h: (host_detect_local_cpu): New define.
(TARGET_EMIT_VZEROUPPER): New.
* config/i386/x86-tune.def: Add X86_TUNE_EMIT_VZEROUPPER.
2017-12-04 Sebastian Peryt <sebastian.peryt@intel.com>
H.J. Lu <hongjiu.lu@intel.com>
gcc/testsuite/
Backported from trunk
PR target/82941
PR target/82942
PR target/82990
* gcc.target/i386/pr82941-1.c: New test.
* gcc.target/i386/pr82941-2.c: Likewise.
* gcc.target/i386/pr82942-1.c: Likewise.
* gcc.target/i386/pr82942-2.c: Likewise.
* gcc.target/i386/pr82990-1.c: Likewise.
* gcc.target/i386/pr82990-2.c: Likewise.
* gcc.target/i386/pr82990-3.c: Likewise.
* gcc.target/i386/pr82990-4.c: Likewise.
* gcc.target/i386/pr82990-5.c: Likewise.
* gcc.target/i386/pr82990-6.c: Likewise.
* gcc.target/i386/pr82990-7.c: Likewise.
Co-Authored-By: H.J. Lu <hongjiu.lu@intel.com>
From-SVN: r255378
2017-12-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Backport from trunk
PR libgfortran/83168
* io/write.c (select_string): Bump size by one to avoid
overrun.
From-SVN: r255373
2017-12-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Dominique d'Humieres <dominiq@lps.ens.fr>
Backport from trunk
PR libgfortran/83191
* io/transfer.c (list_formatted_read_scalar): Do not set
namelist_mode bit here. (namelist_read): Likewise.
(data_transfer_init): Clear the mode bit here.
(finalize_transfer): Do set the mode bit just before any calls
to namelist_read or namelist_write. It can now be referred to
in complex_write.
* io/write.c (write_complex): Suppress the leading blanks when
namelist_mode bit is not set to 1.
* gfortran.dg/namelist_95.f90: New test.
Co-Authored-By: Dominique d'Humieres <dominiq@lps.ens.fr>
From-SVN: r255368