aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2019-07-24PR tree-optimization/91183 - strlen of a strcpy result with a conditional ↵Martin Sebor11-100/+1035
source not folded PR tree-optimization/91183 - strlen of a strcpy result with a conditional source not folded PR tree-optimization/86688 - missing -Wstringop-overflow using a non-string local array in strnlen with excessive bound gcc/ChangeLog: PR tree-optimization/91183 PR tree-optimization/86688 * builtins.c (compute_objsize): Handle MEM_REF. * tree-ssa-strlen.c (class ssa_name_limit_t): New. (get_min_string_length): Remove. (count_nonzero_bytes): New function. (handle_char_store): Rename... (handle_store): to this. Handle multibyte stores via integer types. (strlen_check_and_optimize_stmt): Adjust conditional and the called function name. gcc/testsuite/ChangeLog: PR tree-optimization/91183 PR tree-optimization/86688 * gcc.dg/Wstringop-overflow-14.c: New test. * gcc.dg/attr-nonstring-2.c: Remove xfails. * gcc.dg/strlenopt-70.c: New test. * gcc.dg/strlenopt-71.c: New test. * gcc.dg/strlenopt-72.c: New test. * gcc.dg/strlenopt-8.c: Remove xfails. From-SVN: r273783
2019-07-25Daily bump.GCC Administrator1-1/+1
From-SVN: r273782
2019-07-24Fix non-GNU style in previous commitsJozef Lawrynowicz3-3/+10
2019-07-24 Jozef Lawrynowicz <jozef.l@mittosystems.com> * config.gcc (msp430*-*-*): Fix non-GNU style in r273774. * config/msp430/msp430.h (ENDFILE_SPEC): Fix non-GNU style in r273773. From-SVN: r273775
2019-07-24config.gcc (msp430*-*-*): Enable initfini_array by default unless explicitly ↵Jozef Lawrynowicz2-0/+11
disabled with... 2019-07-24 Jozef Lawrynowicz <jozef.l@mittosystems.com> * config.gcc (msp430*-*-*): Enable initfini_array by default unless explicitly disabled with --disable-initfini-array. From-SVN: r273774
2019-07-24msp430.h (ENDFILE_SPEC): Wrap uses of crtn*.o in if-exists.Jozef Lawrynowicz2-1/+6
2019-07-24 Jozef Lawrynowicz <jozef.l@mittosystems.com> * config/msp430/msp430.h (ENDFILE_SPEC): Wrap uses of crtn*.o in if-exists. From-SVN: r273773
2019-07-24PR driver/80545 - option -Wstringop-overflow not recognized by FortranMartin Sebor13-20/+167
gcc/cp/ChangeLog: PR driver/80545 * decl.c (finish_function): Use lang_mask. gcc/testsuite/ChangeLog: PR driver/80545 * gcc.misc-tests/help.exp: Add tests. * lib/options.exp: Handle C++. gcc/ChangeLog: PR driver/80545 * diagnostic.c (diagnostic_classify_diagnostic): Use lang_mask. (diagnostic_report_diagnostic): Same. * diagnostic.h (diagnostic_context::option_enabled): Add an argument. (diagnostic_context::lang_mask): New data member. * ipa-pure-const.c (suggest_attribute): Use lang_hooks.option_lang_mask (). * opts-common.c (option_enabled): Handle new argument. (get_option_state): Pass an additional argument. * opts.c (print_filtered_help): Print supported languages for unsupported options. Adjust printing of current state. * opts.h (option_enabled): Add argument. * toplev.c (print_switch_values): Use lang_mask. (general_init): Set global_dc->lang_mask. From-SVN: r273771
2019-07-24[Darwin] Partial reversion of 273749.Iain Sandoe2-1/+33
We still need to cater for pr80556, for the single-arch case. 2019-07-24 Iain Sandoe <iain@sandoe.co.uk> gcc/ PR bootstrap/87030 * config/i386/darwin.h (REAL_LIBGCC_SPEC): Revert r273749. From-SVN: r273768
2019-07-24cgraphunit.c (symbol_table::compile): Start and stop TV_CGRAPH_IPA_PASSES ↵Giuliano Belinassi3-1/+16
and TV_CGRAPH_FUNC_EXPANSION timers. * cgraphunit.c (symbol_table::compile): Start and stop TV_CGRAPH_IPA_PASSES and TV_CGRAPH_FUNC_EXPANSION timers. * timevar.def (TV_CGRAPH_IPA_PASSES, TV_CGRAPH_FUNC_EXPANSION): New. From-SVN: r273767
2019-07-24gimplify.c (flag_instrument_functions_exclude_p): Include namespace/class ↵Oliver Browne3-1/+10
information in the printable name. * gimplify.c (flag_instrument_functions_exclude_p): Include namespace/class information in the printable name. * opts.c (add_comma_separated_to_vector): Add NUL terminator to tokens entered into the vector. From-SVN: r273766
2019-07-24tree-nested.c (build_simple_mem_ref_notrap): New function.Eric Botcazou2-7/+25
* tree-nested.c (build_simple_mem_ref_notrap): New function. (get_static_chain): Call it instead of build_simple_mem_ref. (get_frame_field): Likewise. (get_nonlocal_debug_decl): Likewise. (convert_nonlocal_reference_op): Likewise. From-SVN: r273763
2019-07-24[ARC] Fix and refurbish the interrupts.Claudiu Zissulescu13-355/+713
When entering an interrupt, not only the call save registers needs to be place on stack but also the call clobbers one. More over, the ARC700 return from interrupt instruction needs to be rtie, the same like ARCv2 CPUs. While the ARC6xx family uses j.f [ilinkX] instruction. Additionally, we need to save the state of the ZOL machinery, namely the lp_count, lp_end and lp_start registers. For architectures which are using extension registers (i.e., HS48) we need to save/restore them as well. gcc/ xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * config/arc/arc-protos.h (arc_output_function_epilogue): Delete declaration. (arc_compute_frame_size): Millicode is disabled when compiling ISR. (arc_return_address_register): Likewise. (arc_compute_function_type): Likewise. (arc_compute_frame_size): Likewise. (secondary_reload_info): Likewise. (arc_get_unalign): Likewise. (arc_can_use_return_insn): Declare. * config/arc/arc.c (AUX_LP_START): Define (AUX_LP_END): Likewise. (arc_frame_info): Update gmask member to 64-bit datum. (GMASK_LEN): Update. (arc_compute_function_type): Make it static, move it forward. (arc_must_save_register): Update, consider the extra regs. (arc_compute_millicode_save_restore_regs): Update to use the 64 bit gmask. (arc_compute_frame_size): Likewise. (arc_enter_leave_p): Likewise. (arc_save_callee_saves): Likewise. (arc_restore_callee_saves): Likewise. (arc_save_callee_enter): Likewise. (arc_restore_callee_leave): Likewise. (arc_save_callee_milli): Likewise. (arc_restore_callee_milli): Likewise. (arc_expand_prologue): Add new interrupt handling. (arc_return_address_register): Make it static, move it forward. (arc_expand_epilogue): Add new interrupt handling. (arc_get_unalign): Delete. (arc_epilogue_uses): Make sure we do not remove the extra saved/restored registers when interrupt. (arc_can_use_return_insn): New function. (push_reg): Likewise. (pop_reg): Likewise. (arc_save_callee_saves): Add ZOL and FPX aux registers saving procedures. (arc_restore_callee_saves): Likewise, but restoring. * config/arc/arc.md (VUNSPEC_ARC_ARC600_RTIE): Define. (R33_REG): Likewise. (R34_REG): Likewise. (R35_REG): Likewise. (R36_REG): Likewise. (R37_REG): Likewise. (R38_REG): Likewise. (R39_REG): Likewise. (R45_REG): Likewise. (R46_REG): Likewise. (R47_REG): Likewise. (R48_REG): Likewise. (R49_REG): Likewise. (R50_REG): Likewise. (R51_REG): Likewise. (R52_REG): Likewise. (R53_REG): Likewise. (R54_REG): Likewise. (R55_REG): Likewise. (R56_REG): Likewise. (R58_REG): Likewise. (type): Add rtie attribute. (in_call_delay_slot): Use RETURN_ADDR_REGNUM. (movsi_insn): Accept moves to lp_count. (rtie): Update pattern. (simple_return): Simplify it, don't use this pattern as a return from an interrupt. (arc600_rtie): New pattern. (p_return_i): Clean up. (return): Likewise. * config/arc/builtins.def (rtie): Only available for non ARC6xx family CPUs. * config/arc/predicates.md (move_src_operand): Consider lp_count as a register. gcc/testsuite xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * gcc.target/arc/arc.exp (check_effective_target_accregs): New predicate. * gcc.target/arc/builtin_special.c: Update test/ * gcc.target/arc/interrupt-1.c: Likewise. * gcc.target/arc/interrupt-10.c: New test. * gcc.target/arc/interrupt-11.c: Likewise. * gcc.target/arc/interrupt-12.c: Likewise. update From-SVN: r273761
2019-07-24S/390: Add add/sub/mul overflow check patternsAndreas Krebbel10-0/+466
This patch implements the addv, subv, and mulv patterns for signed integers. gcc/ChangeLog: 2019-07-24 Andreas Krebbel <krebbel@linux.ibm.com> * config/s390/predicates.md (addv_const_operand): New predicate. * config/s390/s390-modes.def (CCO): New condition code mode. * config/s390/s390.c (s390_match_ccmode_set): Handle E_CCOmode. (s390_branch_condition_mask): Likewise. * config/s390/s390.md ("addv<mode>4", "subv<mode>4") ("mulv<mode>4"): New expanders. ("*addv<mode>3_ccoverflow", "*addv<mode>3_ccoverflow_const") ("*subv<mode>3_ccoverflow", "*mulv<mode>3_ccoverflow"): New pattern definitions. gcc/testsuite/ChangeLog: 2019-07-24 Andreas Krebbel <krebbel@linux.ibm.com> * gcc.target/s390/addsub-signed-overflow-1.c: New test. * gcc.target/s390/addsub-signed-overflow-2.c: New test. * gcc.target/s390/mul-signed-overflow-1.c: New test. * gcc.target/s390/mul-signed-overflow-2.c: New test. From-SVN: r273759
2019-07-24re PR middle-end/91166 ([SVE] Unfolded ZIPs of constants)Prathamesh Kulkarni4-1/+47
2019-07-24 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> PR middle-end/91166 * match.pd (vec_perm_expr(v, v, mask) -> v): New pattern. (define_predicates): Add entry for uniform_vector_p. (vec_same_elem_p): New match pattern. testsuite/ * gcc.target/aarch64/sve/pr91166.c: New test. From-SVN: r273758
2019-07-24Fixup ChangeLog entry for revision 273570.Bin Cheng2-2/+2
From-SVN: r273756
2019-07-24Daily bump.GCC Administrator1-1/+1
From-SVN: r273753
2019-07-23[Darwin] Fix PR87030 add missed commit hunks.Iain Sandoe7-44/+76
Messed up the commit, and missed changes to gcc/config.gcc and to the comments in some of the headers. 2019-07-24 Iain Sandoe <iain@sandoe.co.uk> gcc/ PR bootstrap/87030 * config/i386/darwin.h (REAL_LIBGCC_SPEC): Move from here... * config/i386/darwin32-biarch.h .. to here. * config/i386/darwin64-biarch.h: Adjust comments. * config/rs6000/darwin32-biarch.h: Likewise. * config/rs6000/darwin64-biarch.h: Likewise. * config.gcc: Missed commit from r273746 (*-*-darwin*): Don't include CPU t-darwin here. (i[34567]86-*-darwin*): Adjust to use biarch files. Produce an error message if i686-darwin configuration is attempted for Darwin >= 18. From-SVN: r273749
2019-07-23re PR fortran/54072 (BOZ with -std=f2008: wrongly accepted to ↵Steven G. Kargl5-7/+51
TRANSFER/ABS/...; two BOZ not rejected for IOR/IEOR/IAND) 2019-07-23 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/54072 * check.c (gfc_invalid_boz): Fix comment. (illegal_boz_arg): New function. (gfc_check_transfer): Use to arguments. (gfc_check_storage_size): Ditto. (gfc_check_complex): Remove leftover comment from BOZ patch. * primary.c (match_boz_constant): Remove leftover comment. 2019-07-23 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/54072 * gfortran.dg/illegal_boz_arg_1.f90: New tests. From-SVN: r273748
2019-07-23arith.c (gfc_convert_integer, [...]): Move to ...Steven G. Kargl63-549/+1034
2019-07-23 Steven G. Kargl <kargl@gcc.gnu.org> * arith.c (gfc_convert_integer, gfc_convert_real, gfc_convert_complex): Move to ... * primary.c (convert_integer, convert_real, convert_complex): ... here. Rename and make static functions. (match_integer_constant): Use convert_integer (match_real_constant): Use convert_real. (match_complex_constant: Use convert_complex. * arith.h (gfc_convert_integer, gfc_convert_real, gfc_convert_complex): Remove prototypes. * array.c (match_array_cons_element): A BOZ cannot be a data statement value. Jump to a common exit point. * check.c (gfc_invalid_boz): New function. Emit error or warning for a BOZ in an invalid context. (boz_args_check): Move to top of file to prevent need of forward declaration. (is_boz_constant): New function. Check that BOZ expr is constant. (gfc_b z2real): New function. In-place conversion of BOZ literal constant to REAL in accordance to F2018. (gfc_boz2int): New function. In-place conversion of BOZ literal onstant to INTEGER in accordance to F2018. (gfc_check_achar, gfc_check_char, gfc_check_float): Use gfc_invalid_boz. Convert BOZ as needed. (gfc_check_bge_bgt_ble_blt): Enforce F2018 requirements on BGE, BGT, BLE, and BLT intrinsic functions. (gfc_check_cmplx): Re-organize to check kind, if present, first. Convert BOZ real and/or imaginary parts as needed in accordance to F2018. (gfc_check_complex): Use gfc_invalid_boz. Convert BOZ as needed. (gfc_check_dcmplx, gfc_check_dble ): Convert BOZ as needed. (gfc_check_dshift): Make dshift[lr] conform to F2018 standard. gfc_check_float (gfc_expr *a) (gfc_check_iand_ieor_ior): Make IAND, IEOR, and IOR conform to F2018 standard. (gfc_check_int): Conform to F2018 standard. (gfc_check_intconv): Deprecate SHORT and LONG aliases for INT2 and INT. Simply return for a BOZ argument. See gfc_simplify_intconv. (gfc_check_merge_bits): Make MERGE_BITS conform to Fortran 2018 standard. (gfc_check_real): Remove incorrect comment. Check kind, if present, first. Simply return for a BOZ argument. See gfc_simplify_real. (gfc_check_and): Re-do error handling for BOZ arguments. Remove special casing ts.type != BT_INTEGER or BT_LOGICAL. * decl.c (match_old_style_init): Check for BOZ in old-style initialization. Issue error or warning depending on -fallow-invalid-boz option. Issue error if variable is not an INTEGER or REAL and the value is BOZ. * expr.c (gfc_copy_expr): Copy a BT_BOZ gfc_expr. (gfc_check_assign): Re-do error handling for a BOZ in an assignment statement. Do in-place conversion of RHS based on LHS type of INTEGER or REAL. * gfortran.h (gfc_expr): Add a boz component. Remove is_boz component. (gfc_boz2int, gfc_boz2real, gfc_invalid_boz): New prototypes. * interface.c (gfc_extend_assign): Guard against replacing an intrinsic involving a BOZ literal constant on RHS. * invoke.texi: Doument -fallow-invalid-boz. * lang.opt: New option. -fallow-invalid-boz. * libgfortran.h (bt): Elevate BOZ to a basic type. * misc.c (gfc_basic_typename, gfc_typename): Translate BT_BOZ to BOZ. * primary.c (convert_integer, convert_real, convert_complex): to here. Rename and make static functions. * primary.c(match_boz_constant): Rewrite parsing of a BOZ. Re-do error handling. Deprecate 'X' for hexidecimal and postfix notation. Use -fallow-invalid-boz and gfc_invalid_boz to accept deprecated code. * resolve.c (resolve_ordinary_assign): Rework a RHS that is a BOZ literal constant. Use gfc_invalid_boz to allow previous nonstandard behavior. Remove range checking of BOZ conversion. * simplify.c (convert_boz): Remove function. (simplify_cmplx): Remove conversion of BOZ constants, because conversion is done in gfc_check_cmplx. (gfc_simplify_float): Remove conversion of BOZ constant, because conversion is done in gfc_check_float. (simplify_intconv): Use gfc_boz2int to convert BOZ to INTEGER. Remove range checking for BOZ conversion. (gfc_simplify_real): Use k, if present, to determine kind. Convert BOZ to REAL. Remove range checking for BOZ conversion. target-memory.c (gfc_convert_boz): Rewrite to deal with convert of a BOZ to a REAL value. 2019-07-23 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.dg/achar_5.f90: Fix for new BOZ handling. * arithmetic_overflow_1.f90: Ditto. * gfortran.dg/boz_11.f90: Ditto. * gfortran.dg/boz_12.f90: Ditto. * gfortran.dg/boz_4.f90: Ditto. * gfortran.dg/boz_5.f90: Ditto. * gfortran.dg/boz_6.f90: Ditto. * gfortran.dg/boz_7.f90: Ditto. * gfortran.dg/boz_8.f90: Ditto. * gfortran.dg/dec_structure_6.f90: Ditto. * gfortran.dg/dec_union_1.f90: Ditto. * gfortran.dg/dec_union_2.f90: Ditto. * gfortran.dg/dec_union_5.f90: Ditto. * gfortran.dg/dshift_3.f90: Ditto. * gfortran.dg/gnu_logical_2.f90: Ditto. * gfortran.dg/int_conv_1.f90: Ditto. * gfortran.dg/ishft_1.f90: Ditto. * gfortran.dg/nan_4.f90: Ditto. * gfortran.dg/no_range_check_3.f90: Ditto. * gfortran.dg/pr16433.f: Ditto. * gfortran.dg/pr44491.f90: Ditto. * gfortran.dg/pr58027.f90: Ditto. * gfortran.dg/pr81509_2.f90: Ditto. * gfortran.dg/unf_io_convert_1.f90: Ditto. * gfortran.dg/unf_io_convert_2.f90: Ditto. * gfortran.fortran-torture/execute/intrinsic_fraction_exponent.f90: Ditto. * gfortran.fortran-torture/execute/intrinsic_mvbits.f90: Ditto. * gfortran.fortran-torture/execute/intrinsic_nearest.f90: Ditto. * gfortran.fortran-torture/execute/seq_io.f90: Ditto. * gfortran.dg/gnu_logical_1.F: Delete test. * gfortran.dg/merge_bits_3.f90: New test. * gfortran.dg/merge_bits_3.f90: Ditto. * gfortran.dg/boz_int.f90: Ditto. * gfortran.dg/boz_bge.f90: Ditto. * gfortran.dg/boz_complex_1.f90: Ditto. * gfortran.dg/boz_complex_2.f90: Ditto. * gfortran.dg/boz_complex_3.f90: Ditto. * gfortran.dg/boz_dble.f90: Ditto. * gfortran.dg/boz_dshift_1.f90: Ditto. * gfortran.dg/boz_dshift_2.f90: Ditto. * gfortran.dg/boz_float_1.f90: Ditto. * gfortran.dg/boz_float_2.f90: Ditto. * gfortran.dg/boz_float_3.f90: Ditto. * gfortran.dg/boz_iand_1.f90: Ditto. * gfortran.dg/boz_iand_2.f90: Ditto. 2019-07-23 Steven G. Kargl <kargl@gcc.gnu.org> * testsuite/libgomp.fortran/reduction4.f90: Update BOZ usage * testsuite/libgomp.fortran/reduction5.f90: Ditto. From-SVN: r273747
2019-07-23[Darwin] Fix PR87030 and tidy config fragments.Iain Sandoe11-12/+127
This is about 32/64b host and multilib support across the range of Darwin systems. Prior to Darwin8 (OS X 10.4), the toolchains support only PowerPC and only 32b. On Darwin8 it is possible to target a 64b multilib, but with support limited to a few of the main libraries on the system (not a recommended configuration). From Darwin9 to Darwin17 (OSX 10.5 to 10.13) it is possible to have either 32 or 64b hosted toolchains, with support for a 64 or 32b multilib respectively. On Darwin9 the kernel is 32b, but with support for 64b executables, so it's conventional to build a 32b host toolchain supporting a 64b multilib. However this is not enforced (merely a convention). There is also some platform hardware supporting Darwin10/11 which is only 32b and for which the same situation applies. However, from Darwin10 to Darwin17, the majority of platform hardware supports a 64b kernel and it's conventional to build a 64b host toolchain with support for a 32b multilib. On/from Darwin18 (OS X 10.14), the development headers (in the SDK) no longer expose the interfaces for the 32b multilib support (although sufficient runtime support remains installed that the testsuite can be run for a 32b multilib). The PR is raised against this latter situation since the absence of exposed interfaces causes a 'default' bootstrap fail regardless of the availability of the runtimes. Given the number of permutations, I felt it warranted a general solution, especially since the current scheme of target headers and t-make fragments has become somewhat messy. The changes here enforce the single 32b PowerPC multilib for Darwin < 8 and the single X86 64b multilib for Darwin >= 18. This means that there is no longer any need to configure Darwin18+ '--disable-multilib', but also that if you want to use the ability to continue to test the compiler's 32b multilib there, you need to make a configuration targeting an earlier OS version (and using the SDK from that). gcc/ PR bootstrap/87030 * config.gcc (*-*-darwin*): Don't include CPU t-darwin here. (i[34567]86-*-darwin*): Adjust to use biarch files. Produce an error message if i686-darwin configuration is attempted for Darwin >= 18. (x86_64-*-darwin*): Switch to single multilib for Darwin >= 18. (powerpc-*-darwin*): Use biarch files where needed. (powerpc64-*-darwin*): Likewise. * config/i386/darwin.h (REAL_LIBGCC_SPEC): Move to new biarch file. (DARWIN_ARCH_SPEC, DARWIN_SUBARCH_SPEC): Revise for default single arch case. * config/i386/darwin32-biarch.h: New. * config/i386/darwin64.h: Rename. * gcc/config/i386/darwin64-biarch.h: To this. * config/i386/t-darwin: Rename. * gcc/config/i386/t-darwin32-biarch: To this. * config/i386/t-darwin64: Rename. * gcc/config/i386/t-darwin64-biarch: To this. * config/rs6000/darwin32-biarch.h: New. * config/rs6000/darwin64.h: Rename. * config/rs6000/darwin64-biarch.h: To this. (DARWIN_ARCH_SPEC, DARWIN_SUBARCH_SPEC): Revise for default single arch case. * config/rs6000/t-darwin8: Rename. * config/rs6000/t-darwin32-biarch: To this. * config/rs6000/t-darwin64 Rename. * config/rs6000/t-darwin64-biarch: To this. From-SVN: r273746
2019-07-23Add PR markers to recent DSE changes. And...Jeff Law3-0/+27
PR tree-optimization/86061 * gcc.dg/tree-ssa/pr86061.c: New test. From-SVN: r273745
2019-07-23compiler: use correct value type in 2-case select sendIan Lance Taylor2-3/+4
In the channel-send case, the value to be sent may needs an (implicit) type conversion to the channel element type. This CL ensures that we use the correct value type for the send. Fixes golang/go#33235. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/187177 From-SVN: r273743
2019-07-23configure.ac (ACX_PROG_CXX_WARNING_OPTS): Revert r273311.Martin Sebor2-4/+9
gcc/ChangeLog: * configure.ac (ACX_PROG_CXX_WARNING_OPTS): Revert r273311. From-SVN: r273742
2019-07-23gdbinit.in: add reload-gdbhooks (rh) commandVladislav Ivanishin2-0/+15
gcc/ChangeLog: 2019-07-23 Vladislav Ivanishin <vlad@ispras.ru> * gdbinit.in (reload-gdbhooks): New command with an attached doc string. (rh): New alias for it. From-SVN: r273738
2019-07-23make gdbhooks.py idempotent with respect to reloadingVladislav Ivanishin2-1/+7
gcc/ChangeLog: 2019-07-23 Vladislav Ivanishin <vlad@ispras.ru> * gdbhooks.py: Pass replace=True to gdb.printing.register_pretty_printer. From-SVN: r273737
2019-07-23re PR debug/91231 (ICE in dwarf2out_inline_entry, at dwarf2out.c:27642)Richard Biener2-0/+14
2019-07-23 Richard Biener <rguenther@suse.de> PR debug/91231 * lto-streamer-in.c (input_function): Drop inline-entry markers that ended up with an unknown location block. From-SVN: r273733
2019-07-23re PR tree-optimization/83518 (Missing optimization: useless instructions ↵Richard Biener6-5/+73
should be dropped) 2019-07-23 Richard Biener <rguenther@suse.de> PR tree-optimization/83518 * tree-ssa-sccvn.c (vn_reference_lookup_3): Handle aggregate init from a constant even when partial defs are already recorded. c/ * gimple-parser.c (c_parser_parse_gimple_body): When we have a CFG also rebuild cgraph edges. * gcc.dg/tree-ssa/ssa-fre-79.c: New testcase. From-SVN: r273732
2019-07-23i386-common.c: Use PROCESSOR_ZNVER2 scheduler for znver2.Jan Hubicka3-176/+411
* i386-common.c: Use PROCESSOR_ZNVER2 scheduler for znver2. * config/i386/znver1.md: Enable patterns for znver2 and add store variants which use extra AGU unit. From-SVN: r273731
2019-07-23i386-options.c (ix86_option_override_internal): Default ↵Jan Hubicka1-1/+5
PARAM_AVOID_FMA_MAX_BITS to 256 for znver2. * config/i386/i386-options.c (ix86_option_override_internal): Default PARAM_AVOID_FMA_MAX_BITS to 256 for znver2. From-SVN: r273730
2019-07-23* config/i386/x86-tune.def (X86_TUNE_AVOID_256FMA_CHAINS): Set of ZNVER2.Jan Hubicka2-0/+11
From-SVN: r273729
2019-07-23x86-tune-costs.h (znver2_memcpy): Update.Jan Hubicka2-6/+11
* config/i386/x86-tune-costs.h (znver2_memcpy): Update. (znver2_costs): Update 256 bit SSE costs and multiplication. From-SVN: r273728
2019-07-23[Ada] Aspect CPU may depend on a discriminant of a task typeEd Schonberg4-0/+32
2019-07-23 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations, Freeze_Entity_Checks): Include Aspect_CPU with other aspects whose expresssion may depend on a discriminant, and thus require that components of the type be made visible. gcc/testsuite/ * gnat.dg/task4.adb: New testcase. From-SVN: r273726
2019-07-23[Ada] Plug small loophole in Generate_Range_CheckEric Botcazou5-35/+75
The Generate_Range_Check routine is responsible for generating range checks in the scalar case. It automatically deals with possible overflow in the process when the source and the target base types are different. However there is one case where overflow is not dealt with correctly, namely when the target base type is narrower than the source base type and both are floating-point types. In this case, the routine will convert the source type to the target base type without checking for overflow. In practice this does not matter much because the conversion would yield an infinity on overflow, which would then fail the subsequent range check. However it's more correct to have a proper overflow check with -gnateF than relying on the infinity. 2019-07-23 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * checks.adb (Convert_And_Check_Range): Add Suppress parameter and pass it in the call to Insert_Actions. Rename local variable. (Generate_Range_Check): Minor comment fixes. Pass Range_Check in the first call to Convert_And_Check_Range and All_Checks in the second call. * exp_ch4.adb (Expand_N_Type_Conversion): Reset the Do_Overflow_Check flag in the float-to-float case too if there is also a range check. gcc/testsuite/ * gnat.dg/range_check5.adb: New testcase. From-SVN: r273725
2019-07-23[Ada] Eliminate redundant overflow checks for conversions from fixed-pointEric Botcazou3-6/+13
This eliminates redundant overflow checks that are generated for conversions from fixed-point to integer types when range checks are also enabled (which is the default), as the former checks are subsumed into the latter checks. No functional changes. 2019-07-23 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * checks.adb (Activate_Overflow_Check): Remove redundant argument. * exp_ch4.adb (Discrete_Range_Check): Reset the overflow flag. (Expand_N_Type_Conversion): Do not reset it here. From-SVN: r273724
2019-07-23[Ada] Minor tweak to -gnatR outputEric Botcazou2-6/+11
This makes sure that the numbers present in the -gnatR output are printed in decimal format in all cases, since the hexadecimal format is not compatible with the JSON syntax. 2019-07-23 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * repinfo.adb (List_Component_Layout): Pass Decimal to UI_Write. (Write_Val): Likewise. From-SVN: r273723
2019-07-23[Ada] Iterators are view-specificEd Schonberg7-3/+87
Operational aspects, such as Default_Iterator, are view-specific, and if such an aspect appears on the full view of a private type, an object of the type cannot be iterated upon if it is not in the scope of the full view, This patch diagnoses properly an attempt to iterate over such an object. 2019-07-23 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * aspects.ads: New table Operational_Aspect, used to distinguish between aspects that are view-specific, such as those related to iterators, and representation aspects that apply to all views of a type. * aspects.adb (Find_Aspect): If the aspect being sought is operational, do not ecamine the full view of a private type to retrieve it. * sem_ch5.adb (Analyze_Iterator_Specification): Improve error message when the intended domain of iteration does not implement the required iterator aspects. gcc/testsuite/ * gnat.dg/iter5.adb: Add an expected error. * gnat.dg/iter6.adb: New testcase. From-SVN: r273722
2019-07-23[Ada] Issue error on SPARK ownership rule violationYannick Moy3-13/+62
A modified rule in SPARK RM specifies that object declarations of anonymous access type should only occur immediately in subprogram, entry or block. Now checked. There is no impact on compilation. 2019-07-23 Yannick Moy <moy@adacore.com> gcc/ada/ * sem_spark.ads (Is_Local_Context): New function. * sem_spark.adb (Check_Declaration): Issue errors on violations of SPARK RM 3.10(4) (Process_Path): Do not issue error on borrow/observe during elaboration, as these are caught by the new rule. From-SVN: r273721
2019-07-23[Ada] Fix binding of ghost units with finalizerYannick Moy6-0/+43
Linking of an enabled ghost unit which requires a finalizer lead to an error, as the name generated by the binder for calling the finalizer was not the same as the name chosen by the compiler. Now fixed. 2019-07-23 Yannick Moy <moy@adacore.com> gcc/ada/ * exp_ch7.adb (Create_Finalizer): Force finalizer not to be Ghost enabled. * exp_dbug.adb (Get_External_Name): Explain special case of Ghost finalizer. gcc/testsuite/ * gnat.dg/ghost6.adb, gnat.dg/ghost6_pkg.ads: New testcase. From-SVN: r273720
2019-07-23x86/AVX512: improve generated code for mask-to-vector-register conversionsJan Beulich2-6/+17
Conversion of comparison results to full vectors does, when VPMOVM2* are unavailable, not require any intermediate VMOVDQ{A,U}*: Simply use embedded masking on VPTERNLOG* right away, which is available with AVX512F (while VPMOVM2{D,Q} are available only with AVX512DQ). Note that the chosen immediate is only one of many possible ones; I was trying to make the insn here distinguishable from the pre-existing uses of vpternlog. gcc/ 2019-07-23 Jan Beulich <jbeulich@suse.com> * config/i386/sse.md (<avx512>_cvtmask2<ssemodesuffix><mode>): Require only AVX512F. (*<avx512>_cvtmask2<ssemodesuffix><mode>): Likewise. Add alternative expanding to vpternlog. From-SVN: r273719
2019-07-23Use -flto instead of -flto=N in DWARF producer string.Martin Liska2-0/+12
2019-07-23 Martin Liska <mliska@suse.cz> * dwarf2out.c (gen_producer_string): Canonize -flto=N to -flto in dwarf producer string. From-SVN: r273717
2019-07-23tree-cfg.c (label_for_bb): Remove global var.Richard Biener2-17/+25
2019-07-23 Richard Biener <rguenther@suse.de> * tree-cfg.c (label_for_bb): Remove global var. (main_block_label): Take label_for_bb as argument. (cleanup_dead_labels_eh): Likewise, adjust. (cleanup_dead_labels): Adjust. From-SVN: r273716
2019-07-23[rs6000] Add documentation for __builtin_mtfsfPaul A. Clarke2-1/+10
2019-07-22 Paul A. Clarke <pc@us.ibm.com> [gcc] * doc/extend.texi (Basic PowerPC Built-in Functions Available on all Configurations): Add documentation for __builtin_mtfsf. From-SVN: r273715
2019-07-22RISC-V: Add -malign-data= option.Ilia Diachkov6-8/+52
gcc/ Ilia Diachkov <ilia.diachkov@optimitech.com> * config/riscv/riscv-opts.h (struct riscv_align_data): New. * config/riscv/riscv.c (riscv_constant_alignment): Use riscv_align_data_type. * config/riscv/riscv.h (RISCV_EXPAND_ALIGNMENT): New. (DATA_ALIGNMENT): Use RISCV_EXPAND_ALIGNMENT. (LOCAL_ALIGNMENT): Use RISCV_EXPAND_ALIGNMENT. * config/riscv/riscv.opt (malign-data): New. * doc/invoke.texi (RISC-V Options): Document -malign-data=. From-SVN: r273714
2019-07-23compiler: follow-on fix for finalizing imported methodsIan Lance Taylor2-7/+9
This patch is a revision to CL 185518, which added code to perform finalization of methods on types created by the importer and not directly reachable until inlining is done. The original fix invoked the finalization code at the end of Import::read_types(), but it turns out this doesn't handle the case where a type with methods is read in due to a reference from something later in the export data (a function or variable). The fix is to move the import finalization call to the end of Import::import(). Testcase for this bug is in CL 187057. Fixes golang/go#33219. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/187058 From-SVN: r273713
2019-07-23Daily bump.GCC Administrator1-1/+1
From-SVN: r273712
2019-07-22cgraph.c (dump_graphviz): New function.Giuliano Belinassi7-20/+90
* cgraph.c (dump_graphviz): New function. * cgraph.h (dump_graphviz): New function. * symtab.c (dump_graphviz): New function. * lang.opt (flag_dump_callgraph): New flag. * lto-dump.c (dump_symtab_graphviz): New function. (dump_tool_help): New option. (lto_main): Handle graphviz dumping. From-SVN: r273708
2019-07-22[aarch64]: add usra and ssra combine patternsSylvia Taylor6-0/+102
This patch adds support to combine: 1) ushr and add into usra, example: ushr v0.16b, v0.16b, 2 add v0.16b, v0.16b, v2.16b --- usra v2.16b, v0.16b, 2 2) sshr and add into ssra, example: sshr v1.16b, v1.16b, 2 add v1.16b, v1.16b, v3.16b --- ssra v3.16b, v1.16b, 2 Committed on behalf of Sylvia Taylor <sylvia.taylor@arm.com>. Reviewed-by: <James.greenhalgh@arm.com> gcc/ChangeLog: * config/aarch64/aarch64-simd.md (*aarch64_simd_sra<mode>): New. * config/aarch64/iterators.md (SHIFTRT): New iterator. (sra_op): New attribute. gcc/testsuite/ChangeLog: * gcc.target/aarch64/simd/ssra.c: New test. * gcc.target/aarch64/simd/usra.c: New test. From-SVN: r273703
2019-07-22MSP430: Don't save all callee-saved regs in non-leaf interrupt functionsJozef Lawrynowicz8-5/+223
Previously, all callee-saved regs would unconditionally be saved in interrupt functions that call another function. 2019-07-22 Jozef Lawrynowicz <jozef.l@mittosystems.com> * config/msp430/msp430.c (msp430_preserve_reg_p): Don't save callee-saved regs R4->R10 in an interrupt function that calls another function. 2019-07-22 Jozef Lawrynowicz <jozef.l@mittosystems.com> * gcc.target/msp430/isr-push-pop-main.c: New test. * gcc.target/msp430/isr-push-pop-isr-430.c: Likewise. * gcc.target/msp430/isr-push-pop-isr-430x.c: Likewise. * gcc.target/msp430/isr-push-pop-leaf-isr-430.c: Likewise. * gcc.target/msp430/isr-push-pop-leaf-isr-430x.c: Likewise. From-SVN: r273702
2019-07-22[jit] check result_type in gcc_jit_context_new_unary_opAndrea Corallo7-8/+74
2019-07-22 Andrea Corallo <andrea.corallo@arm.com> * jit-recording.c (unary_op_reproducer_strings): Make it extern. (binary_op_reproducer_strings): Likewise. * jit-recording.h (unary_op_reproducer_strings): Likewise. (binary_op_reproducer_strings): Likewise. * libgccjit.c (gcc_jit_context_new_unary_op): Check result_type to be a numeric type. * libgccjit.c (gcc_jit_context_new_binary_op): Improve error message. 2019-07-22 Andrea Corallo <andrea.corallo@arm.com> * jit.dg/test-error-gcc_jit_context_new_unary_op-bad-res-type.c: New testcase. * jit.dg/test-error-gcc_jit_context_new_binary_op-bad-res-type.c: Adjust error message. From-SVN: r273700
2019-07-22[rs6000] Add _mm_blend_epi16 and _mm_blendv_epi8Paul A. Clarke7-0/+299
Add compatibility implementations of _mm_blend_epi16 and _mm_blendv_epi8 intrinsics. Respective test cases are copied almost verbatim (minor changes to the dejagnu head lines) from i386. 2019-07-22 Paul A. Clarke <pc@us.ibm.com> [gcc] * config/rs6000/smmintrin.h (_mm_blend_epi16): New. (_mm_blendv_epi8): New. [gcc/testsuite] * gcc.target/powerpc/sse4_1-check.h: New. * gcc.target/powerpc/sse4_1-pblendvb.c: New. * gcc.target/powerpc/sse4_1-pblendw.c: New. * gcc.target/powerpc/sse4_1-pblendw-2.c: New. From-SVN: r273698
2019-07-22[Ada] More complete information level for -gnatR4 outputEric Botcazou2-0/+12
This instructs -gnatR4 to also list the Etype of user-declared objects if it is compiler-generated, for example in: package P2 is Arr_V : array (1 .. 5) of Integer; end P2; 2019-07-22 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * repinfo.adb (List_Entities): Also list compiled-generated types present as Etype of objects. From-SVN: r273697