aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-11-16PR fortran/48958 - Add runtime diagnostics for SIZE intrinsic functionHarald Anlauf2-0/+54
Add code for runtime checking of status of ALLOCATABLE and POINTER arguments to the SIZE intrinsic when -fcheck=pointer is specified. gcc/fortran/ChangeLog: * trans-intrinsic.c (gfc_conv_intrinsic_size): Generate runtime checking code for status of argument. gcc/testsuite/ChangeLog: * gfortran.dg/pr48958.f90: New test.
2020-11-16Follow reference for determining offset.Thomas Koenig1-5/+8
gcc/fortran/ChangeLog: * trans-array.c (gfc_conv_ss_descriptor): Follow reference for determining offset.
2020-11-16param: Add missing dot for param description.Martin Liska1-1/+1
gcc/ChangeLog: * params.opt: Add missing dot.
2020-11-16mklog: support unidiff 0.5.4Martin Liska1-5/+4
contrib/ChangeLog: * mklog.py: Do not call read on an input stream. Fix some flake8 issues.
2020-11-16IPA tracking of EAF flags in ipa-modref.Jan Hubicka4-198/+1092
this patch implements the IPA propagation part of EAF flags handling in ipa-modref. It extends the local analysis to collect lattice consisting of flags and escape points. SSA name escapes if it is passed directly or indirectly to a function call. If useful flags are found for parameter its escape list is stored into escape summaries. This time each call site is annotated with info on which function parameters escape to what argument of function call. At IPA time we then perform iterative dataflow and produce final flags. ipa-modref is still cheaper than pure-const when running on cc1plus (about 2-3% that is what accounts every non-trivial passs) and the dataflow converges in 1 or 2 iterations. Local analysis does some work to avoid streaming escape points when they are not useful to determine final flags (that is, local escape analysis determined good enough flags). For cc1plus there are 225k calls with useful escape summary. * ipa-modref.c (escape_point): New type. (modref_lattice): New type. (escape_entry): New type. (escape_summary): New type. (escape_summaries_t): New type. (escape_summaries): New static variable. (eaf_flags_useful_p): New function. (modref_summary::useful_p): Add new check_flags attribute; check eaf_flags for usefulness. (modref_summary_lto): Add arg_flags. (modref_summary_lto::useful_p): Add new check_flags attribute; check eaf_flags for usefulness. (dump_modref_edge_summaries): New function. (remove_modref_edge_summaries): New function. (ignore_retval_p): New predicate. (ignore_stores_p): Also ignore for const. (remove_summary): Call remove_modref_edge_summaries. (modref_lattice::init): New member function. (modref_lattice::release): New member unction. (modref_lattice::dump): New member function. (modref_lattice::add_escape_point): New member function. (modref_lattice::merge): Two new member functions. (modref_lattice::merge_deref): New member functions. (modref_lattice::merge_direct_load): New member function. (modref_lattice::merge_direct_store): New member function. (call_lhs_flags): Rename to ... (merge_call_lhs_flags): ... this one; reimplement using modreflattice. (analyze_ssa_name_flags): Replace KNOWN_FLAGS param by LATTICE; add IPA parametr; use modref_lattice. (analyze_parms): New parameter IPA and SUMMARY_LTO; update for modref_lattice; initialize escape_summary. (analyze_function): Allocate escape_summaries; update uses of useful_p. (modref_write_escape_summary): New function. (modref_read_escape_summary): New function. (modref_write): Write escape summary. (read_section): Read escape summary. (modref_read): Initialie escape_summaries. (remap_arg_flags): New function. (update_signature): Use it. (escape_map): New structure. (update_escape_summary_1, update_escape_summary): New functions. (ipa_merge_modref_summary_after_inlining): Merge escape summaries. (propagate_unknown_call): Do not remove useless summaries. (remove_useless_summaries): Remove them here. (modref_propagate_in_scc): Update; do not dump scc. (modref_propagate_dump_scc): New function. (modref_merge_call_site_flags): New function. (modref_propagate_flags_in_scc): New function. (pass_ipa_modref::execute): Use modref_propagate_flags_in_scc and modref_propagate_dump_scc; delete escape_summaries. (ipa_modref_c_finalize): Remove escape_summaries. * ipa-modref.h (modref_summary): Update prototype of useful_p. * params.opt (param=modref-max-escape-points): New param. * doc/invoke.texi (modref-max-escape-points): Document.
2020-11-16Disable some bogus -Wmaybe-uninitialized warningsJan Hubicka3-4/+48
gcc/ChangeLog: PR middle-end/97840 * ipa-modref.c (analyze_ssa_name_flags): Skip clobbers if inlining is done. * tree-ssa-uninit.c (maybe_warn_pass_by_reference): Make stmt gcall; skip const calls and unused arguments. (warn_uninitialized_vars): Update prototype. gcc/testsuite/ChangeLog: * g++.dg/warn/uninit-1.C: New test.
2020-11-16Delay SLP instance loads gatheringRichard Biener3-8/+22
This delays filling SLP_INSTANCE_LOADS. 2020-11-16 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vect_gather_slp_loads): Declare. * tree-vect-loop.c (vect_analyze_loop_2): Call vect_gather_slp_loads. * tree-vect-slp.c (vect_build_slp_instance): Do not gather SLP loads here. (vect_gather_slp_loads): Remove wrapper, new function. (vect_slp_analyze_bb_1): Call it.
2020-11-16further optimize non-store-motion LIMRichard Biener1-8/+16
This removes useless work from LIM when store-motion is disabled. 2020-11-16 Richard Biener <rguenther@suse.de> * tree-ssa-loop-im.c (analyze_memory_references): Add store_motion parameter and elide unnecessary work. (tree_ssa_lim_initialize): Likewise. (loop_invariant_motion_in_fun): Pass down store_motion.
2020-11-16IBM Z: Do not run long double tests on old machinesIlya Leoshkevich26-25/+60
gcc/testsuite/ChangeLog: 2020-11-12 Ilya Leoshkevich <iii@linux.ibm.com> * gcc.target/s390/s390.exp (check_effective_target_s390_z14_hw): New predicate. * gcc.target/s390/vector/long-double-caller-abi-run.c: Use the new predicate. * gcc.target/s390/vector/long-double-copysign.c: Likewise. * gcc.target/s390/vector/long-double-from-double.c: Likewise. * gcc.target/s390/vector/long-double-from-float.c: Likewise. * gcc.target/s390/vector/long-double-from-i16.c: Likewise. * gcc.target/s390/vector/long-double-from-i32.c: Likewise. * gcc.target/s390/vector/long-double-from-i64.c: Likewise. * gcc.target/s390/vector/long-double-from-i8.c: Likewise. * gcc.target/s390/vector/long-double-from-u16.c: Likewise. * gcc.target/s390/vector/long-double-from-u32.c: Likewise. * gcc.target/s390/vector/long-double-from-u64.c: Likewise. * gcc.target/s390/vector/long-double-from-u8.c: Likewise. * gcc.target/s390/vector/long-double-to-double.c: Likewise. * gcc.target/s390/vector/long-double-to-float.c: Likewise. * gcc.target/s390/vector/long-double-to-i16.c: Likewise. * gcc.target/s390/vector/long-double-to-i32.c: Likewise. * gcc.target/s390/vector/long-double-to-i64.c: Likewise. * gcc.target/s390/vector/long-double-to-i8.c: Likewise. * gcc.target/s390/vector/long-double-to-u16.c: Likewise. * gcc.target/s390/vector/long-double-to-u32.c: Likewise. * gcc.target/s390/vector/long-double-to-u64.c: Likewise. * gcc.target/s390/vector/long-double-to-u8.c: Likewise. * gcc.target/s390/vector/long-double-wfaxb.c: Likewise. * gcc.target/s390/vector/long-double-wfdxb.c: Likewise. * gcc.target/s390/vector/long-double-wfsxb-1.c: Likewise.
2020-11-16modref: add missing Param Optimization keywordsMartin Liska1-5/+5
Fixes: FAIL: compiler driver --help=common option(s): "^ +-.*[^:.]$" absent from output: " --param=modref-max-depth= Maximum depth of DFS walk used by modref escape analysis" gcc/ChangeLog: * params.opt: All modref parameters miss Optimization and Param keyword as seen in testsuite failure.
2020-11-16Fix -param=modref-max-depth in params.optJan Hubicka1-1/+1
* params.opt (-param=modref-max-depth=): Add missing full stop.
2020-11-16pointer-compare-1.c: Add __attribute__((used))H.J. Lu1-3/+4
c-c++-common/asan/pointer-compare-1.c assumes the certain order for variable placement. Add __attribute__((used)) to avoid variable placement changes due to SHF_GNU_RETAIN. PR testsuite/97803 * c-c++-common/asan/pointer-compare-1.c (global1): Add __attribute__((used)) (global2): Likewise. (small_global): Likewise. (large_global): Likewise.
2020-11-16libstdc++: Fix error shown during Solaris buildJonathan Wakely2-4/+4
Currently this is shown when building libstdc++ on Solaris: -lrt: open: No such file or directory The error comes from the make_sunver.pl script which tries to open each of its arguments. The arguments are passed by this make rule: perl ${glibcxx_srcdir}/scripts/make_exports.pl \ libstdc++-symbols.ver \ $(libstdc___la_OBJECTS:%.lo=.libs/%.o) \ `echo $(libstdc___la_LIBADD) | \ sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \ > $@ || (rm -f $@ ; exit 1) The $(libstdc___la_LIBADD) variable includes $(GLIBCXX_LIBS) which contains -lrt on Solaris. This patch adds another sed script to filter -l arguments from the echo command. In order to reliably match ' -l[^ ]* ' the echo arguments are quoted and a space added before and after them. This might be overkill just to remove -lrt from the start of the string, but should be robust in case other -l arguments are added to $(GLIBCXX_LIBS), or in case the $(libstdc___la_LIBADD) libraries are reordered. libstdc++-v3/ChangeLog: * src/Makefile.am (libstdc++-symbols.ver-sun): Remove -lrt from arguments passed to make_sunver.pl script. * src/Makefile.in: Regenerate.
2020-11-16Add .cache to git ignore.Martin Liska1-0/+1
ChangeLog: * .gitignore: Add cache as clangd uses it now.
2020-11-16gcov: Add -fprofile-info-section supportSebastian Huber5-2/+87
Register the profile information in the specified section instead of using a constructor/destructor. A pointer to the profile information generated by -fprofile-arcs or -ftest-coverage is placed in the specified section for each translation unit. This option disables the profile information registration through a constructor and it disables the profile information processing through a destructor. I am not sure how I can test this option. One approach would be to assemble a test file, then scan it and check that a .gcov_info section is present and no __gcov_init() and __gcov_exit() calls are present. Is there an example for this in the test suite? gcc/ * common.opt (fprofile-info-section): New. * coverage.c (build_gcov_info_var_registration): New. (coverage_obj_init): Evaluate profile_info_section and use build_gcov_info_var_registration(). * doc/invoke.texi (fprofile-info-section): Document. * opts.c (common_handle_option): Process fprofile-info-section option. gcc/testsuite/ChangeLog: * gcc.dg/profile-info-section.c: New test.
2020-11-16tree-optimization/97838 - fix SLP leaf detectionRichard Biener2-5/+28
This properly handles reduction PHI nodes with unrepresented initial value as leaf in the SLP graph. 2020-11-16 Richard Biener <rguenther@suse.de> PR tree-optimization/97838 * tree-vect-slp.c (vect_slp_build_vertices): Properly handle not backwards reachable cycles. (vect_optimize_slp): Check a node is leaf before marking it visited. * gcc.dg/vect/pr97838.c: New testcase.
2020-11-16Prefer bit-test over the jump table.Martin Liska3-8/+20
gcc/ChangeLog: PR tree-optimization/97736 * tree-switch-conversion.c (switch_decision_tree::analyze_switch_statement): Prefer bit tests. gcc/testsuite/ChangeLog: PR tree-optimization/97736 * gcc.dg/tree-ssa/switch-1.c: Prefer bit tests. * g++.dg/tree-ssa/pr97736.C: New test.
2020-11-16tree-optimization/97835 - fix step vector construction for SLP inductionRichard Biener2-1/+22
We're stripping conversions off access functions of inductions and thus the step can be of different sign. Fix bogus step CTORs by converting the elements rather than the whole vector. 2020-11-16 Richard Biener <rguenther@suse.de> PR tree-optimization/97835 * tree-vect-loop.c (vectorizable_induction): Convert step scalars rather than step vector. * gcc.dg/vect/pr97835.c: New testcase.
2020-11-16tree-optimization/97830 - fix compare of incomplete type size in VNRichard Biener2-1/+28
This avoids passing NULL to expressions_equal_p. 2020-11-16 Richard Biener <rguenther@suse.de> PR tree-optimization/97830 * tree-ssa-sccvn.c (vn_reference_eq): Check for incomplete types before comparing TYPE_SIZE. * gcc.dg/pr97830.c: New testcase.
2020-11-16Put PREFETCHW back to march=broadwellCui,Lili2-24/+29
PREFETCHW should be both in march=broadwell and march=silvermont. I move PREFETCHW from march=broadwell to march=silvermont in previous patch. gcc/ChangeLog: * config/i386/i386.h: Add PREFETCHW to march=broadwell. * doc/invoke.texi: Put PREFETCHW back to relation arch.
2020-11-16Daily bump.GCC Administrator6-1/+118
2020-11-15MSP430: Fix inconsistent naming of hwmult libfuncsJozef Lawrynowicz3-29/+7
The naming scheme used by GCC to reference MSP430 hardware multiply library functions is inconsistent. Sometimes the "GCC" names (e.g. mulsi2) are used, other times the "MSPABI" names (e.g. __mspabi_mpyl) are used. Also, sometimes an identifier for the hardware multiply support is appended to the GCC name, when the functions are defined, but this is not required. This patch fixes those issues, so the names used to refer to the hardware multiply library functions follow a consistent pattern. gcc/ChangeLog: * config/msp430/msp430.c (msp430_output_labelref): Don't process mspabi hwmult library function names into GCC-style names. libgcc/ChangeLog: * config/msp430/lib2hw_mul.S: Omit _hw* suffix from GCC names for hwmult library functions. gcc/testsuite/ChangeLog: * gcc.target/msp430/rtx-cost-Os-f5series.c: Adjust test to use new hwmult library function name.
2020-11-15MSP430: Define function to check 16-bit hwmult supportJozef Lawrynowicz1-12/+39
gcc/ChangeLog: * config/msp430/msp430.c (msp430_use_16bit_hwmult): New. (use_32bit_hwmult): Rename to.. (msp430_use_32bit_hwmult): ..this. (msp430_muldiv_costs): Use msp430_use_16bit_hwmult and msp430_use_32bit_hwmult. (msp430_expand_helper): Use msp430_use_16bit_hwmult and msp430_use_32bit_hwmult. (msp430_output_labelref): Use msp430_use_32bit_hwmult.
2020-11-15testsuite: fix ipa/modref-2.c on ilp32David Edelsohn1-2/+3
ipa/modref-2.c output for Parm 1 depends on the word size. This patch updates the testcase to expect the appropriate result for ilp32 and lp64. gcc/testsuite/ChangeLog: * gcc.dg/ipa/modref-2.c: Add ilp32 expected result.
2020-11-15testsuite: Update scanning symbol sections to support AIX.David Edelsohn6-26/+26
gcc/testsuite: * lib/scanasm.exp (parse_section_of_symbols): Also look for AIX XCOFF CSECT notation. * g++.dg/opt/const4.C: Also look for AIX XCOFF "[RO]". * gcc.dg/20021029-1.c: Likewise. * gcc.dg/array-quals-1.c: Likewise and "[RW]". * g++.dg/gomp/tls-5.C: Also look for AIX XCOFF "[TL]". * gcc.dg/pr25376.c: Accept AIX decoration around named section and function descriptor.
2020-11-15VAX: Use `rtx_code' to hold the RTL expression code in `vax_rtx_costs'Maciej W. Rozycki1-1/+1
Use `enum rtx_code' rather than `int' to hold the the RTL expression code in `vax_rtx_costs', matching the type these codes have been defined with and making debugging just a tiny little bit easier. gcc/ * config/vax/vax.c (vax_rtx_costs): Use `rtx_code' rather than `int' for `code'.
2020-11-15VAX/testsuite: Fix compilation options for `bswapdi-1.c'Maciej W. Rozycki1-0/+2
Correct a regression in `vax-netbsdelf' gcc testing: .../gcc/testsuite/gcc.target/vax/bswapdi-1.c: In function '__bswapdi2': .../gcc/testsuite/gcc.target/vax/bswapdi-1.c:5:19: error: use of C99 long long integer constant [-Wlong-long] .../gcc/testsuite/gcc.target/vax/bswapdi-1.c:6:14: error: use of C99 long long integer constant [-Wlong-long] .../gcc/testsuite/gcc.target/vax/bswapdi-1.c:7:14: error: use of C99 long long integer constant [-Wlong-long] .../gcc/testsuite/gcc.target/vax/bswapdi-1.c:8:14: error: use of C99 long long integer constant [-Wlong-long] .../gcc/testsuite/gcc.target/vax/bswapdi-1.c:9:14: error: use of C99 long long integer constant [-Wlong-long] .../gcc/testsuite/gcc.target/vax/bswapdi-1.c:10:14: error: use of C99 long long integer constant [-Wlong-long] .../gcc/testsuite/gcc.target/vax/bswapdi-1.c:11:14: error: use of C99 long long integer constant [-Wlong-long] .../gcc/testsuite/gcc.target/vax/bswapdi-1.c:12:14: error: use of C99 long long integer constant [-Wlong-long] compiler exited with status 1 FAIL: gcc.target/vax/bswapdi-1.c (test for excess errors) which is due to the defaults from `vax.exp': # If a testcase doesn't have special options, use these. global DEFAULT_CFLAGS if ![info exists DEFAULT_CFLAGS] then { set DEFAULT_CFLAGS " -ansi -pedantic-errors" } Use an empty override then as the options used do not matter for the objective of this test case. gcc/testsuite/ * gcc.target/vax/bswapdi-1.c (dg-options): New setting.
2020-11-15VAX: Fix a typo in NO_EXTERNAL_INDIRECT_ADDRESSMaciej W. Rozycki1-1/+1
Fix a typo in a NO_EXTERNAL_INDIRECT_ADDRESS macro check around an assertion verifying DImode addition operands to be valid for PIC. gcc/ * config/vax/vax.c (vax_output_int_add) <E_DImode>: Fix a typo in NO_EXTERNAL_INDIRECT_ADDRESS.
2020-11-15VAX: Correct a typo in PIC symbolic addition operand checksMaciej W. Rozycki1-1/+1
Fix a typo and check both SImode addition operands for being incorrectly symbolic in PIC mode before issuing a diagnostic dump of the offending RTL expression. gcc/ * config/vax/vax.c (vax_output_int_add) <E_SImode>: Also check `operands[2]' for being symbolic with PIC rather than checking `operands[1]' twice.
2020-11-15c++: Check abstract type only on object creation. [PR86252]Jason Merrill12-248/+156
Abstract checking has been problematic for a while; when I implemented an earlier issue resolution to do more checking it led to undesirable instantiations, and so backed some of it out. During the C++20 process we decided with P0929R2 that we should go the other way, and only check abstractness when we're actually creating an object, not when merely forming an array or function type. This means that we can remove the machinery for checking whether a newly complete class makes some earlier declaration ill-formed. This change was moved as a DR, so I'm applying it to all standard levels. This could be reconsidered if it causes problems, but I don't expect it to. The change to the libstdc++ result_of test brings the expected behavior in line with that for incomplete types, but as in PR97841 I think the libstdc++ handling of incomplete types in this and other type_traits is itself wrong, so I expect these lines and others to change again before long. gcc/cp/ChangeLog: * decl.c (cp_finish_decl): Only check abstractness on definition. (require_complete_types_for_parms): Check abstractness here. (create_array_type_for_decl): Not here. (grokdeclarator, grokparms, complete_vars): Not here. * pt.c (tsubst, tsubst_arg_types, tsubst_function_type): Not here. * typeck2.c (struct pending_abstract_type): Remove. (struct abstract_type_hasher): Remove. (abstract_pending_vars, complete_type_check_abstract): Remove. (abstract_virtuals_error_sfinae): Handle arrays. * call.c (conv_is_prvalue): Split out from... (conv_binds_ref_to_prvalue): ...here. (implicit_conversion_1): Rename from implicit_conversion. (implicit_conversion): An abstract prvalue is bad. (convert_like_internal): Don't complain if expr is already error_mark_node. gcc/testsuite/ChangeLog: * g++.dg/other/abstract1.C: Adjust. * g++.dg/other/abstract2.C: Adjust. * g++.dg/other/abstract4.C: Adjust. * g++.dg/other/abstract5.C: Adjust. * g++.dg/other/abstract8.C: New test. * g++.dg/template/sfinae-dr657.C: Adjust. * g++.old-deja/g++.other/decl3.C: Adjust. libstdc++-v3/ChangeLog: * testsuite/20_util/result_of/sfinae_friendly_1.cc: Adjust.
2020-11-15Remove duplicate vr_values::extract_range_builtin code.Aldy Hernandez2-227/+21
Now that we know the vr_values and ranger versions are in sync, it is safe to remove the vr_values version and just call the ranger one. I am leaving the UBSAN bits in place since they make use of relationals which are still not implemented in the ranger. gcc/ChangeLog: * vr-values.c (vr_values::extract_range_builtin): Rename to... (vr_values::extract_range_from_ubsan_builtin): ...this. Remove everything but UBSAN code. (vr_values::extract_range_basic): Call ranger version for everything except UBSAN built-ins. * vr-values.h (class vr_values): Rename extract_range_builtin to extract_range_from_ubsan_builtin.
2020-11-15Do not put reload insns in the last empty BB.Vladimir N. Makarov1-4/+12
gcc/ * lra.c (lra_process_new_insns): Don't put reload insns in the last empty BB.
2020-11-15Rename directory from nca to caf_shared; also rename some files.Nicolas Koenig36-190/+190
libgfortran/ChangeLog: * nca: Rename directory to * caf_shared: New name * Makefile.am: Change directory name from nca to caf_shared, nca_minmax_c to cas_collsub_c and nca_minmax to cas_collsub. * Makefile.in: Regenerated. * generated/nca_minmax_i1.c: Regenerated. * generated/nca_minmax_i16.c: Regenerated. * generated/nca_minmax_i2.c: Regenerated. * generated/nca_minmax_i4.c: Regenerated. * generated/nca_minmax_i8.c: Regenerated. * generated/nca_minmax_r10.c: Regenerated. * generated/nca_minmax_r16.c: Regenerated. * generated/nca_minmax_r4.c: Regenerated. * generated/nca_minmax_r8.c: Regenerated. * generated/nca_minmax_s1.c: Regenerated. * generated/nca_minmax_s4.c: Regenerated. * m4/nca-minmax-s.m4: Rename to cas_collsub-s.m4. Adjust include path. * m4/nca_minmax.m4: Rename to cas_collsub.m4. Adjust include path.
2020-11-15Mare return to clear EAF_UNUSED flag.Jan Hubicka2-2/+21
gcc/ChangeLog: * ipa-modref.c (analyze_ssa_name_flags): Make return to clear EAF_UNUSED flag. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/pr97836.c: New test.
2020-11-15Do not do overflow checks on allocating shared coarrays; reformatting.Nicolas Koenig11-413/+436
gcc/fortran/ChangeLog: PR fortran/97589 * trans-array.c (gfc_array_allocate): Do not do overflow checks for shared coarrays. libgfortran/ChangeLog: * nca/alloc.c: Reformat. * nca/allocator.c: Reformat. * nca/coarraynative.c: Reformat. * nca/collective_subroutine.c Reformat. * nca/counter_barrier.c: Reformat. * nca/hashmap.c: Reformat. * nca/shared_memory.c: Reformat. * nca/sync.c: Reformat. * nca/util.c: Reformat. * nca/wrapper.c: Reformat.
2020-11-15Daily bump.GCC Administrator4-1/+118
2020-11-14testsuite, Objective-C : Amend PR23214 for Darwin11.Iain Sandoe1-1/+1
The test needs to use Object rather than NSObject on this and earlier OS versions. Although the PR reports against the GNU runtime, we run this on NeXT as well. gcc/testsuite/ChangeLog: * objc.dg/pr23214.m: Use Object as the root object before Darwin12 (and NSObject after).
2020-11-14Escape parameters in gcc.dg/torture/pta-ptrarith-1.cJan Hubicka1-0/+3
* gcc.dg/torture/pta-ptrarith-1.c: Escape parameters.
2020-11-14Detect EAF flags in ipa-modrefJan Hubicka5-20/+414
A minimal patch for the EAF flags discovery. It works only in local ipa-modref and gives up on cyclic SSA graphs. It improves pt_solution_includes disambiguations twice. gcc/Changelog: * gimple.c: Include ipa-modref-tree.h and ipa-modref.h. (gimple_call_arg_flags): Use modref to determine flags. * ipa-modref.c: Include gimple-ssa.h, tree-phinodes.h, tree-ssa-operands.h, stringpool.h and tree-ssanames.h. (analyze_ssa_name_flags): Declare. (modref_summary::useful_p): Summary is also useful if arg flags are known. (dump_eaf_flags): New function. (modref_summary::dump): Use it. (get_modref_function_summary): Be read for current_function_decl being NULL. (memory_access_to): New function. (deref_flags): New function. (call_lhs_flags): New function. (analyze_parms): New function. (analyze_function): Use it. * ipa-modref.h (struct modref_summary): Add arg_flags. * doc/invoke.texi (ipa-modref-max-depth): Document. * params.opt (ipa-modref-max-depth): New param.
2020-11-14dwarf2: Emit DW_TAG_unspecified_parameters even in late DWARF [PR97599]Jakub Jelinek1-0/+8
Aldy's PR71855 fix avoided emitting multiple redundant DW_TAG_unspecified_parameters sub-DIEs of a single DIE by restricting it to early dwarf only. That unfortunately means if we need to emit another DIE for the function (whether it is for LTO, or e.g. because of IPA cloning), we don't emit DW_TAG_unspecified_parameters, it remains solely in the DW_AT_abstract_origin's referenced DIE. But DWARF consumers don't really use DW_TAG_unspecified_parameters from there, like we duplicate DW_TAG_formal_parameter sub-DIEs even in the clones because either they have some more specific location, or e.g. a function clone could have fewer or different argument types etc., they need to assume that originally stdarg function isn't later stdarg etc. Unfortunately, while for DW_TAG_formal_parameter sub-DIEs, we can use the hash tabs to look the PARM_DECLs if we already have the DIEs, for DW_TAG_unspecified_parameters we don't have an easy way to look it up. The following patch handles it by trying to figure out if we are creating a fresh new DIE (in that case we add DW_TAG_unspecified_parameters if it is stdarg), or if gen_subprogram_die is called again on an pre-existing DIE to fill in some further details (then it will not touch it). Except for lto, subr_die != old_die would be good enough, but unfortunately for LTO the new DIE that will refer to early dwarf created DIE is created on the fly during lookup_decl_die. So the patch tracks if the DIE has no children before any children are added to it. 2020-11-14 Jakub Jelinek <jakub@redhat.com> PR debug/97599 * dwarf2out.c (gen_subprogram_die): Call gen_unspecified_parameters_die even if not early dwarf, but only if subr_die is a newly created DIE.
2020-11-14Simplify testing symbol sectionsMatthew Glazar12-6/+292
gcc/testsuite * lib/scanasm.exp (dg-scan): Extract file globbing code ... (dg_glob_remote): ... into this new procedure. (scan-assembler-symbol-section): Define. (scan-symbol-section): Define. * g++.dg/gomp/tls-5.C: Add symbol section test. * g++.dg/opt/const4.C: Likewise. * gcc.dg/20021029-1.c: Likewise. * gcc.dg/array-quals-1.c: Likewise. * gcc.dg/darwin-sections.c: Likewise. * gcc.dg/pr25376.c: Likewise. * gcc.test-framework/test-framework.exp: Load scanasm and test .S files. * gcc.test-framework/dg-scan-symbol-section-1-exp-F.S: New test. * gcc.test-framework/dg-scan-symbol-section-2-exp-F.S: New test. * gcc.test-framework/dg-scan-symbol-section-3-exp-F.S: New test. * gcc.test-framework/dg-scan-symbol-section-exp-P.S: New test.
2020-11-13PR target/97682 - Fix to reuse t1 register between call address and epilogue.Monk Chiang5-16/+181
- When expanding the call pattern, choose t1 register be a jump register. Epilogue also uses a t1 register to adjust Stack point. The call pattern and epilogue will initial t1 twice, if both are generated in the same function. The call pattern will emit 'la t1,symbol' and 'jalr t1'instructions. Epilogue also emits 'li t1,4096' and 'addi sp,sp,t1' instructions. But li and addi instructions will be placed between la and jalr instructions. The la instruction will be removed by some optimizations, because t1 register define twice, the first define instruction look likes duplicate. - To resolve this issue, Prologue and Epilogue use the t0 register be a temporary register, the call pattern use the t1 register be a temporary register. gcc/ 2020-11-13 Monk Chiang <monk.chiang@sifive.com> PR target/97682 * config/riscv/riscv.h (RISCV_PROLOGUE_TEMP_REGNUM): Change register to t0. (RISCV_CALL_ADDRESS_TEMP_REGNUM): New Marco, define t1 register. (RISCV_CALL_ADDRESS_TEMP): Use it for call instructions. * config/riscv/riscv.c (riscv_legitimize_call_address): Use RISCV_CALL_ADDRESS_TEMP. (riscv_compute_frame_info): Change temporary register to t0 form t1. (riscv_trampoline_init): Adjust comment. gcc/testsuite/ 2020-11-13 Monk Chiang <monk.chiang@sifive.com> PR target/97682 * g++.target/riscv/pr97682.C: New test. * gcc.target/riscv/interrupt-3.c: Check register for t0. * gcc.target/riscv/interrupt-4.c: Likewise.
2020-11-13Asan changes for RISC-V.Jim Wilson4-3/+22
We have only riscv64 asan support, there is no riscv32 support as yet. So I need to be able to conditionally enable asan support for the riscv target. I implemented this by returning zero from the asan_shadow_offset function. This requires a change to toplev.c and docs in target.def. gcc/ * config/riscv/riscv.c (riscv_asan_shadow_offset): New. (TARGET_ASAN_SHADOW_OFFSET): New. * doc/tm.texi: Regenerated. * target.def (asan_shadow_offset); Mention that it can return zero. * toplev.c (process_options): Check for and handle zero return from targetm.asan_shadow_offset call. Co-Authored-By: cooper.joshua <cooper.joshua@linux.alibaba.com>
2020-11-14openmp: Add support for non-VLA {,first}private allocate on omp taskJakub Jelinek4-113/+300
This patch adds support for custom allocators on private/firstprivate clauses for task (and taskloop) constructs. Private didn't need anything special, but firstprivate if it is passed by reference needs the GOMP_alloc calls in the copyfn and GOMP_free in the task body. 2020-11-14 Jakub Jelinek <jakub@redhat.com> * gimplify.c (gimplify_omp_for): Add OMP_CLAUSE_ALLOCATE_ALLOCATOR decls as firstprivate on task clauses even when allocate clause decl is not lastprivate. * omp-low.c (install_var_field): Don't dereference omp_is_reference types if mask is 33 rather than 1. (scan_sharing_clauses): Populate allocate_map even for task constructs. For now remove it back for variables mentioned in reduction and in_reduction clauses on task/taskloop constructs or on VLA task firstprivates. For firstprivate on task construct, install the var field into field_map with by_ref and 33 instead of false and 1 if mentioned in allocate clause. (lower_private_allocate): Set TREE_THIS_NOTRAP on the created MEM_REF. (lower_rec_input_clauses): Handle allocate for task firstprivatized non-VLA variables. (create_task_copyfn): Likewise. * testsuite/libgomp.c-c++-common/allocate-1.c (struct S): New type. (foo): Add tests for non-VLA private and firstprivate clauses on omp task. (bar): Likewise. Remove taking of address from private/firstprivate variables. * testsuite/libgomp.c++/allocate-1.C (struct S): New type. (foo): Add p, q, px and s arguments. Add tests for array reductions and for non-VLA private and firstprivate clauses on omp task. (bar): Removed. (main): Adjust foo caller. Don't call bar.
2020-11-14Daily bump.GCC Administrator16-1/+1087
2020-11-13libstdc++: Use custom timespec in system calls [PR 93421]Jonathan Wakely2-8/+32
On 32-bit targets where userspace has switched to 64-bit time_t, we cannot pass struct timespec to SYS_futex or SYS_clock_gettime, because the userspace definition of struct timespec will not match what the kernel expects. We use the existence of the SYS_futex_time64 or SYS_clock_gettime_time64 macros to imply that userspace *might* have switched to the new timespec definition. This is a conservative assumption. It's possible that the new syscall numbers are defined in the libc headers but that timespec hasn't been updated yet (as is the case for glibc currently). But using the alternative struct with two longs is still OK, it's just redundant if userspace timespec still uses a 32-bit time_t. We also check that SYS_futex_time64 != SYS_futex so that we don't try to use a 32-bit tv_sec on modern targets that only support the 64-bit system calls and define the old macro to the same value as the new one. We could possibly check #ifdef __USE_TIME_BITS64 to see whether userspace has actually been updated, but it's not clear if user code is meant to inspect that or if it's only for libc internal use. libstdc++-v3/ChangeLog: PR libstdc++/93421 * src/c++11/chrono.cc [_GLIBCXX_USE_CLOCK_GETTIME_SYSCALL] (syscall_timespec): Define a type suitable for SYS_clock_gettime calls. (system_clock::now(), steady_clock::now()): Use syscall_timespec instead of timespec. * src/c++11/futex.cc (syscall_timespec): Define a type suitable for SYS_futex and SYS_clock_gettime calls. (relative_timespec): Use syscall_timespec instead of timespec. (__atomic_futex_unsigned_base::_M_futex_wait_until): Likewise. (__atomic_futex_unsigned_base::_M_futex_wait_until_steady): Likewise.
2020-11-13libstdc++: Remove redundant overflow check for futex timeout [PR 93456]Jonathan Wakely2-12/+14
The relative_timespec function already checks for the case where the specified timeout is in the past, so the difference can never be negative. That means we dn't need to check if it's more negative than the minimum time_t value. libstdc++-v3/ChangeLog: PR libstdc++/93456 * src/c++11/futex.cc (relative_timespec): Remove redundant check negative values. * testsuite/30_threads/future/members/wait_until_overflow.cc: Moved to... * testsuite/30_threads/future/members/93456.cc: ...here.
2020-11-13c: C2x binary constantsJoseph Myers10-15/+69
C2x adds binary integer constants (approved at the last WG14 meeting, though not yet added to the working draft in git). Configure libcpp to consider these a standard feature in C2x mode, with appropriate updates to diagnostics including support for diagnosing them with -std=c2x -Wc11-c2x-compat. Bootstrapped with no regressions for x86_64-pc-linux-gnu. gcc/testsuite/ 2020-11-13 Joseph Myers <joseph@codesourcery.com> * gcc.dg/binary-constants-2.c, gcc.dg/binary-constants-3.c, gcc.dg/system-binary-constants-1.c: Update expected diagnostics. * gcc.dg/c11-binary-constants-1.c, gcc.dg/c11-binary-constants-2.c, gcc.dg/c2x-binary-constants-1.c, gcc.dg/c2x-binary-constants-2.c, gcc.dg/c2x-binary-constants-3.c: New tests. libcpp/ 2020-11-13 Joseph Myers <joseph@codesourcery.com> * expr.c (cpp_classify_number): Update diagnostic for binary constants for C. Also diagnose binary constants for -Wc11-c2x-compat. * init.c (lang_defaults): Enable binary constants for GNUC2X and STDC2X.
2020-11-13Revert accidental commitJan Hubicka1-2/+0
* tree-ssa-alias.c (ao_ref_base_alias_ptr_type): Remove accidental commit. (ao_ref_alias_ptr_type): Remove accidental commit.
2020-11-13testsuite: guality/redeclaration1.C test workaroundJakub Jelinek1-2/+6
Apparently older GDB versions didn't handle this test right and so while it has been properly printing 42 on line 14 (e.g. on x86_64), it issued a weird error on line 17 (and because it didn't print any value, guality testsuite wasn't marking it as FAIL). That has been apparently fixed in GDB 10, where it now (on x86_64) prints properly. Unfortunately that revealed that the test can suffer from instruction scheduling, where e.g. on i686 (but various other arches) the very first insn of the function (or whatever b 14 is on) happens to be load of the S::i variable from memory and that insn has the inner lexical scope, so GDB 10 prints there 24 instead of 42. The following insn is then the first store to l and there the automatic i is in scope and prints as 42 and then the second store to l where the inner lexical scope is current and prints 24 again. The test wasn't meant about insn scheduling but about whether we emit the DIEs properly, so this hack attempts to prevent the undesirable scheduling. 2020-11-13 Jakub Jelinek <jakub@redhat.com> * g++.dg/guality/redeclaration1.C (p): New variable. (S::f): Increment what p points to before storing S::i into l. Adjust gdb-test line numbers. (main): Initialize p to address of an automatic variable.