Commit Graph

189557 Commits

Author SHA1 Message Date
Bill Schmidt 71cf7c0a0e rs6000: Update rs6000_builtin_decl
Create a new version of this function that uses the new infrastructure,
and particularly checks for supported builtins the new way.

2021-11-08  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
	* config/rs6000/rs6000-call.c (rs6000_new_builtin_decl): New function.
	(rs6000_builtin_decl): Call it.
2021-11-08 08:49:37 -06:00
Martin Liska 355eb60b66 Fix static chain dump.
gcc/ChangeLog:

	* cgraph.c (cgraph_node::dump): Dump it from decl.
2021-11-08 12:57:08 +01:00
Martin Liska 7553bd35c8 gcov-profile: Fix -fcompare-debug with -fprofile-generate [PR100520]
PR gcov-profile/100520

gcc/ChangeLog:

	* coverage.c (coverage_compute_profile_id): Strip .gk when
	compare debug is used.
	* system.h (endswith): New function.

gcc/testsuite/ChangeLog:

	* gcc.dg/pr100520.c: New test.
2021-11-08 12:52:16 +01:00
Martin Liska 409767d774 Dump static chain for cgraph_node.
gcc/ChangeLog:

	* cgraph.c (cgraph_node::dump): Dump static_chain_decl.
2021-11-08 12:50:01 +01:00
Thomas Schwinge b7cd394606 Fix 'Copyright (C) 2020-21' into '2020-2021'
'contrib/update-copyright.py' currently complains:

    gcc/config/rs6000/rs6000-gen-builtins.c: unrecognised year: 21
    gcc/config/rs6000/rs6000-overload.def: unrecognised year: 21
    gcc/config/rs6000/rbtree.h: unrecognised year: 21
    gcc/config/rs6000/rbtree.c: unrecognised year: 21
    gcc/config/rs6000/rs6000-builtin-new.def: unrecognised year: 21

Fix up files added in commit fa5f8b49e5
"rs6000: Red-black tree implementation for balanced tree search",
commit 4a720a9547
"rs6000: Add initial input files",
commit bd5b625228
"rs6000: Initial create of rs6000-gen-builtins.c".

	gcc/
	* config/rs6000/rbtree.c: Fix 'Copyright (C) 2020-21' into '2020-2021'
	* config/rs6000/rbtree.h: Likewise.
	* config/rs6000/rs6000-builtin-new.def: Likewise.
	* config/rs6000/rs6000-gen-builtins.c: Likewise.
	* config/rs6000/rs6000-overload.def: Likewise.
