summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add ix86_check_ucontext_function_referencehjl/pr81842H.J. Lu2017-12-149-3/+203
|
* Daily bump.gccadmin2017-12-151-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255670 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libstdc++/83279 handle sendfile not copying entire fileredi2017-12-142-22/+49
| | | | | | | | PR libstdc++/83279 * src/filesystem/std-ops.cc (do_copy_file): Handle sendfile not copying entire file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255666 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libstdc++/68519 use native duration to avoid rounding errorsredi2017-12-143-2/+70
| | | | | | | | | PR libstdc++/68519 * include/std/condition_variable (condition_variable::wait_for): Convert duration to native clock's duration before addition. * testsuite/30_threads/condition_variable/members/68519.cc: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255665 138bc75d-0d04-0410-961f-82ee72b054a4
* 2017-12-14 Bill Schmidt <wschmidt@linux.vnet.ibm.com>wschmidt2017-12-142-1/+17
| | | | | | | | | | * gimple-ssa-strength-reduction.c (analyze_increments): Distinguish replacement costs for constant strides from those for unknown strides. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255664 138bc75d-0d04-0410-961f-82ee72b054a4
* * var-tracking.c (variable_tracking_main_1): Formatting fix.jakub2017-12-142-2/+6
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255663 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc:edlinger2017-12-1419-14/+258
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de> * doc/invoke.texi: Document -Wcast-function-type. * recog.h (stored_funcptr): Change signature. * tree-dump.c (dump_node): Avoid warning. * typed-splay-tree.h (typed_splay_tree): Avoid warning. libcpp: 2017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de> * internal.h (maybe_print_line): Change signature. c-family: 2017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de> * c.opt (Wcast-function-type): New warning option. * c-lex.c (get_fileinfo): Avoid warning. * c-ppoutput.c (scan_translation_unit_directives_only): Remove cast. c: 2017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de> * c-typeck.c (c_safe_arg_type_equiv_p, c_safe_function_type_cast_p): New function. (build_c_cast): Implement -Wcast-function-type. cp: 2017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de> * decl2.c (start_static_storage_duration_function): Avoid warning. * typeck.c (cxx_safe_arg_type_equiv_p, cxx_safe_function_type_cast_p): New function. (build_reinterpret_cast_1): Implement -Wcast-function-type. testsuite: 2017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de> * c-c++-common/Wcast-function-type.c: New test. * g++.dg/Wcast-function-type.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255661 138bc75d-0d04-0410-961f-82ee72b054a4
* 2017-12-14 Steve Ellcey <sellcey@cavium.com>sje2017-12-148-5/+94
| | | | | | | | | | | | | | | | * Makefile.am (IFUNC_OPTIONS): Change aarch64 option from -march=armv8.1-a to -march=armv8-a+lse. * configure.ac (*aarch64*): Check to see if compiler understands -march=armv8-a+lse option. * configure.tgt (*aarch64*): Only set try_ifunc if compiler understands -march=armv8-a+lse option. * Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. * configure: Regenerate. * aclocal.m4: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255659 138bc75d-0d04-0410-961f-82ee72b054a4
* Patch for middle-end/PR79538qinzhao2017-12-148-26/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | missing -Wformat-overflow with %s and non-member array arguments -Wformat-overflow uses the routine "get_range_strlen" to decide the maximum string length, however, currently "get_range_strlen" misses the handling of non-member arrays. Adding the handling of non-member array resolves the issue. Adding test case pr79538.c into gcc.dg. During gcc bootstrap, 2 source files (c-family/c-cppbuiltin.c, fortran/class.c) were detected new warnings by -Wformat-overflow due to the new handling of non-member array in "get_range_strlen". in order to avoid these new warnings and continue with bootstrap, updating these 2 files to avoid the warnings. in c-family/c-cppbuiltin.c, the warning is following: ../../latest_gcc_2/gcc/c-family/c-cppbuiltin.c:1627:15: note: ‘sprintf’ output 2 or more bytes (assuming 257) into a destination of size 256 sprintf (buf1, "%s=%s", macro, buf2); ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ in the above, buf1 and buf2 are declared as: char buf1[256], buf2[256]; i.e, buf1 and buf2 have same size. adjusting the size of buf1 and buf2 resolves the warning. fortran/class.c has the similar issue as above. Instead of adjusting size of the buffers, replacing sprintf with xasprintf is a better solution for these cases. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255654 138bc75d-0d04-0410-961f-82ee72b054a4
* * gcc-interface/Makefile.in: Generalize support for symbolic traces.ebotcazou2017-12-142-2/+32
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255653 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libstdc++/83427 detect weak result type from noexcept functionsredi2017-12-147-216/+209
| | | | | | | | | | | | | | | | | | | | | | | | | PR libstdc++/83427 * include/bits/refwrap.h (_Maybe_unary_or_binary_function): Move here from <bits/std_function.h>. (_Mem_fn_traits_base, _Mem_fn_traits): Move here, from <functional>. (_Weak_result_type_impl, _Reference_wrapper_base): Deduce noexcept for function types. Remove partial specializations for member functions. (_Weak_result_type_impl): Remove unused partial specializations for non-referenceable function types and for references to functions. (_Weak_result_type_memfun, _Reference_wrapper_base_memfun): New helpers to handle member functions via _Mem_fn_traits. (_Weak_result_type, reference_wrapper): Derive from new helpers. * include/bits/std_function.h (_Maybe_unary_or_binary_function): Move to <bits/refwrap.h>. * include/std/functional (_Pack, _AllConvertible, _NotSame): Remove. (_Mem_fn_traits_base, _Mem_fn_traits): Move to <bits/refwrap.h>. * testsuite/20_util/bind/83427.cc: New test. * testsuite/20_util/bind/refqual.cc: Add noexcept to functions and check for weak result types. * testsuite/20_util/reference_wrapper/83427.cc: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255651 138bc75d-0d04-0410-961f-82ee72b054a4
* * gcc-interface/misc.c (default_pass_by_ref): Minor tweak.ebotcazou2017-12-142-6/+10
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255650 138bc75d-0d04-0410-961f-82ee72b054a4
* vrp_prop: Use dom_walker for -Warray-bounds (PR tree-optimization/83312)dmalcolm2017-12-146-58/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | gcc/ChangeLog: PR tree-optimization/83312 * domwalk.h (dom_walker::dom_walker): Fix typo in comment. * tree-cfg.c (find_taken_edge): Update to handle NULL_TREE for "val" param, and to cope with arbitrary basic blocks. (find_taken_edge_cond_expr): Add "cond_stmt" param and use it to handle NULL_TREE for "val", dropping "bb" param. (find_taken_edge_switch_expr): Make "switch_stmt" param const and drop "bb" param. Handle NULL_TREE for "val". (find_case_label_for_value): Make "switch_stmt" param const. * tree-vrp.c (class check_array_bounds_dom_walker): New subclass of dom_walker. (vrp_prop::check_all_array_refs): Reimplement as... (check_array_bounds_dom_walker::before_dom_children): ...this new vfunc. Replace linear search through BB block list, excluding those with non-executable in-edges via dominator walk. gcc/testsuite/ChangeLog: PR tree-optimization/83312 * gcc.dg/pr83312.c: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255649 138bc75d-0d04-0410-961f-82ee72b054a4
* * gcc-interface/trans.c (Call_to_gnu): Set DECL_DISREGARD_INLINE_LIMITSebotcazou2017-12-142-4/+15
| | | | | | | to 0 on the callee if the call is recursive. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255648 138bc75d-0d04-0410-961f-82ee72b054a4
* * gcc-interface/decl.c (gnat_to_gnu_field): Do not set the alignmentebotcazou2017-12-144-1/+32
| | | | | | | of the enclosing record type if it is not already set. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255645 138bc75d-0d04-0410-961f-82ee72b054a4
* [arm] Add -mverbose-cost-dump and de-verbosify cost dumpsktkachov2017-12-143-1/+10
| | | | | | | | | | | | | | | | | | | | | | This patch adds an -mverbose-cost-dump option, similar to the one in aarch64. It makes the RTX cost dump print the RTX we're costing in the backend, as well as its cost. This can be distracting in other cost-related RTL dumps like combine's. So now we don't dump the backend information by default, but provide the power-user option -mverbose-cost-dump to enable the old verbose dumping. This option is for GCC developers debugging the compiler only, so no documentation are added. It's also trivially simple in functionality so no test is added either. Bootstrapped and tested on arm-none-linux-gnueabihf. Committed to trunk. * config/arm/arm.opt (mverbose-cost-dump): New option. * config/arm/arm.c (arm_rtx_costs): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255644 138bc75d-0d04-0410-961f-82ee72b054a4
* PR lto/81406jakub2017-12-142-0/+25
| | | | | | | * gcc.dg/lto/pr81406_0.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255643 138bc75d-0d04-0410-961f-82ee72b054a4
* 2017-12-14 Richard Biener <rguenther@suse.de>rguenth2017-12-142-0/+20
| | | | | | | | PR tree-optimization/66974 * gcc.dg/Warray-bounds-24.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255642 138bc75d-0d04-0410-961f-82ee72b054a4
* 2017-12-14 Richard Biener <rguenther@suse.de>rguenth2017-12-142-0/+20
| | | | | | | | PR tree-optimization/65258 * gcc.dg/Warray-bounds-23.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255641 138bc75d-0d04-0410-961f-82ee72b054a4
* PR bootstrap/83396schwab2017-12-142-2/+7
| | | | | | | * reload1.c (emit_input_reload_insns): Skip debug markers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255640 138bc75d-0d04-0410-961f-82ee72b054a4
* [compare-debug] use call loc for nop_endbraoliva2017-12-142-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We skip debug insns and notes after a call that needs a nop_endbr, but since a debug insn could be the last in a block, it may affect the loc in the emitted nop_endbr insn. Although this has no effect on codegen, it does mess with debug info a bit, and it causes -fcompare-debug to fail for e.g. libsanitizer's tsan/tsan_platform_linux.cc on x86_64. So, pick the location of the call insn for the nop_endbr insn, to avoid the line number differences in dumps, including -fcompare-debug ones. Also, we don't need to determine what the insert point would be unless we're actually emitting the nop_endbr insn after the call, so rearrange the code to avoid wasting cycles. Finally, it seems like testing for barriers is a mistake. We probably never actually pass that test, for the barriers would hit BB_END first. If we did, we'd end up emitting the nop_endbr outside any BB, even after the end of the function! That would be Very Bad (TM). Now, since the test as it is can't hurt, I figured I wouldn't change the logic right now, just add a comment so that someone involved in endbr stuff can have a second look and hopefully fix it. for gcc/ChangeLog * config/i386/i386.c (rest_of_insert_endbranch): Use call loc for its nop_endbr. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255639 138bc75d-0d04-0410-961f-82ee72b054a4
* [SFN] next/prev_nonnote_insn_bb are no more, even for portsaoliva2017-12-147-32/+45
| | | | | | | | | | | | | | | | | The patch that added _nondebug to next_ and prev_nonnote_insn_bb failed to find and adjust uses within config. Fixed. for gcc/ChangeLog PR bootstrap/83396 * config/arc/arc.c (hwloop_optimize): Skip debug insns. * config/sh/sh-protos.h (sh_find_set_of_reg): Adjust. * config/sh/sh.c: Skip debug insns besides notes. * config/sh/sh.md: Likewise. * config/sh/sh_treg_combine.cc: Likewise. * config/sh/sync.md: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255638 138bc75d-0d04-0410-961f-82ee72b054a4
* Require effective target weak_undefined for visibility-22.cvries2017-12-145-4/+24
| | | | | | | | | | | | | 2017-12-14 Tom de Vries <tom@codesourcery.com> * lib/target-supports.exp (check_effective_target_weak_undefined): New proc. * gcc.dg/visibility-22.c: Require effective target weak_undefined. * doc/sourcebuild.texi (Effective-Target Keywords, Other attributes): Add item for weak_undefined. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255637 138bc75d-0d04-0410-961f-82ee72b054a4
* 2017-12-14 Richard Biener <rguenther@suse.de>rguenth2017-12-142-14/+5
| | | | | | | | PR tree-optimization/67842 * sese.h (bb_in_region): Remove #if 0'ed code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255636 138bc75d-0d04-0410-961f-82ee72b054a4
* 2017-12-14 Richard Biener <rguenther@suse.de>rguenth2017-12-144-8/+64
| | | | | | | | | | | | | | | | PR tree-optimization/83326 * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Add may_be_zero parameter and handle it by not marking the first peeled copy as not exiting the loop. (try_peel_loop): Likewise. (canonicalize_loop_induction_variables): Use number_of_iterations_exit to handle the case of constant or zero iterations and perform loop header copying on-the-fly. * gcc.dg/tree-ssa/pr81388-2.c: Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255635 138bc75d-0d04-0410-961f-82ee72b054a4
* Test whitespace handling in std::complex extractionredi2017-12-142-0/+31
| | | | | | | * testsuite/26_numerics/complex/inserters_extractors/char/dr2714.cc: Add tests using noskipws. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255632 138bc75d-0d04-0410-961f-82ee72b054a4
* * gcc-interface/gigi.h (pad_type_has_rm_size): Declare.ebotcazou2017-12-148-74/+133
| | | | | | | | | | | | | | | | | | * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Do not build a padding type for the alignment before validating the size. Flip conditional construct and add a comment. * gcc-interface/trans.c (Attribute_to_gnu) <Attr_Size>: Make sure to apply the exception for padded objects to the type of the object. * gcc-interface/utils.c (hash_pad_type): New static function. (lookup_and_insert_pad_type): Rename into... (canonicalize_pad_type): ...this. Call hash_pad_type, do only one lookup with insertion and always return the canonical type. (maybe_pad_type): Adjust to above changes. Set debug type later. (pad_type_has_rm_size): New predicate. (set_reverse_storage_order_on_pad_type): Adjust to above changes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255631 138bc75d-0d04-0410-961f-82ee72b054a4
* Improve std::complex test and move to sub-directoryredi2017-12-142-17/+10
| | | | | | | | | * testsuite/26_numerics/complex/dr2714.cc: Move to ... * testsuite/26_numerics/complex/inserters_extractors/char/dr2714.cc: ... Here. Remove duplicate header and dg-options. Check first invalid character gets putback. Remove wchar_t test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255630 138bc75d-0d04-0410-961f-82ee72b054a4
* 2017-12-14 Richard Biener <rguenther@suse.de>rguenth2017-12-144-1/+25
| | | | | | | | | | | | | PR c/83415 c/ * c-fold.c (c_fully_fold_internal): Treat VIEW_CONVERT_EXPR like REALPART_EXPR for the behavior of whether its operand is an lvalue. * gcc.dg/pr83415.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255629 138bc75d-0d04-0410-961f-82ee72b054a4
* 2017-12-14 Richard Biener <rguenther@suse.de>rguenth2017-12-144-3/+33
| | | | | | | | | | | | PR tree-optimization/83418 * vr-values.c (vr_values::extract_range_for_var_from_comparison_expr): Instead of asserting we don't get unfolded comparisons deal with them. * gcc.dg/torture/pr83418.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255628 138bc75d-0d04-0410-961f-82ee72b054a4
* PR bootstrap/83396jakub2017-12-144-11/+38
| | | | | | | | | | | | * var-tracking.c (vt_initialize): Ignore non-DEBUG_INSNs outside of basic blocks. Assert debug bind insns don't appear outside of bbs, don't reset them. Assert insns without BLOCK_FOR_INSN are outside of bb. Simplify. * gcc.dg/pr83396.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255627 138bc75d-0d04-0410-961f-82ee72b054a4
* PR tree-optimization/83198jakub2017-12-145-5/+59
| | | | | | | | | | | | * gimple-ssa-sprintf.c (format_floating): Set type solely based on dir.modifier, regardless of TREE_TYPE (arg). Assume non-REAL_CST value if arg is a REAL_CST with incompatible type. * gcc.dg/pr83198.c: New test. * gcc.dg/tree-ssa/pr83198.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255626 138bc75d-0d04-0410-961f-82ee72b054a4
* [PATCH PR81228][AARCH64]Fix ICE by adding LTGT in vec_cmp<mode><v_int_equiv>sudi2017-12-145-1/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is a follow up to the existing discussions on https://gcc.gnu.org/ml/gcc-patches/2017-07/msg01904.html Bin had earlier submitted this patch to fix the ICE that occurs because of the missing LTGT in aarch64-simd.md. That discussion opened up a new bug report PR81647 for an inconsistent behavior. As discussed earlier on the gcc-patches discussion and on the bug report, PR81647 was occurring because of how UNEQ was handled in aarch64-simd.md rather than LTGT. Since __builtin_islessgreater is guaranteed to not give an FP exception but LTGT might, __builtin_islessgreater gets converted to ~UNEQ very early on in fold_builtin_unordered_cmp. Thus I will post a separate patch for correcting how UNEQ and other unordered comparisons are handled in aarch64-simd.md. This patch is only adding the missing LTGT to plug the ICE. Testing done: Checked for regressions on bootstrapped aarch64-none-linux-gnu and added a new compile time test case that gives out LTGT to make sure it doesn't ICE *** gcc/ChangeLog *** 2017-12-14 Sudakshina Das <sudi.das@arm.com> Bin Cheng <bin.cheng@arm.com> PR target/81228 * config/aarch64/aarch64.c (aarch64_select_cc_mode): Move LTGT to CCFPEmode. * config/aarch64/aarch64-simd.md (vec_cmp<mode><v_int_equiv>): Add LTGT. *** gcc/testsuite/ChangeLog *** 2017-12-14 Sudakshina Das <sudi.das@arm.com> PR target/81228 * gcc.dg/pr81228.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255625 138bc75d-0d04-0410-961f-82ee72b054a4
* [AArch64] Specify fp16 support for Cortex-A55 and Cortex-A75ktkachov2017-12-142-3/+8
| | | | | | | | | | | | | | | | | The Cortex-A55 and Cortex-A75 processors support the fp16 extension. We already specify them as such in the arm port. This patch makes aarch64 consistent on this front. Bootstrapped and tested on aarch64-none-linux-gnu. Manually checked that compiling with aarch64-none-linux-gnu-gcc -mcpu=cortex-a55 -dM -E - < /dev/null shows __ARM_FEATURE_FP16_VECTOR_ARITHMETIC and __ARM_FEATURE_FP16_SCALAR_ARITHMETIC being specified as expected whereas they were not before this patch. * config/aarch64/aarch64-cores.def (cortex-a55, cortex-a75, cortex-a75.cortex-a55): Specify AARCH64_FL_F16 in the arch features. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255624 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/79650jakub2017-12-144-1/+44
| | | | | | | | | | * pt.c (convert_nontype_argument): Diagnose reduced_constant_expression_p expressions that aren't INTEGER_CST. * g++.dg/template/pr79650.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255623 138bc75d-0d04-0410-961f-82ee72b054a4
* 2017-12-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2017-12-145-8/+44
| | | | | | | | | | | | | | | | | | | PR libgfortran/78549 * io/inquire.c (inquire_via_unit): Adjust test for existence for pre-connected internal units. * io/transfer.c (finalize_transfer): When done with a transfer to internal units, free the format buffer and close the stream. (st_read_done): Delete freeing the stream, now handled using sclose in finalize_transfer. (st_write_done): Likewise. * io/unit.c (get_unit): Return NULL for special reserved unit numbers, signifying not accessible to the user. (init_units): Insert the two special internal units into the unit treap. This makes these unit structures available without further allocations for later use by internal unit I/O. These units are automatically deleted by normal program termination. * io/unix.c (mem_close): Add a guard check to protect from double free. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255621 138bc75d-0d04-0410-961f-82ee72b054a4
* Daily bump.gccadmin2017-12-141-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255620 138bc75d-0d04-0410-961f-82ee72b054a4
* poly_int: add poly-int.hrsandifo2017-12-1428-12/+8871
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new "poly_int" class to represent polynomial integers of the form: C0 + C1*X1 + C2*X2 ... + Cn*Xn It also adds poly_int-based typedefs for offsets and sizes of various precisions. In these typedefs, the Ci coefficients are compile-time constants and the Xi indeterminates are run-time invariants. The number of coefficients is controlled by the target and is initially 1 for all ports. Most routines can handle general coefficient counts, but for now a few are specific to one or two coefficients. Support for other coefficient counts can be added when needed. The patch also adds a new macro, IN_TARGET_CODE, that can be set to indicate that a TU contains target-specific rather than target-independent code. When this macro is set and the number of coefficients is 1, the poly-int.h classes define a conversion operator to a constant. This allows most existing target code to work without modification. The main exceptions are: - values passed through ..., which need an explicit conversion to a constant - ?: expression in which one arm ends up being a polynomial and the other remains a constant. In these cases it would be valid to convert the constant to a polynomial and the polynomial to a constant, so a cast is needed to break the ambiguity. The patch also adds a new target hook to return the estimated value of a polynomial for costing purposes. The patch also adds operator<< on wide_ints (it was already defined for offset_int and widest_int). I think this was originally excluded because >> is ambiguous for wide_int, but << is useful for converting bytes to bits, etc., so is worth defining on its own. The patch also adds operator% and operator/ for offset_int and widest_int, since those types are always signed. These changes allow the poly_int interface to be more predictable. I'd originally tried adding the tests as selftests, but that ended up bloating cc1 by at least a third. It also took a while to build them at -O2. The patch therefore uses plugin tests instead, where we can force the tests to be built at -O0. They still run in negligible time when built that way. 2017-12-14 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * poly-int.h: New file. * poly-int-types.h: Likewise. * coretypes.h: Include them. (POLY_INT_CONVERSION): Define. * target.def (estimated_poly_value): New hook. * doc/tm.texi.in (TARGET_ESTIMATED_POLY_VALUE): New hook. * doc/tm.texi: Regenerate. * doc/poly-int.texi: New file. * doc/gccint.texi: Include it. * doc/rtl.texi: Describe restrictions on subreg modes. * Makefile.in (TEXI_GCCINT_FILES): Add poly-int.texi. * genmodes.c (NUM_POLY_INT_COEFFS): Provide a default definition. (emit_insn_modes_h): Emit a definition of NUM_POLY_INT_COEFFS. * targhooks.h (default_estimated_poly_value): Declare. * targhooks.c (default_estimated_poly_value): New function. * target.h (estimated_poly_value): Likewise. * wide-int.h (WI_UNARY_RESULT): Use wi::binary_traits. (wi::unary_traits): Delete. (wi::binary_traits::signed_shift_result_type): Define for offset_int << HOST_WIDE_INT, etc. (generic_wide_int::operator <<=): Define for all types and use wi::lshift instead of <<. (wi::hwi_with_prec): Add a default constructor. (wi::ints_for): New class. (operator <<): Define for all wide-int types. (operator /): New function. (operator %): Likewise. * selftest.h (ASSERT_KNOWN_EQ, ASSERT_KNOWN_EQ_AT, ASSERT_MAYBE_NE) (ASSERT_MAYBE_NE_AT): New macros. gcc/testsuite/ * gcc.dg/plugin/poly-int-tests.h, gcc.dg/plugin/poly-int-test-1.c, gcc.dg/plugin/poly-int-01_plugin.c, gcc.dg/plugin/poly-int-02_plugin.c, gcc.dg/plugin/poly-int-03_plugin.c, gcc.dg/plugin/poly-int-04_plugin.c, gcc.dg/plugin/poly-int-05_plugin.c, gcc.dg/plugin/poly-int-06_plugin.c, gcc.dg/plugin/poly-int-07_plugin.c: New tests. * gcc.dg/plugin/plugin.exp: Run them. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255617 138bc75d-0d04-0410-961f-82ee72b054a4
* PR middle-end/78468ebotcazou2017-12-135-18/+41
| | | | | | | | | | | | | * emit-rtl.c (init_emit): Remove ??? comment. * explow.c (get_dynamic_stack_size): Take known alignment of stack pointer + STACK_DYNAMIC_OFFSET into account in lieu of STACK_BOUNDARY. * config/sparc/sparc.h (INIT_EXPANDERS): In 32-bit mode, lower the alignment of 3 virtual registers to BITS_PER_WORD. * config/sparc/sparc.c (sparc_compute_frame_size): Simplify. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255616 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/bergner2017-12-135-0/+12
| | | | | | | | | | | * config/rs6000/ppc-auxv.h (PPC_FEATURE2_HTM_NO_SUSPEND): New define. * config/rs6000/rs6000.c (cpu_supports_info): Use it. gcc/testsuite/ * gcc.target/powerpc/cpu-builtin-1.c (htm-no-suspend): Add test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255614 138bc75d-0d04-0410-961f-82ee72b054a4
* /cppaolo2017-12-134-2/+20
| | | | | | | | | | | | | | | | | 2017-12-13 Paolo Carlini <paolo.carlini@oracle.com> PR c++/81061 * typeck.c (cp_build_modify_expr): Upon cxx_readonly_error immediately return error_mark_node. /testsuite 2017-12-13 Paolo Carlini <paolo.carlini@oracle.com> PR c++/81061 * g++.dg/other/const5.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255613 138bc75d-0d04-0410-961f-82ee72b054a4
* [SFN] don't eliminate regs in markersaoliva2017-12-132-1/+6
| | | | | | | | | | | Eliminate regs in debug bind insns, but not in markers. for gcc/ChangeLog PR bootstrap/83396 * reload1.c (eliminate_regs_in_insn): Skip debug markers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255612 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree-cfg.c (verify_gimple_in_cfg): Verify no non-label stmtsjakub2017-12-132-0/+18
| | | | | | | | with the exception of debug begin stmt markers appear before labels. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255611 138bc75d-0d04-0410-961f-82ee72b054a4
* PR bootstrap/83396jakub2017-12-133-4/+11
| | | | | | | | * final.c (rest_of_handle_final): Call variable_tracking_main only if !flag_var_tracking. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255610 138bc75d-0d04-0410-961f-82ee72b054a4
* PR bootstrap/83396jakub2017-12-135-2/+112
| | | | | | | | | | | | PR debug/83391 * tree-cfgcleanup.c (remove_forwarder_block): Keep after labels debug stmts that can only appear after labels. * gcc.dg/torture/pr83396.c: New test. * g++.dg/torture/pr83391.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255609 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libstdc++/59568 fix error handling for std::complex stream extractionredi2017-12-133-19/+217
| | | | | | | | | | | PR libstdc++/59568 * include/std/complex (operator>>): Implement proposed resolution to LWG 2714. Use putback if and only if a character has been successfully extracted but isn't a delimiter. Use ctype::widen and traits::eq when testing if extracted characters match delimiters. * testsuite/26_numerics/complex/dr2714.cc: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255608 138bc75d-0d04-0410-961f-82ee72b054a4
* sel-sched: fix sel_rank_for_schedule for qsort (PR 82398)amonakov2017-12-132-1/+7
| | | | | | | | | PR rtl-optimization/82398 * sel-sched.c (sel_rank_for_schedule): Fix check for zero EXPR_USEFULNESS in priority comparison. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255607 138bc75d-0d04-0410-961f-82ee72b054a4
* combine: Fix PR83393segher2017-12-134-1/+50
| | | | | | | | | | | | | | | | | | | | In move_deaths we move a REG_DEAD note if the instruction combination has extended the lifetime of a register so that the existing note is no longer valid. We find that note using reg_stat, but what that finds can refer to a later insn. If so, we cannot use the cached value. This patch implements that. PR rtl-optimization/83393 * combine.c (move_deaths): If reg_stat points to a too new insn in last_death, do not use it: find the proper insn instead. gcc/testsuite/ PR rtl-optimization/83393 * gcc.dg/pr83393.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255606 138bc75d-0d04-0410-961f-82ee72b054a4
* [PR C++/15272] lookups with ambiguating dependent basenathan2017-12-134-28/+58
| | | | | | | | | | | | | https://gcc.gnu.org/ml/gcc-patches/2017-12/msg00766.html PR c++/15272 * pt.c (tsubst_baselink): Don't repeat the lookup for non-dependent baselinks. PR c++/15272 * g++.dg/template/pr71826.C: Adjust for 15272 fix. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255605 138bc75d-0d04-0410-961f-82ee72b054a4
* * gcc-interface/trans.c (Subprogram_Body_to_gnu): Initialize locus.ebotcazou2017-12-132-1/+6
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255603 138bc75d-0d04-0410-961f-82ee72b054a4