2021-11-08 11:49:45 +01:00
Thomas Schwinge eb4a3e6a9a Fix 'contrib/update-copyright.py': 'TypeError: exceptions must derive from BaseException'
Running 'contrib/update-copyright.py' currently fails:

    [...]
    Traceback (most recent call last):
      File "contrib/update-copyright.py", line 365, in update_copyright
        canon_form = self.canonicalise_years (dir, filename, filter, years)
      File "contrib/update-copyright.py", line 270, in canonicalise_years
        (min_year, max_year) = self.year_range (years)
      File "contrib/update-copyright.py", line 253, in year_range
        year_list = [self.parse_year (year)
      File "contrib/update-copyright.py", line 253, in <listcomp>
        year_list = [self.parse_year (year)
      File "contrib/update-copyright.py", line 250, in parse_year
        raise self.BadYear (string)
    TypeError: exceptions must derive from BaseException

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "contrib/update-copyright.py", line 796, in <module>
        GCCCmdLine().main()
      File "contrib/update-copyright.py", line 527, in main
        self.copyright.process_tree (dir, filter)
      File "contrib/update-copyright.py", line 458, in process_tree
        self.process_file (dir, filename, filter)
      File "contrib/update-copyright.py", line 421, in process_file
        res = self.update_copyright (dir, filename, filter,
      File "contrib/update-copyright.py", line 366, in update_copyright
        except self.BadYear as e:
    TypeError: catching classes that do not inherit from BaseException is not allowed

Fix up for commit 3b25e83536
"Port update-copyright.py to Python3".

	contrib/
	* update-copyright.py (class BadYear): Derive from 'Exception'.
2021-11-08 11:48:26 +01:00
Richard Sandiford 05783fe65d aarch64: LD3/LD4 post-modify costs for struct modes
The LD3/ST3 and LD4/ST4 address cost code had no test coverage (oops).
This patch fixes that and updates it for the new structure modes.
The test only covers Advanced SIMD because SVE doesn't have
post-increment forms.

gcc/
	* config/aarch64/aarch64.c (aarch64_ldn_stn_vectors): New function.
	(aarch64_address_cost): Use it instead of testing for CImode and
	XImode directly.

gcc/testsuite/
	* gcc.target/aarch64/neoverse_v1_1.c: New test.
2021-11-08 10:36:25 +00:00
Richard Sandiford 8fd2477ddc genmodes: Define NUM_MODE_* macros
I was working on a patch that needed to calculate the number of
modes in a particular class.  It seemed better to have genmodes
generate this directly rather than do the kind of dance that
expmed.h had.

gcc/
	* genmodes.c (emit_insn_modes_h): Define NUM_MODE_* macros.
	* expmed.h (NUM_MODE_INT): Delete in favor of genmodes definitions.
	(NUM_MODE_PARTIAL_INT, NUM_MODE_VECTOR_INT): Likewise.
	* real.h (real_format_for_mode): Use NUM_MODE_FLOAT and
	NUM_MODE_DECIMAL_FLOAT.
	(REAL_MODE_FORMAT): Likewise.
2021-11-08 10:36:25 +00:00
Andre Vieira 61a7f947cc [vect] Consider outside costs earlier for epilogue loops
gcc/ChangeLog:

	* tree-vect-loop.c (vect_better_loop_vinfo_p): Change how epilogue loop
	costs are compared.
2021-11-08 09:35:45 +00:00
Richard Biener 5115207633 tree-optimization/103102 - fix error in vectorizer refactoring
This fixes an oversight that caused vectorized epilogues to have
versioning for niters applied.

2021-11-08  Richard Biener  <rguenther@suse.de>

	* tree-vectorizer.h (vect_create_loop_vinfo): Add main_loop_info
	parameter.
	* tree-vect-loop.c (vect_create_loop_vinfo): Likewise.  Set
	LOOP_VINFO_ORIG_LOOP_INFO and conditionalize set of
	LOOP_VINFO_NITERS_ASSUMPTIONS.
	(vect_analyze_loop_1): Adjust.
	(vect_analyze_loop): Move loop constraint setting and
	SCEV/niter reset here from vect_create_loop_vinfo to perform
	it only once.
	(vect_analyze_loop_form): Move dumping of symbolic niters
	here from vect_create_loop_vinfo.
2021-11-08 09:09:39 +01:00
Jan Hubicka 1f3a33633d Add loads/stores relative to static chain in ipa-modref
Adds tracking of accesses relative to static chain into modref
load/stores analysis.  This helps some Fortran benchmarks however it is still
quite limited.  One problem is that we never discover functions with nested
functions as const, pure or not accessing global memory because it contains
__builtin_dward_cfa call which we believe to be non-pure.

Bootstrapped/regtested x86_64-linux.  Plan to commit it tomorrow if there are
no complains and once periodic testers picks today modref changes.

Honza

gcc/ChangeLog:

	* ipa-modref-tree.h (enum modref_special_parms): New enum.
	(struct modref_access_node): update for special parms.
	(struct modref_ref_node): Likewise.
	(struct modref_parm_map): Likewise.
	(struct modref_tree): Likewise.
	* ipa-modref.c (dump_access): Likewise.
	(get_access): Detect static chain.
	(parm_map_for_arg): Take tree as arg instead of
	stmt and index.
	(merge_call_side_effects): Compute map for static chain.
	(process_fnspec): Update.
	(struct escape_point): Remove retslot_arg and static_chain_arg.
	(analyze_parms): Update.
	(compute_parm_map): Update.
	(propagate_unknown_call): Update.
	(modref_propagate_in_scc): Update.
	(modref_merge_call_site_flags): Update.
	(ipa_merge_modref_summary_after_inlining): Update.
	* tree-ssa-alias.c (modref_may_conflict): Handle static chain.
	* ipa-modref-tree.c (test_merge): Update.

gcc/testsuite/ChangeLog:

	* gcc.dg/tree-ssa/modref-12.c: New test.
2021-11-08 07:52:45 +01:00
Haochen Gui 14e355df30 Disables gimple folding for VSX_BUILTIN_XVMINDP, VSX_BUILTIN_XVMAXDP,ALTIVEC_BUILTIN_VMINFP and ALTIVEC_BUILTIN_VMAXFP when fast-math is not set.
gcc/
	* config/rs6000/rs6000-call.c (rs6000_gimple_fold_builtin): Disable
	gimple fold for VSX_BUILTIN_XVMINDP, ALTIVEC_BUILTIN_VMINFP,
	VSX_BUILTIN_XVMAXDP, ALTIVEC_BUILTIN_VMAXFP when fast-math is not
	set.

gcc/testsuite/
	* gcc.target/powerpc/vec-minmax-1.c: New test.
	* gcc.target/powerpc/vec-minmax-2.c: Likewise.
2021-11-08 10:48:49 +08:00
liuhongt ae1de0bf72 Update documentation for -ftree-loop-vectorize and -ftree-slp-vectorize which are enabled by default at -02.
gcc/ChangeLog:

	PR tree-optimization/103077
	* doc/invoke.texi (Options That Control Optimization):
	Update documentation for -ftree-loop-vectorize and
	-ftree-slp-vectorize which are enabled by default at -02.
2021-11-08 09:38:26 +08:00
liuhongt a1f7ead09c Add !HONOR_SNANS to simplifcation: (trunc)copysign((extend)a, (extend)b) to copysign (a, b).
> Note that this is not safe with -fsignaling-nans, so needs to be disabled
> for that option (if there isn't already logic somewhere with that effect),
> because the extend will convert a signaling NaN to quiet (raising
> "invalid"), but copysign won't, so this transformation could result in a
> signaling NaN being wrongly returned when the original code would never
> have returned a signaling NaN.
>
> --
> Joseph S. Myers
> joseph@codesourcery.com

gcc/ChangeLog

	PR target/102464
	* match.pd (Simplifcation (trunc)copysign((extend)a, (extend)b)
	to .COPYSIGN (a, b)): Add !HONOR_SNANS.
2021-11-08 09:34:35 +08:00
liuhongt 2ad1e8081f [Gimple] Simplify (trunc)fma ((extend)a, (extend)b, (extend)c) to IFN_FMA (a,b, c).
a, b, c are same type as truncation type and has less precision than
extend type, the optimization is guarded under
flag_unsafe_math_optimizations.

gcc/ChangeLog:
	PR target/102464
	* match.pd: Simplify
	(trunc)fma ((extend)a, (extend)b, (extend)c) to IFN_FMA (a, b,
	c) under flag_unsafe_math_optimizations.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/pr102464-fma.c: New test.
2021-11-08 09:19:29 +08:00
GCC Administrator 3cb25fd1ad Daily bump. 2021-11-08 00:16:17 +00:00
Thomas Koenig 962ff7d284 Fix keyword name for co_reduce.
gcc/fortran/ChangeLog:

	* intrinsic.c (add_subroutines): Change keyword "operator"
	to the correct one, "operation".
	* check.c (gfc_check_co_reduce): Change OPERATOR to
	OPERATION in error messages.
	* intrinsic.texi: Change OPERATOR to OPERATION in
	documentation.

gcc/testsuite/ChangeLog:

	* gfortran.dg/co_reduce_2.f90: New test.
	* gfortran.dg/coarray_collectives_14.f90: Change OPERATOR
	to OPERATION.
	* gfortran.dg/coarray_collectives_16.f90: Likewise.
	* gfortran.dg/coarray_collectives_9.f90: Likewise.

	Co-authored by: Steve Kargl <steve@gcc.gnu.org>
2021-11-07 23:06:46 +01:00
Jan Hubicka 87e57378ba Limit range of modref-max-depth
gcc/ChangeLog:

	PR ipa/103055
	* params.opt (modref-max-depth): Add range.
	(modref-max-adjustments): Fix range.
2021-11-07 23:00:54 +01:00
Aldy Hernandez 2be794fae0 Remove VRP threader.
Now that things have stabilized, we can remove the old code.

I have left the hybrid threader in tree-ssa-threadedge, even though the
VRP threader was the only user, because we may need it as an interim
step for DOM threading removal.

Tested on x86-64 Linux.

gcc/ChangeLog:

	* tree-pass.h (make_pass_vrp_threader): Remove.
	* tree-ssa-threadbackward.c
	(back_threader_profitability::profitable_path_p): Remove
	ASSERT_EXPR references.
	* tree-ssa-threadedge.c (jt_state::register_equivs_stmt): Same.
	* tree-vrp.c (vrp_folder::simplify_casted_conds): Same.
	(execute_vrp): Same.
	(class hybrid_threader): Remove.
	(hybrid_threader::hybrid_threader): Remove.
	(hybrid_threader::~hybrid_threader): Remove.
	(hybrid_threader::before_dom_children): Remove.
	(hybrid_threader::after_dom_children): Remove.
	(execute_vrp_threader): Remove.
	(class pass_vrp_threader): Remove.
	(make_pass_vrp_threader): Remove.
2021-11-07 19:08:57 +01:00
Sandra Loosemore ee11be7f2d Fortran: Diagnose all operands/arguments with constraint violations
04-Nov-2021  Sandra Loosemore <sandra@codesourcery.com>
	     Bernhard Reutner-Fischer <aldot@gcc.gnu.org>

	 PR fortran/101337

gcc/fortran/ChangeLog:
	* interface.c (gfc_compare_actual_formal): Continue checking
	all arguments after encountering an error.
	* intrinsic.c (do_ts29113_check): Likewise.
	* resolve.c (resolve_operator): Continue resolving on op2 error.

gcc/testsuite/ChangeLog:
	* gfortran.dg/bessel_3.f90: Expect additional diagnostics from
	multiple bad arguments in the call.
	* gfortran.dg/pr24823.f: Likewise.
	* gfortran.dg/pr39937.f: Likewise.
	* gfortran.dg/pr41011.f: Likewise.
	* gfortran.dg/pr61318.f90: Likewise.
	* gfortran.dg/c-interop/c407b-2.f90: Remove xfails.
	* gfortran.dg/c-interop/c535b-2.f90: Likewise.
2021-11-07 09:35:04 -08:00
Jan Hubicka f6f704fd10 Fix inter-procedural EAF flags propagation with respect to !binds_to_current_def_p
While proofreading the code for handling EAF flags of !binds_to_current_def_p I
noticed that the interprocedural dataflow actually ignores the flag possibly
introducing wrong code on quite complex interposable functions in non-trivial
recursion cycles (or at ltrans partition boundary).

This patch unifies the flags changes to single place (remove_useless_eaf_flags)
and does extend modref_merge_call_site_flags to do the right thing.

lto-bootstrapped/regtested x86_64-linux.  Plan to commit it today after bit
more testing (firefox/clang build).

gcc/ChangeLog:

	* gimple.c (gimple_call_arg_flags): Use interposable_eaf_flags.
	(gimple_call_retslot_flags): Likewise.
	(gimple_call_static_chain_flags): Likewise.
	* ipa-modref.c (remove_useless_eaf_flags): Do not remove everything for
	NOVOPS.
	(modref_summary::useful_p): Likewise.
	(modref_summary_lto::useful_p): Likewise.
	(analyze_parms): Do not give up on NOVOPS.
	(analyze_function): When dumping report chnages in EAF flags
	between IPA and local pass.
	(modref_merge_call_site_flags): Compute implicit eaf flags
	based on callee ecf_flags and fnspec; if the function does not
	bind to current defs use interposable_eaf_flags.
	(modref_propagate_flags_in_scc): Update.
	* ipa-modref.h (interposable_eaf_flags): New function.
2021-11-07 18:20:45 +01:00
Bill Schmidt a28cfe4920 rs6000: Replace the builtin expansion machinery
This patch forms the meat of the improvements for this patch series.
We develop a replacement for rs6000_expand_builtin and its supporting
functions, which are inefficient and difficult to maintain.

Differences between the old and new support in this patch include:
 - Make use of the new builtin data structures, directly looking up
   a function's information rather than searching for the function
   multiple times;
 - Test for enablement of builtins at expand time, to support #pragma
   target changes within a compilation unit;
 - Use the builtin function attributes (e.g., bif_is_cpu) to control
   special handling;
 - Refactor common code into one place; and
 - Provide common error handling in one place for operands that are
   restricted to specific values or ranges.

2021-11-07  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
	* config/rs6000/rs6000-call.c (rs6000_expand_new_builtin): New
	forward decl.
	(rs6000_invalid_new_builtin): New function.
	(rs6000_expand_builtin): Call rs6000_expand_new_builtin.
	(rs6000_expand_ldst_mask): New function.
	(new_cpu_expand_builtin): Likewise.
	(elemrev_icode): Likewise.
	(ldv_expand_builtin): Likewise.
	(lxvrse_expand_builtin): Likewise.
	(lxvrze_expand_builtin): Likewise.
	(stv_expand_builtin): Likewise.
	(new_mma_expand_builtin): Likewise.
	(new_htm_spr_num): Likewise.
	(new_htm_expand_builtin): Likewise.
	(rs6000_expand_new_builtin): Likewise.
	(rs6000_init_builtins): Initialize altivec_builtin_mask_for_load.
2021-11-07 09:23:55 -06:00
Jan Hubicka 4898e958a9 Implement intra-procedural dataflow in ipa-modref flags propagation.
implement the (long promised) intraprocedural dataflow for
propagating eaf flags, so we can handle parameters that participate
in loops in SSA graphs. Typical example are acessors that walk linked
lists, for example.

I implemented dataflow using the standard iteration over BBs in RPO some time
ago, but did not like it becuase it had measurable compile time impact with
very small code quality effect. This is why I kept mainline to do the DFS walk
instead. The reason is that we care about flags of SSA names that corresponds
to parameters and those can be often determined from a small fraction of the
SSA graph so solving dataflow for all SSA names in a function is a waste.

This patch implements dataflow more carefully.  The DFS walk is kept in place to
solve acyclic cases and discover the relevat part of SSA graph into new graph
(which is similar to one used for inter-procedrual dataflow - we only need to
know the edges and if the access is direct or derefernced).  The RPO iterative
dataflow then works on this simplified graph.

This seems to be fast in practice. For GCC linktime we do dataflow for 4881
functions. Out of that 4726 finishes in one iteration, 144 in two and 10 in 3.

Overall 31979 functions are analysed, so we do dataflow only for bit over of
10% of cases.  131123 edges are visited by the solver.  I measured no compile
time impact of this.

gcc/ChangeLog:

	* ipa-modref.c (modref_lattice): Add do_dataflow,
	changed and propagate_to fields.
	(modref_lattice::release): Free propagate_to
	(modref_lattice::merge): Do not give up early on unknown
	lattice values.
	(modref_lattice::merge_deref): Likewise.
	(modref_eaf_analysis): Update toplevel comment.
	(modref_eaf_analysis::analyze_ssa_name): Record postponned ssa names;
	do optimistic dataflow initialization.
	(modref_eaf_analysis::merge_with_ssa_name): Build dataflow graph.
	(modref_eaf_analysis::propagate): New member function.
	(analyze_parms): Update to new API of modref_eaf_analysis.
2021-11-07 09:35:16 +01:00
GCC Administrator 9defce6228 Daily bump. 2021-11-07 00:16:19 +00:00
Jan Hubicka 6078eb7452 Fix can_be_discarded_p wrt partitioned functions.
gcc/ChangeLog:

	* cgraph.h (cgraph_node::can_be_discarded_p): Do not
	return true on functions from other partition.

gcc/lto/ChangeLog:

	PR ipa/103070
	PR ipa/103058
	* lto-partition.c (must_not_rename): Update comment.
	(promote_symbol): Set resolution to LDPR_PREVAILING_DEF_IRONLY.
2021-11-06 23:36:08 +01:00
Harald Anlauf df2135e88a Fortran: error recovery on rank mismatch of array and its initializer
gcc/fortran/ChangeLog:

	PR fortran/102715
	* decl.c (add_init_expr_to_sym): Reject rank mismatch between
	array and its initializer.

gcc/testsuite/ChangeLog:

	PR fortran/102715
	* gfortran.dg/pr68019.f90: Adjust error message.
	* gfortran.dg/pr102715.f90: New test.
2021-11-06 19:42:01 +01:00
David Edelsohn 6b8152b96c powerpc: Fix vsx_splat_v4si in 32 bit mode
Tamar's recent patch to teach CSE to perform vector extract exercises
VSX splat more frequently, which exposed a constraint error for the
vsx_splat patterns.  The pattern could be created for Power9, but
the "we constraint only provided alternatives in 64 bit mode. The
instructions are valid in 32 bit mode and SImode is allowed in VSX
registers.  This patch updates the constraints from "we" to "wa" to
allow the pattern and fix the failing testcases.

gcc/ChangeLog:

	* config/rs6000/vsx.md (vsx_splat_v4si): Change constraints to "wa".
	(vsx_splat_v4si_di): Change constraint to "wa".
2021-11-06 11:48:46 -04:00
Aldy Hernandez 4856699eeb path oracle: Do not look at root oracle for killed defs.
The problem here is that we are incorrectly threading 41->20->21 here:

  <bb 35> [local count: 56063504182]:
  _134 = M.10_120 + 1;
  if (_71 <= _134)
    goto <bb 19>; [11.00%]
  else
    goto <bb 41>; [89.00%]
...
...
...
  <bb 41> [local count: 49896518755]:

  <bb 20> [local count: 56063503181]:
  # lb_75 = PHI <_134(41), 1(18)>
  _117 = mstep_49 + lb_75;
  _118 = _117 + -1;
  _119 = mstep_49 + _118;
  M.10_120 = MIN_EXPR <_119, _71>;
  if (lb_75 > M.10_120)
    goto <bb 21>; [11.00%]
  else
    goto <bb 22>; [89.00%]

First, lb_17 == _134 because of the PHI.
Second, _134 > M.10_120 because of _134 = M.10_120 + 1.

We then assume that lb_75 > M.10_120, but this is incorrect because
M.10_120 was killed along the path.

This incorrect thread causes the miscompilation in 527.cam4_r.

Tested on x86-64 and ppc64le Linux.

gcc/ChangeLog:

	PR tree-optimization/103061
	* value-relation.cc (path_oracle::path_oracle): Initialize
	m_killed_defs.
	(path_oracle::killing_def): Set m_killed_defs.
	(path_oracle::query_relation): Do not look at the root oracle for
	killed defs.
	* value-relation.h (class path_oracle): Add m_killed_defs.
2021-11-06 16:33:03 +01:00
David Edelsohn b3a38d1835 testsuite: Use posix_memalign on AIX for tsvc
AIX does not provide memalign, so the testcases much use
posix_memalign for portability on AIX.

gcc/testsuite/ChangeLog:

	* gcc.dg/vect/tsvc/tsvc.h (init): Use posix_memalign on AIX.
2021-11-06 11:31:16 -04:00
Aldy Hernandez 98b212c19a Cleanup back_threader::find_path_to_names.
The main path discovery function was due for a cleanup.  First,
there's a nagging goto and second, my bitmap use was sloppy.  Hopefully
this makes the code easier for others to read.

Regstrapped on x86-64 Linux.  I also made sure there were no difference
in the number of threads with this patch.

No functional changes.

gcc/ChangeLog:

	* tree-ssa-threadbackward.c (back_threader::find_paths_to_names):
	Remove gotos and other cleanups.
2021-11-06 14:11:58 +01:00
GCC Administrator 851dff042a Daily bump. 2021-11-06 00:16:24 +00:00
Harald Anlauf bcf3728abe Fortran: fix simplification of array-valued parameter expressions
gcc/fortran/ChangeLog:

	PR fortran/102817
	* expr.c (simplify_parameter_variable): Copy shape of referenced
	subobject when simplifying.

gcc/testsuite/ChangeLog:

	PR fortran/102817
	* gfortran.dg/pr102817.f90: New test.
2021-11-05 23:48:20 +01:00
Jan Hubicka 5f37780372 Fix ice in insert_access
gcc/ChangeLog:

	PR ipa/103073
	* ipa-modref-tree.h (modref_tree::insert): Do nothing for
	paradoxical and zero sized accesses.

gcc/testsuite/ChangeLog:

	PR ipa/103073
	* g++.dg/torture/pr103073.C: New test.
	* gcc.dg/tree-ssa/modref-11.c: New test.
2021-11-05 23:32:55 +01:00
Jan Hubicka 9cc8ca8da9 Avoid left shift of negative value in ipa-modref-tree.h
gcc/ChangeLog:

	PR ipa/103082
	* ipa-modref-tree.h (struct modref_access_node): Avoid left shift
	of negative value
2021-11-05 23:17:50 +01:00
Harald Anlauf 432ed97b99 Fortran: a symbol in a COMMON cannot be a coarray
gcc/fortran/ChangeLog:

	PR fortran/69419
	* match.c (gfc_match_common): Check array spec of a symbol in a
	COMMON object list and reject it if it is a coarray.

gcc/testsuite/ChangeLog:

	PR fortran/69419
	* gfortran.dg/pr69419.f90: New test.
2021-11-05 23:14:57 +01:00
Jonathan Wakely 2b2d97fc54 libstdc++: Fix inconsistent noexcept-specific for valarray begin/end
These declarations should be noexcept after I added it to the
definitions in <valarray>.

libstdc++-v3/ChangeLog:

	* include/bits/range_access.h (begin(valarray), end(valarray)):
	Add noexcept.
2021-11-05 21:44:01 +00:00
Jonathan Wakely 70d6f6e41f libstdc++: Fix pack expansions in tuple_size_v specializations
libstdc++-v3/ChangeLog:

	* include/std/tuple (tuple_size_v): Fix pack expansion.
2021-11-05 21:44:00 +00:00
Bernhard Reutner-Fischer 1727bb533e Fortran: Missing error with IMPLICIT none (external) [PR100972]
gcc/fortran/ChangeLog:

	PR fortran/100972
	* decl.c (gfc_match_implicit_none): Fix typo in warning.
	* resolve.c (resolve_unknown_f): Reject external procedures
	without explicit EXTERNAL attribute whe IMPLICIT none (external)
	is in effect.

gcc/testsuite/ChangeLog:

	PR fortran/100972
	* gfortran.dg/implicit_14.f90: Adjust error.
	* gfortran.dg/external_implicit_none_3.f08: New test.
2021-11-05 22:09:48 +01:00
Bernhard Reutner-Fischer c64ca0e7bb Fortran: Delete unused decl in gfortran.h
gcc/fortran/ChangeLog:

	* decl.c (gfc_insert_kind_parameter_exprs): Make static.
	* expr.c (gfc_build_init_expr): Make static
	(gfc_build_default_init_expr): Move below its static helper.
	* gfortran.h (gfc_insert_kind_parameter_exprs, gfc_add_saved_common,
	gfc_add_common, gfc_use_derived_tree, gfc_free_charlen,
	gfc_get_ultimate_derived_super_type,
	gfc_resolve_oacc_parallel_loop_blocks, gfc_build_init_expr,
	gfc_iso_c_sub_interface): Delete.
	* symbol.c (gfc_new_charlen, gfc_get_derived_super_type): Make
	static.
2021-11-05 22:09:04 +01:00
Sandra Loosemore 452a0afbac Fortran: Add more documentation for mixed-language programming [PR35276]
2021-11-05  Sandra Loosemore  <sandra@codesourcery.com>

	PR fortran/35276

	gcc/fortran/
	* gfortran.texi (Mixed-Language Programming): Talk about C++,
	and how to link.
2021-11-05 14:08:36 -07:00
Iain Sandoe 8f4860f956 testsuite, Darwin : Fix tsvc test build on Darwin.
Currently all the tsvc tests fail to build on Darwin because
they assume that <malloc.h> and memalign() are available.

For Darwin, <stdlib.h> is sufficient to obtain the declarations
for malloc and the port has posix_memalign () but not memalign.

Fixed as below.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/testsuite/ChangeLog:

	* gcc.dg/vect/tsvc/tsvc.h: Do not try to include malloc.h
	on Darwin also use posix_memalign ().
2021-11-05 21:06:36 +00:00
Iain Sandoe f1e2879ecf Darwin : Make trampoline templates linker-visible.
For aarch64, the alignment of the LTRAMPn symbols matters.

Actually, the LTRAMPn  symbols _are_ 8 byte aligned, but because
they are Local, the linker doesn't know that this guarantee can be met.
It assumes that they are not necessarily more aligned than the
containing section (ld64 atoms strike again).

The fix is to publish the trampoline symbol for the linker to access
directly - it can then see that the atom is suitably aligned.

Fixes issue #11 on the development branch.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/ChangeLog:

	* config/darwin.h (ASM_GENERATE_INTERNAL_LABEL): Add LTRAMP
	to the list of symbol prefixes that must be made linker-
	visible.
2021-11-05 21:00:53 +00:00
Iain Sandoe f8a1e06993 Darwin, aarch64 : Ada fixes for hosted tools.
This will allow someone (with an existing Ada compiler on the
platform - which can be provided by the experimental aarch64-darwin
branch) - to build the host tools (gnatmake and friends) for a
non-native cross.

The existing provisions for iOS are OK for cross-compilation from
an x86-64-darwin platform, but we need some adjustments so that these
host tools can be built to run on aarch64-darwin.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/ada/

	* gcc-interface/Make-lang.in: Use iOS signal trampoline code
	for hosted Ada tools.
	* sigtramp-ios.c: Wrap the declarations in extern "C" when
	the code is built by a C++ compiler.
2021-11-05 20:58:36 +00:00
Iain Sandoe 834c8749ce Darwin, aarch64 : Initial support for the self-host driver.
At present, there is no special action needed for aarch64-darwin
this just pulls in generic Darwin code.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/ChangeLog:

	* config.host: Add support for aarch64-*-darwin.
	* config/aarch64/host-aarch64-darwin.c: New file.
	* config/aarch64/x-darwin: New file.
2021-11-05 20:52:42 +00:00
Iain Sandoe 7a300b413a Darwin, crts: Fix a build warning.
We have a shim crt for Darwin10 that implements functionality
missing in libSystem. Provide this with a prototype to silence the
warning about this.

libgcc/ChangeLog:

	* config/darwin10-unwind-find-enc-func.c: Include libgcc_tm.h.
	* config/i386/darwin-lib.h: Declare Darwin10 crt function.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2021-11-05 20:48:05 +00:00
Jonathan Wakely 2627e3b7fd libstdc++: Add [[unlikely]] attributes to std::random_device routines
libstdc++-v3/ChangeLog:

	* src/c++11/random.cc (__x86_rdrand, __x86_rdseed): Add
	[[unlikely]] attribute.
2021-11-05 18:14:41 +00:00
Jonathan Wakely 5997e6a6ec libstdc++: Add support for POWER9 DARN instruction to std::random_device
The ISA-3.0 instruction set includes DARN ("deliver a random number")
which can be used similarly to the existing support for RDRAND and RDSEED.

libstdc++-v3/ChangeLog:

	* src/c++11/random.cc [__powerpc__] (USE_DARN): Define.
	(__ppc_darn): New function to use POWER9 DARN instruction.
	(Which): Add 'darn' enumerator.
	(which_source): Check for __ppc_darn.
	(random_device::_M_init): Support "darn" and "hw" tokens.
	(random_device::_M_getentropy): Add darn to switch.
	* testsuite/26_numerics/random/random_device/cons/token.cc:
	Check "darn" token.
	* testsuite/26_numerics/random/random_device/entropy.cc:
	Likewise.
2021-11-05 18:14:40 +00:00
Martin Liska bdb9d47218 libsanitizer: update LOCAL_PATCHES. 2021-11-05 18:21:42 +01:00
H.J. Lu 5f0a3fb08c libsanitizer: Apply local patches 2021-11-05 18:21:29 +01:00
Martin Liska 2afc8f0b91 libsanitizer: merge from master (78d3e0a4f1406b17cdecc77540e09210670fe9a9). 2021-11-05 18:21:27 +01:00