181475 Commits

Author SHA1 Message Date
Jonathan Wakely
5e6a43158d libstdc++: Add missing header to some tests
These tests use std::this_thread::sleep_for without including <thread>.

libstdc++-v3/ChangeLog:

	* testsuite/30_threads/async/async.cc: Include <thread>.
	* testsuite/30_threads/future/members/93456.cc: Likewise.
2020-11-19 16:17:33 +00:00
Wilco Dijkstra
5c5a67e61b AArch64: Add cost table for Cortex-A76
Add an initial cost table for Cortex-A76 - this is copied from
cotexa57_extra_costs but updated based on the Optimization Guide.
Use the new cost table on all Neoverse tunings and ensure the tunings
are consistent for all.  As a result more compact code is generated
with more combined shift+alu operations. Eg. -mcpu=cortex-a76 will now
merge the shifts in:

int f(int x, int y) { return (x & y << 3) * (x | y << 3); }

and  w2, w0, w1, lsl 3
orr  w0, w0, w1, lsl 3
mul  w0, w2, w0
ret

SPEC2017 codesize improves by 0.02% and SPECINT2017 shows 0.24% gain.

2020-11-18  Wilco Dijkstra  <wdijkstr@arm.com>

gcc/
	* config/aarch64/aarch64.c (neoversen1_tunings): Use new
	cortexa76_extra_costs.
	(neoversev1_tunings): Likewise.
	(neoversen2_tunines): Likewise.
	* config/arm/aarch-cost-tables.h (cortexa76_extra_costs):
	add new costs.
2020-11-19 16:14:11 +00:00
Wilco Dijkstra
1d77928fc4 AArch64: Improve inline memcpy expansion
Improve the inline memcpy expansion.  Use integer load/store for copies <= 24
bytes instead of SIMD.  Set the maximum copy to expand to 256 by default,
except that -Os or no Neon expands up to 128 bytes.  When using LDP/STP of
Q-registers, also use Q-register accesses for the unaligned tail, saving 2
instructions (eg. all sizes up to 48 bytes emit exactly 4 instructions).
Cleanup code and comments.

The codesize gain vs the GCC10 expansion is 0.05% on SPECINT2017.

2020-11-03  Wilco Dijkstra  <wdijkstr@arm.com>

gcc/
	* config/aarch64/aarch64.c (aarch64_expand_cpymem): Cleanup code and
	comments, tweak expansion decisions and improve tail expansion.
2020-11-19 16:05:33 +00:00
Eric Botcazou
2729378d09 Fix PR ada/97805
We need to include limits.h (or <climits>) in adaint.c because of LLONG_MIN.

gcc/ada/ChangeLog:
	PR ada/97805
	* adaint.c: Include climits in C++ and limits.h otherwise.
2020-11-19 16:41:34 +01:00
Nathan Sidwell
9844497a93 preprocessor: main file searching
This adds the capability to locate the main file on the user or system
include paths.  That's extremely useful to users building header
units.  Searching has to be requiested (plain header-unit compilation
will not search).  Also, to make include_next work as expected when
building a header unit, we add a mechanism to retrofit a non-searched
source file as one on the include path.

	libcpp/
	* include/cpplib.h (enum cpp_main_search): New.
	(struct cpp_options): Add main_search field.
	(cpp_main_loc): Declare.
	(cpp_retrofit_as_include): Declare.
	* internal.h (struct cpp_reader): Add main_loc field.
	(_cpp_in_main_source_file): Not main if main is a header.
	* init.c (cpp_read_main_file): Use main_search option to locate
	main file.  Set main_loc
	* files.c (cpp_retrofit_as_include): New.
2020-11-19 07:05:08 -08:00
Jonathan Wakely
b204d7722d libstdc++: Move std::thread to a new header
This makes it possible to use std::thread without including the whole of
<thread>. It also makes this_thread::get_id() and this_thread::yield()
available even when there is no gthreads support (e.g. when GCC is built
with --disable-threads or --enable-threads=single).

In order for the std:🧵:id return type of this_thread::get_id() to
be defined, std:thread itself is defined unconditionally. However the
constructor that creates new threads is not defined for single-threaded
builds. The thread::join() and thread::detach() member functions are
defined inline for single-threaded builds and just throw an exception
(because we know the thread cannot be joinable if the constructor that
creates joinable threads doesn't exit).

The thread::hardware_concurrency() member function is also defined
inline and returns 0 (as suggested by the standard when the value "is
not computable or well-defined").

The main benefit for most targets is that other headers such as <future>
do not need to include the whole of <thread> just to be able to create a
std::thread. That avoids including <stop_token> and std::jthread where
not required. This is another partial fix for PR 92546.

This also means we can use this_thread::get_id() and this_thread::yield()
in <stop_token> instead of using the gthread functions directly. This
removes some preprocessor conditionals, simplifying the code.

libstdc++-v3/ChangeLog:

	PR libstdc++/92546
	* include/Makefile.am: Add new <bits/std_thread.h> header.
	* include/Makefile.in: Regenerate.
	* include/std/future: Include new header instead of <thread>.
	* include/std/stop_token: Include new header instead of
	<bits/gthr.h>.
	(stop_token::_S_yield()): Use this_thread::yield().
	(_Stop_state_t::_M_requester): Change type to std:🧵:id.
	(_Stop_state_t::_M_request_stop()): Use this_thread::get_id().
	(_Stop_state_t::_M_remove_callback(_Stop_cb*)): Likewise.
	Use __is_single_threaded() to decide whether to synchronize.
	* include/std/thread (thread, operator==, this_thread::get_id)
	(this_thread::yield): Move to new header.
	(operator<=>, operator!=, operator<, operator<=, operator>)
	(operator>=, hash<thread::id>, operator<<): Define even when
	gthreads not available.
	* src/c++11/thread.cc: Include <memory>.
	* include/bits/std_thread.h: New file.
	(thread, operator==, this_thread::get_id, this_thread::yield):
	Define even when gthreads not available.
	[!_GLIBCXX_HAS_GTHREADS] (thread::join, thread::detach)
	(thread::hardware_concurrency): Define inline.
2020-11-19 13:36:15 +00:00
Jonathan Wakely
b108faa940 libstdc++: Fix overflow checks to use the correct "time_t" [PR 93456]
I recently added overflow checks to src/c++11/futex.cc for PR 93456, but
then changed the type of the timespec for PR 93421. This meant the
overflow checks were no longer using the right range, because the
variable being written to might be smaller than time_t.

This introduces new typedef that corresponds to the tv_sec member of the
struct being passed to the syscall, and uses that typedef in the range
checks.

libstdc++-v3/ChangeLog:

	PR libstdc++/93421
	PR libstdc++/93456
	* src/c++11/futex.cc (syscall_time_t): New typedef for
	the type of the syscall_timespec::tv_sec member.
	(relative_timespec, _M_futex_wait_until)
	(_M_futex_wait_until_steady): Use syscall_time_t in overflow
	checks, not time_t.
2020-11-19 13:33:11 +00:00
Nathan Sidwell
bf425849f1 preprocessor: main-file cleanup
In preparing module patch 7 I realized there was a cleanup I could
make to simplify it.  This is that cleanup.  Also, when doing the
cleanup I noticed some macros had been turned into inline functions,
but not renamed to the preprocessors internal namespace
(_cpp_$INTERNAL rather than cpp_$USER).  Thus, this renames those
functions, deletes an internal field of the file structure, and
determines whether we're in the main file by comparing to
pfile->main_file, the _cpp_file of the main file.

	libcpp/
	* internal.h (cpp_in_system_header): Rename to ...
	(_cpp_in_system_header): ... here.
	(cpp_in_primary_file): Rename to ...
	(_cpp_in_main_source_file): ... here.  Compare main_file equality
	and check main_search value.
	* lex.c (maybe_va_opt_error, _cpp_lex_direct): Adjust for rename.
	* macro.c (_cpp_builtin_macro_text): Likewise.
	(replace_args): Likewise.
	* directives.c (do_include_next): Likewise.
	(do_pragma_once, do_pragma_system_header): Likewise.
	* files.c (struct _cpp_file): Delete main_file field.
	(pch_open): Check pfile->main_file equality.
	(make_cpp_file): Drop cpp_reader parm, don't set main_file.
	(_cpp_find_file): Adjust.
	(_cpp_stack_file): Check pfile->main_file equality.
	(struct report_missing_guard_data): Add cpp_reader field.
	(report_missing_guard): Check pfile->main_file equality.
	(_cpp_report_missing_guards): Adjust.
2020-11-19 04:47:00 -08:00
Richard Biener
d84ba819fe Fix bootstrap
This fixes a typo in the TREE_CODE compare which should
compare against TYPE_DECL, not TYPE_NAME.

2020-11-19  Richard Biener  <rguenther@suse.de>

	* fold-const.c (operand_compare::hash_operand): Fix typo.
2020-11-19 13:42:11 +01:00
Richard Biener
717e22dcd4 Fix gcc.dg/pr97897.c
This adds dg-options "" to avoid the pedantic error on _Complex int.

2020-11-19  Richard Biener  <rguenther@suse.de>

	* gcc.dg/pr97897.c: Add dg-options.
2020-11-19 13:27:55 +01:00
Richard Biener
b08e0ee301 refactor reassocs get_rank
This refactors things so assigned ranks are dumped and the cache
is consistently used also for PHIs.

2020-11-19  Richard Biener  <rguenther@suse.de>

	* tree-ssa-reassoc.c (get_rank): Refactor to consistently
	use the cache and dump ranks assigned.
2020-11-19 13:27:55 +01:00
Jan Hubicka
d8cf897674 Fix operand_equal_p hash and copare of ODR_TYPE_REF
* fold-const.c (operand_compare::operand_equal_p): More OBJ_TYPE_REF
	matching to correct place; drop OEP_ADDRESS_OF for TOKEN, OBJECT and
	class.
	(operand_compare::hash_operand): Hash ODR type for OBJ_TYPE_REF.
2020-11-19 13:08:29 +01:00
Joel Hutton
27842e2a1e [3/3] [AArch64][vect] vec_widen_lshift pattern
Add aarch64 vec_widen_lshift_lo/hi patterns and fix bug it triggers in
mid-end. This pattern takes one vector with N elements of size S, shifts
each element left by the element width and stores the results as N
elements of size 2*s (in 2 result vectors). The aarch64 backend
implements this with the shll,shll2 instruction pair.

gcc/ChangeLog:

	* config/aarch64/aarch64-simd.md: Add vec_widen_lshift_hi/lo<mode>
	patterns.
	* tree-vect-stmts.c (vectorizable_conversion): Fix for widen_lshift
	case.

gcc/testsuite/ChangeLog:

	* gcc.target/aarch64/vect-widen-lshift.c: New test.
2020-11-19 11:49:59 +00:00
Joel Hutton
9fc9573f9a [2/3] [vect] Add widening add, subtract patterns
Add widening add, subtract patterns to tree-vect-patterns. Update the
widened code of patterns that detect PLUS_EXPR to also detect
WIDEN_PLUS_EXPR. These patterns take 2 vectors with N elements of size
S and perform an add/subtract on the elements, storing the results as N
elements of size 2*S (in 2 result vectors). This is implemented in the
aarch64 backend as addl,addl2 and subl,subl2 respectively. Add aarch64
tests for patterns.

gcc/ChangeLog:
	* doc/generic.texi: Document new widen_plus/minus_lo/hi tree codes.
	* doc/md.texi: Document new widenening add/subtract hi/lo optabs.
	* expr.c (expand_expr_real_2): Add widen_add, widen_subtract cases.
	* optabs-tree.c (optab_for_tree_code): Add case for widening optabs.
	* optabs.def (OPTAB_D): Define vectorized widen add, subtracts.
	* tree-cfg.c (verify_gimple_assign_binary): Add case for widening adds,
	subtracts.
	* tree-inline.c (estimate_operator_cost): Add case for widening adds,
	subtracts.
	* tree-vect-generic.c (expand_vector_operations_1): Add case for
	widening adds, subtracts
	* tree-vect-patterns.c (vect_recog_widen_add_pattern): New recog
	pattern.
	(vect_recog_widen_sub_pattern): New recog pattern.
	(vect_recog_average_pattern): Update widened add code.
	(vect_recog_average_pattern): Update widened add code.
	* tree-vect-stmts.c (vectorizable_conversion): Add case for widened add,
	subtract.
	(supportable_widening_operation): Add case for widened add, subtract.
	* tree.def
	(WIDEN_PLUS_EXPR): New tree code.
	(WIDEN_MINUS_EXPR): New tree code.
	(VEC_WIDEN_ADD_HI_EXPR): New tree code.
	(VEC_WIDEN_PLUS_LO_EXPR): New tree code.
	(VEC_WIDEN_MINUS_HI_EXPR): New tree code.
	(VEC_WIDEN_MINUS_LO_EXPR): New tree code.

gcc/testsuite/ChangeLog:

	* gcc.target/aarch64/vect-widen-add.c: New test.
	* gcc.target/aarch64/vect-widen-sub.c: New test.
2020-11-19 11:49:59 +00:00
Joel Hutton
ec46904edf [1/3][aarch64] Add vec_widen patterns to aarch64
Add widening add and subtract patterns to the aarch64
backend. These allow taking vectors of N elements of size S
and performing and add/subtract on the high or low half
widening the resulting elements and storing N/2 elements of size 2*S.
These correspond to the addl,addl2,subl,subl2 instructions.

gcc/ChangeLog:

	* config/aarch64/aarch64-simd.md: New patterns
	vec_widen_saddl_lo/hi_<mode>.
2020-11-19 11:47:43 +00:00
Richard Biener
ec383f0bdb tree-optimization/97901 - ICE propagating out LC PHIs
We need to fold the stmt to canonicalize MEM_REFs which means
we're back to using replace_uses_by.  Which means we need dominators
to not require a CFG cleanup upthread.

2020-11-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/97901
	* tree-ssa-propagate.c (clean_up_loop_closed_phi): Compute
	dominators and use replace_uses_by.

	* gcc.dg/torture/pr97901.c: New testcase.
2020-11-19 11:35:45 +01:00
Eric Botcazou
43a0debd52 Enhance debug info for fixed-point types
The Ada language supports fixed-point types as first-class citizens so
they need to be described as-is in the debug info.  We devised the
langhook get_fixed_point_type_info for this purpose a few years ago,
but it comes with a limitation for the representation of the scale
factor that we would need to lift in order to be able to represent
more fixed-point types.

gcc/ChangeLog:
	* dwarf2out.h (struct fixed_point_type_info) <scale_factor>: Turn
	numerator and denominator into a tree.
	* dwarf2out.c (base_type_die): In the case of a fixed-point type
	with arbitrary scale factor, call add_scalar_info on numerator and
	denominator to emit the appropriate attributes.

gcc/ada/ChangeLog:
	* exp_dbug.adb (Is_Handled_Scale_Factor): Delete.
	(Get_Encoded_Name): Do not call it.
	* gcc-interface/decl.c (gnat_to_gnu_entity) <Fixed_Point_Type>:
	Tidy up and always use a meaningful description for arbitrary
	scale factors.
	* gcc-interface/misc.c (gnat_get_fixed_point_type_info): Remove
	obsolete block and adjust the description of the scale factor.
2020-11-19 11:04:52 +01:00
Richard Biener
0d8290959e tree-optimization/97897 - complex lowering on abnormal edges
This fixes complex lowering to not put constants into abnormal
edge PHI values by making sure abnormally used SSA names are
VARYING in its propagation lattice.

2020-11-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/97897
	* tree-complex.c (complex_propagate::visit_stmt): Make sure
	abnormally used SSA names are VARYING.
	(complex_propagate::visit_phi): Likewise.
	* tree-ssa.c (verify_phi_args): Verify PHI arguments on abnormal
	edges are SSA names.

	* gcc.dg/pr97897.c: New testcase.
2020-11-19 09:57:38 +01:00
Uros Bizjak
50134189a4 i386: Disable *<absneg:code><mode>2_i387_1 for TARGET_SSE_MATH modes
This pattern interferes with *<absneg:code><mode>2_1 when TARGET_SSE_MATH
modes are active. Combine pass is able to remove (use) RTXes and transforms
*<absneg:code><mode>2_1 to *<absneg:code><mode>2_i387_1 where SSE
alternatives are not available.

2020-11-19  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
	* config/i386/i386.md (*<absneg:code><mode>2_i387_1):
	Disable for TARGET_SSE_MATH modes.

gcc/testsuite/
	* gcc.target/i386/pr97887.c: New test.
2020-11-19 09:25:04 +01:00
Jeff Law
700337494e Minor H8 shift code generation change in preparation for cc0 removal
So I didn't stay up late to work from pago pago this year and beat the stage1
close, but I do want to flush out the removal of cc0 from the H8 port this
cycle.  Given these patches only affect the H8 and the H8 would be killed this
cycle without the conversion, I think this is suitable even though we're past
stage1 close.

This patch addresses an initial codegen issue that would have resulted in
regressions after removal of cc0.  The compare/test eliminate pass is unable to
handle multiple clobbers.  So patterns that clobber a scratch and also clobber
a condition code are never used to eliminate a compare/test.

The H8 can shift 1 or 2 bits at a time depending on the precise model.  Not
surprisingly we have multiple strategies to implement shifts, some of which
clobber scratch registers -- but we have a clobber on every shift insn and as
a result they can not participate in compare/test removal once cc0 is removed
from the port.

This patch removes the clobber in the initial code generation in cases where
it's obviously not needed allowing those shifts to participate in compare/test
removal in a future patch.  It has the advantage that is also generates
slightly better code.  By installing this now the removal of cc0 is a smaller
patch, but more importantly, it allows for a more direct comparison of the
generated code before/after cc0 removal.

I've had my tester test before/after this patch with no regressions on the
major H8 multilibs.  I've also spot checked the generated code and as expected
it's ever-so-slightly better after this patch.

I'll be installing this on the trunk momentarily.  More patches will follow,
though probably not in rapid succession as my time to push this stuff is very
limited.

gcc/

	* config/h8300/constraints.md (R constraint): Add argument to call
	to h8300_shift_needs_scratch_p.
	(S and T constraints): Similary.
	* config/h8300/h8300-protos.h: Update h8300_shift_needs_scratch_p
	prototype.
	* config/h8300/h8300.c (expand_a_shift): Emit a different pattern
	if the shift does not require a scratch register.
	(h8300_shift_needs_scratch_p): Refine to be more accurate.
	* config/h8300/shiftrotate.md (shiftqi_noscratch): New pattern.
	(shifthi_noscratch, shiftsi_noscratch): Similarly.
2020-11-18 21:01:06 -07:00
GCC Administrator
25bb75f841 Daily bump. 2020-11-19 00:16:30 +00:00
Roger Sayle
1be4878116 Fix middle-end/85811: Introduce tree_expr_maybe_non_p et al.
The motivation for this patch is PR middle-end/85811, a wrong-code
regression entitled "Invalid optimization with fmax, fabs and nan".
The optimization involves assuming max(x,y) is non-negative if (say)
y is non-negative, i.e. max(x,2.0).  Unfortunately, this is an invalid
assumption in the presence of NaNs.  Hence max(x,+qNaN), with IEEE fmax
semantics will always return x even though the qNaN is non-negative.
Worse, max(x,2.0) may return a negative value if x is -sNaN.

I'll quote Joseph Myers (many thanks) who describes things clearly as:
> (a) When both arguments are NaNs, the return value should be a qNaN,
> but sometimes it is an sNaN if at least one argument is an sNaN.
> (b) Under TS 18661-1 semantics, if either argument is an sNaN then the
> result should be a qNaN (whereas if one argument is a qNaN and the
> other is not a NaN, the result should be the non-NaN argument).
> Various implementations treat sNaNs like qNaNs here.

Under this logic, the tree_expr_nonnegative_p for IEEE fmax should be:

    CASE_CFN_FMAX:
    CASE_CFN_FMAX_FN:
      /* Usually RECURSE (arg0) || RECURSE (arg1) but NaNs complicate
         things.  In the presence of sNaNs, we're only guaranteed to be
         non-negative if both operands are non-negative.  In the presence
         of qNaNs, we're non-negative if either operand is non-negative
         and can't be a qNaN, or if both operands are non-negative.  */
      if (tree_expr_maybe_signaling_nan_p (arg0) ||
          tree_expr_maybe_signaling_nan_p (arg1))
        return RECURSE (arg0) && RECURSE (arg1);
      return RECURSE (arg0) ? (!tree_expr_maybe_nan_p (arg0)
                              || RECURSE (arg1))
                            : (RECURSE (arg1)
                              && !tree_expr_maybe_nan_p (arg1));

Which indeed resolves the wrong code in the PR.  The infrastructure that
makes this possible are the two new functions tree_expr_maybe_nan_p and
tree_expr_maybe_signaling_nan_p which test whether a value may potentially
be a NaN or a signaling NaN respectively.  In fact, this patch adds seven
new predicates to the middle-end:

bool tree_expr_finite_p (const_tree);
bool tree_expr_infinite_p (const_tree);
bool tree_expr_maybe_infinite_p (const_tree);
bool tree_expr_signaling_nan_p (const_tree);
bool tree_expr_maybe_signaling_nan_p (const_tree);
bool tree_expr_nan_p (const_tree);
bool tree_expr_maybe_nan_p (const_tree);

These functions correspond to the "must" and "may" operators in modal logic,
and allow us to triage expressions in the middle-end; definitely a NaN,
definitely not a NaN, and unknown at compile-time, etc.  A prime example of
the utility of these functions is that a IEEE floating point value promoted
from an integer type can't be a NaN or infinite.  Hence (double)i+0.0 where
i is an integer can be simplified to (double)i even with -fsignaling-nans.
Currently in GCC optimizations are enabled/disabled based on whether the
expression's type supports NaNs or sNaNs; with these new predicates they
can be controlled by whether the actual operands may or may not be NaNs.

Having added these extremely useful helper functions to the middle-end,
I couldn't help by use then in a few places in fold-const.c, builtins.c
and match.pd.  In the near term, these can/should be used in places
where the tree optimizers test for HONOR_NANS, HONOR_INFINITIES or
HONOR_SNANS, or explicitly test whether a REAL_CST is a NaN or Inf.
In the longer term (I'm not volunteering) these predicates could perhaps
be hooked into the middle-end's SSA chaining and/or VRP machinery,
allowing finiteness to propagated around the CFG, much like we
currently propagate value ranges.

This patch has been tested on x86_64-pc-linux-gnu with a "make bootstrap"
and "make -k check".
Ok for mainline?

2020-08-15  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
	PR middle-end/85811
	* fold-const.c (tree_expr_finite_p): New function to test whether
	a tree expression must be finite, i.e. not a FP NaN or infinity.
	(tree_expr_infinite_p):  New function to test whether a tree
	expression must be infinite, i.e. a FP infinity.
	(tree_expr_maybe_infinite_p): New function to test whether a tree
	expression may be infinite, i.e. a FP infinity.
	(tree_expr_signaling_nan_p): New function to test whether a tree
	expression must evaluate to a signaling NaN (sNaN).
	(tree_expr_maybe_signaling_nan_p): New function to test whether a
	tree expression may be a signaling NaN (sNaN).
	(tree_expr_nan_p): New function to test whether a tree expression
	must evaluate to a (quiet or signaling) NaN.
	(tree_expr_maybe_nan_p): New function to test whether a tree
	expression me be a (quiet or signaling) NaN.

	(tree_binary_nonnegative_warnv_p) [MAX_EXPR]: In the presence
	of NaNs, MAX_EXPR is only guaranteed to be non-negative, if both
	operands are non-negative.
	(tree_call_nonnegative_warnv_p) [CASE_CFN_FMAX,CASE_CFN_FMAX_FN]:
	In the presence of signaling NaNs, fmax is only guaranteed to be
	non-negative if both operands are negative.  In the presence of
	quiet NaNs, fmax is non-negative if either operand is non-negative
	and not a qNaN, or both operands are non-negative.

	* fold-const.h (tree_expr_finite_p, tree_expr_infinite_p,
	tree_expr_maybe_infinite_p, tree_expr_signaling_nan_p,
	tree_expr_maybe_signaling_nan_p, tree_expr_nan_p,
	tree_expr_maybe_nan_p): Prototype new functions here.

	* builtins.c (fold_builtin_classify) [BUILT_IN_ISINF]: Fold to
	a constant if argument is known to be (or not to be) an Infinity.
	[BUILT_IN_ISFINITE]: Fold to a constant if argument is known to
	be (or not to be) finite.
	[BUILT_IN_ISNAN]: Fold to a constant if argument is known to be
	(or not to be) a NaN.
	(fold_builtin_fpclassify): Check tree_expr_maybe_infinite_p and
	tree_expr_maybe_nan_p instead of HONOR_INFINITIES and HONOR_NANS
	respectively.
	(fold_builtin_unordered_cmp): Fold UNORDERED_EXPR to a constant
	when its arguments are known to be (or not be) NaNs.  Check
	tree_expr_maybe_nan_p instead of HONOR_NANS when choosing between
	unordered and regular forms of comparison operators.

	* match.pd (ordered(x,y)->true/false): Constant fold ORDERED_EXPR
	if its operands are known to be (or not to be) NaNs.
	(unordered(x,y)->true/false): Constant fold UNORDERED_EXPR if its
	operands are known to be (or not to be) NaNs.
	(sqrt(x)*sqrt(x)->x): Check tree_expr_maybe_signaling_nan_p instead
	of HONOR_SNANS.

gcc/testsuite/ChangeLog
	PR middle-end/85811
	* gcc.dg/pr85811.c: New test.
	* gcc.dg/fold-isfinite-1.c: New test.
	* gcc.dg/fold-isfinite-2.c: New test.
	* gcc.dg/fold-isinf-1.c: New test.
	* gcc.dg/fold-isinf-2.c: New test.
	* gcc.dg/fold-isnan-1.c: New test.
	* gcc.dg/fold-isnan-2.c: New test.
2020-11-18 15:09:46 -07:00
Jerry Clcanny
579d235ddc lto: Fix typo in comment of gcc/lto/lto-symtab.c
* lto-symtab.c (lto_symtab_merge_symbols): Fix typos in comment.
2020-11-18 14:39:17 -07:00
Jakub Jelinek
71c9d2b088 vrp: Fix operator_trunc_mod::op1_range [PR97888]
As mentioned in the PR, in (x % y) >= 0 && y >= 0, we can't deduce
x's range to be x >= 0, as e.g. -7 % 7 is 0.  But we can deduce it
from (x % y) > 0.  The patch also fixes up the comments.

2020-11-18  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/91029
	PR tree-optimization/97888
	* range-op.cc (operator_trunc_mod::op1_range): Only set op1
	range to >= 0 if lhs is > 0, rather than >= 0.  Fix up comments.

	* gcc.dg/pr91029.c: Add comment with PR number.
	(f2): Use > 0 rather than >= 0.
	* gcc.c-torture/execute/pr97888-1.c: New test.
	* gcc.c-torture/execute/pr97888-2.c: New test.
2020-11-18 22:13:06 +01:00
Jakub Jelinek
84e0549ce2 plugins: Allow plugins to handle global_options changes
Any time somebody adds or removes an option in some *.opt file (which e.g.
on the 10 branch after branching off 11 happened 7 times already), many
offsets in global_options variable change and so plugins that ever access
GCC options or other global_options values are ABI dependent on it.  It is
true we don't guarantee ABI stability for plugins, but we change the most
often used data structures on the release branches only very rarely and so
the options changes are the most problematic for ABI stability of plugins.

Annobin uses a way to remap accesses to some of the global_options.x_* by
looking them up in the cl_options array where we have
offsetof (struct gcc_options, x_flag_lto)
etc. remembered, but sadly doesn't do it for all options (e.g. some flag_*
etc. option accesses may be hidden in various macros like POINTER_SIZE),
and more importantly some struct gcc_options offsets are not covered at all.
E.g. there is no offsetof (struct gcc_options, x_optimize),
offsetof (struct gcc_options, x_flag_sanitize) etc.  Those are usually:
Variable
int optimize
in the *.opt files.

The following patch allows the plugins to deal with reshuffling of even
the global_options fields that aren't tracked in cl_options by adding
another array that describes those, which adds an 816 bytes long array
and 1039 bytes in string literals, so 1855 .rodata bytes in total ATM.
And adds it only if --enable-plugin (the default), with --disable-plugin
it will not be compiled in.

2020-11-18  Jakub Jelinek  <jakub@redhat.com>

	* opts.h (struct cl_var): New type.
	(cl_vars): Declare.
	* optc-gen.awk: Generate cl_vars array.
2020-11-18 22:10:26 +01:00
David Malcolm
f3f312b535 analyzer: only use CWE-690 for unchecked return value [PR97893]
CWE-690 is only for dereferencing an unchecked return value; for
other kinds of NULL dereference, use the parent classification, CWE-476.

gcc/analyzer/ChangeLog:
	PR analyzer/97893
	* sm-malloc.cc (null_deref::emit): Use CWE-476 rather than
	CWE-690, as this isn't due to an unchecked return value.
	(null_arg::emit): Likewise.

gcc/testsuite/ChangeLog:
	PR analyzer/97893
	* gcc.dg/analyzer/malloc-1.c: Add CWE-690 and CWE-476 codes to
	expected output.
2020-11-18 15:53:36 -05:00
Iain Sandoe
0802809321 Objective-C++ : Avoid ICE on invalid with empty attributes.
Empty prefix attributes like:

__attribute__ (())
@interface MyClass
@end

cause an ICE at present, check for that case and skip them.

gcc/cp/ChangeLog:

	* parser.c (cp_parser_objc_valid_prefix_attributes): Check
	for empty attributes.
2020-11-18 20:42:35 +00:00
Eugene Rozenfeld
f44e609162 Optimize two patterns with three xors
gcc/
	PR tree-optimization/96671
	* match.pd (three xor patterns): New patterns.
2020-11-18 14:31:09 -05:00
Kwok Cheung Yeung
6fae7eda96 openmp: Retire nest-var ICV for OpenMP 5.1
This removes the nest-var ICV, expressing nesting in terms of the
max-active-levels-var ICV instead.  The max-active-levels-var ICV
is now per data environment rather than per device.

2020-11-18  Kwok Cheung Yeung  <kcy@codesourcery.com>

	libgomp/
	* env.c (gomp_global_icv): Remove nest_var field.  Add
	max_active_levels_var field.
	(gomp_max_active_levels_var): Remove.
	(parse_boolean): Return true on success.
	(handle_omp_display_env): Express OMP_NESTED in terms of
	max_active_levels_var.  Change format specifier for
	max_active_levels_var.
	(initialize_env): Set max_active_levels_var from
	OMP_MAX_ACTIVE_LEVELS, OMP_NESTED, OMP_NUM_THREADS and
	OMP_PROC_BIND.
	* icv.c (omp_set_nested): Express in terms of
	max_active_levels_var.
	(omp_get_nested): Likewise.
	(omp_set_max_active_levels): Use max_active_levels_var field instead
	of gomp_max_active_levels_var.
	(omp_get_max_active_levels): Likewise.
	* libgomp.h (struct gomp_task_icv): Remove nest_var field.  Add
	max_active_levels_var field.
	(gomp_supported_active_levels): Set to UCHAR_MAX.
	(gomp_max_active_levels_var): Delete.
	* libgomp.texi (omp_get_nested): Update documentation.
	(omp_set_nested): Likewise.
	(OMP_MAX_ACTIVE_LEVELS): Likewise.
	(OMP_NESTED): Likewise.
	(OMP_NUM_THREADS): Likewise.
	(OMP_PROC_BIND): Likewise.
	* parallel.c (gomp_resolve_num_threads): Replace reference
	to nest_var with max_active_levels_var.  Use max_active_levels_var
	field instead of gomp_max_active_levels_var.
2020-11-18 11:24:36 -08:00
Joseph Myers
965e0cc371 Update gcc zh_TW.po.
* zh_TW.po: Update.
2020-11-18 19:15:01 +00:00
Jakub Jelinek
95db7e9afe options, lto: Optimize streaming of optimization nodes
Honza mentioned that especially for the new param machinery, most of
streamed values are probably going to be the default values.  Perhaps
somehow we could stream them more effectively.

This patch implements it and brings further savings, the size
goes down from 574 bytes to 273 bytes, i.e. less than half.
Not trying to handle enums because the code doesn't know if (enum ...) 10
is even valid, similarly non-parameters because those really generally
don't have large initializers, and params without Init (those are 0
initialized and thus don't need to be handled).

2020-11-18  Jakub Jelinek  <jakub@redhat.com>

	* optc-save-gen.awk: Initialize var_opt_init.  In
	cl_optimization_stream_out for params with default values larger than
	10, xor the default value with the actual parameter value.  In
	cl_optimization_stream_in repeat the above xor.
2020-11-18 20:14:00 +01:00
Jakub Jelinek
d326ebc94f configury: --enable-link-serialization support
When performing LTO bootstraps, especially when using tmpfs for /tmp,
one can run a machine to halt when using higher levels of parallelism
and a large number of FEs, because there are too many concurrent LTO
link commands running at the same time and each one of them puts most of the
middle-end/backend objects into /tmp.

We have --enable-link-mutex configure option, but --enable-link-mutex has
a big problem that it decreases number of available jobs by the number of
link commands waiting for the lock, so e.g. when doing make -j32 build with
11 different big programs linked with $(LLINKER) we end up with just 22
effective jobs, and with e.g. make -j8 with those 11 different big programs
we actually most likely serialize everything during linking onto a single job.

The following patch implements a new configure option,
--enable-link-serialization, which implements different serialization and
as it doesn't use the mutex, just modifying the old option to be implemented
differently would be strange.  We can deprecate and later remove the old
option.  The new option doesn't use any shell mutexes, but uses make
dependencies.

The option is implemented inside of gcc/ configure and Makefiles,
which means that even inside of gcc/ make all (as well as e.g. make lto-dump)
will serialize and build all previous large binaries when configured this
way.
One can always make -j32 cc1 DO_LINK_SERIALIZATION=
to avoid that.
Furthermore, I've implemented the idea I wrote about, so that
--enable-link-serialization
is the same as
--enable-link-serialization=1
and means the large link commands are serialized, one can (the default)
--disable-link-serialization
which will cause all links to be parallelizable, but one can also
--enable-link-serialization=3
etc. which says that at most 3 of the large link commands can run
concurrently.
And finally I've implemented (only if the serialization is enabled) simple
progress bars for the linking.
With --enable-link-serialization and e.g. the 5 large links I have in my
current tree (cc1, cc1plus, f951, lto1 and lto-dump), before the linking it
prints
Linking |==--      | 20%
and after it
Linking |====      | 40%
(each == characters stand for already finished links, each --
characters stand for the link being started).
With --enable-link-serialization=3 it will change the way the start is
printed, one will get:
Linking |--        | 0%
at the start of cc1 link,
Linking |>>--      | 0%
at the start of the second large link and
Linking |>>>>--    | 0%
at the start of the third large link, where the >> characters stand for
already pending links.  The printing at the end of link command is
the same as with the full serialization, i.e. for the above 3:
Linking |==        | 20%
Linking |====      | 40%
Linking |======    | 60%
but one could actually get them in any order depending on which of those 3
finishes first - to get it 100% accurate I'd need to add some directory with
files representing finished links or similar, doesn't seem worth it.

2020-11-18  Jakub Jelinek  <jakub@redhat.com>

gcc/
	* configure.ac: Add $lang.prev rules, INDEX.$lang and SERIAL_LIST and
	SERIAL_COUNT variables to Make-hooks.
	(--enable-link-serialization): New configure option.
	* Makefile.in (DO_LINK_SERIALIZATION, LINK_PROGRESS): New variables.
	* doc/install.texi (--enable-link-serialization): Document.
	* configure: Regenerated.
gcc/c/
	* Make-lang.in (c.serial): New goal.
	(.PHONY): Add c.serial c.prev.
	(cc1$(exeext)): Call LINK_PROGRESS.
gcc/cp/
	* Make-lang.in (c++.serial): New goal.
	(.PHONY): Add c++.serial c++.prev.
	(cc1plus$(exeext)): Depend on c++.prev.  Call LINK_PROGRESS.
gcc/fortran/
	* Make-lang.in (fortran.serial): New goal.
	(.PHONY): Add fortran.serial fortran.prev.
	(f951$(exeext)): Depend on fortran.prev.  Call LINK_PROGRESS.
gcc/lto/
	* Make-lang.in (lto, lto1.serial, lto2.serial): New goals.
	(.PHONY): Add lto lto1.serial lto1.prev lto2.serial lto2.prev.
	(lto.all.cross, lto.start.encap): Remove dependencies.
	($(LTO_EXE)): Depend on lto1.prev.  Call LINK_PROGRESS.
	($(LTO_DUMP_EXE)): Depend on lto2.prev.  Call LINK_PROGRESS.
gcc/objc/
	* Make-lang.in (objc.serial): New goal.
	(.PHONY): Add objc.serial objc.prev.
	(cc1obj$(exeext)): Depend on objc.prev.  Call LINK_PROGRESS.
gcc/objcp/
	* Make-lang.in (obj-c++.serial): New goal.
	(.PHONY): Add obj-c++.serial obj-c++.prev.
	(cc1objplus$(exeext)): Depend on obj-c++.prev.  Call LINK_PROGRESS.
gcc/ada/
	* gcc-interface/Make-lang.in (ada.serial): New goal.
	(.PHONY): Add ada.serial ada.prev.
	(gnat1$(exeext)): Depend on ada.prev.  Call LINK_PROGRESS.
gcc/brig/
	* Make-lang.in (brig.serial): New goal.
	(.PHONY): Add brig.serial brig.prev.
	(brig1$(exeext)): Depend on brig.prev.  Call LINK_PROGRESS.
gcc/go/
	* Make-lang.in (go.serial): New goal.
	(.PHONY): Add go.serial go.prev.
	(go1$(exeext)): Depend on go.prev.  Call LINK_PROGRESS.
gcc/jit/
	* Make-lang.in (jit.serial): New goal.
	(.PHONY): Add jit.serial jit.prev.
	($(LIBGCCJIT_FILENAME)): Depend on jit.prev.  Call LINK_PROGRESS.
gcc/d/
	* Make-lang.in (d.serial): New goal.
	(.PHONY): Add d.serial d.prev.
	(d21$(exeext)): Depend on d.prev.  Call LINK_PROGRESS.
2020-11-18 20:11:37 +01:00
Richard Sandiford
71e234a5c9 testsuite: Adjust bb-slp-pr68892.c for AArch64
AArch64 passes the "not profitable" test because it treats vec_construct
as having a high-enough cost.  This means that we can try other vector
modes, which in turn causes "BB vectorization with gaps at the end of
a load is not supported" to be printed more than once.  The number of
times that we print the message doesn't seem important, so the patch
converts it to a plain scan-tree-dump.

gcc/testsuite/
	* gcc.dg/vect/bb-slp-pr68892.c: Don't XFAIL the profitability
	test for aarch64*-*-*.  Allow the "BB vectorization with gaps"
	message to be printed more than once.
2020-11-18 18:40:33 +00:00
Richard Sandiford
ee9dd1c302 testsuite: Adjust gcc.dg/vect/slp-21.c for Arm targets
On arm* and aarch64* targets, we can vectorise the second of the main
loops using SLP, not just the third.  As the comments say, whether this
is supported depends on a very specific permutation, so it seemed better
to use direct target selectors.

gcc/testsuite/
	* gcc.dg/vect/slp-21.c: Expect 4 SLP instances to be vectorized
	on arm* and aarch64* targets.
2020-11-18 18:40:32 +00:00
Richard Sandiford
6a9cd27ac6 testsuite: Add vect_perm3_int guards
SLP vectorisation of gcc.dg/vect/fast-math-vect-call-1.c involves
a group of 3 floats, which requires the same permutation as
vect_perm3_int.

The load/store_lanes XFAILs in gcc.dg/vect/slp-perm-6.c implicitly
assumed vect_perm3_int, which is true for Advanced SIMD but not for
VLA SVE.  Whether it's true for fixed-length SVE depends on the
vector length.

The xfail selector applies on top of the target selector, so it's
not necessary to make the xfail selector a strict subset of the
target selector.

gcc/testsuite/
	* gcc.dg/vect/fast-math-vect-call-1.c: Only expect SLP to be used
	on vect_perm3_int targets.
	* gcc.dg/vect/slp-perm-6.c: Likewise.  Only XFAIL the LOAD/STORE_LANES
	tests on vect_perm3_int targets.
2020-11-18 18:40:32 +00:00
Richard Sandiford
6d0ffd9a3e testsuite: Add a vect_partial_vectors_usage_2 guard
We don't need an epilogue loop if the main loop can operate on
partial vectors, so this patch disables an associated test.
The alternative would be to force partial-vectors-usage=1
on the command line.

gcc/testsuite/
	* gcc.dg/vect/vect-epilogues.c: XFAIL test for epilogue loop
	vectorization if vect_partial_vectors_usage_2.
2020-11-18 18:40:31 +00:00
Richard Sandiford
0f545ad9b6 testsuite: Fix vect/vect-sdiv-pow2-1.c
We're now able to vectorise the set-up loop:

      int p = power2 (fns[i].po2);
      for (int j = 0; j < N; j++)
        a[j] = ((p << 4) * j) / (N - 1) - (p << 5);

This patch adds an asm to stop the loop being vectorised.

gcc/testsuite/
	* gcc.dg/vect/vect-sdiv-pow2-1.c (main): Add an asm to the
	set-up loop.
2020-11-18 18:40:30 +00:00
Nathan Sidwell
92648faa1c aix: Fixinclude
This fixes an ODR violation in the AIX headers that is detected by C++
modules.  While unnamed structs with typedef names for linkage
purposes are accepted, this case is an anonymous struct without such a
typedef name -- the typedef is attached to the pointer-to-struct type.
Fixed by naming the struct.

	fixincludes/
	* inclhack.def (aix_physaddr_t): New.
	* fixincl.x: Regenerated.
2020-11-18 10:33:30 -08:00
Nathan Sidwell
c9c3d5f28a preprocessor: C++ module-directives
C++20 modules introduces a new kind of preprocessor directive -- a
module directive.  These are directives but without the leading '#'.
We have to detect them by sniffing the start of a logical line.  When
detected we replace the initial identifiers with unspellable tokens
and pass them through to the language parser the same way deferred
pragmas are.  There's a PRAGMA_EOL at the logical end of line too.

One additional complication is that we have to do header-name lexing
after the initial tokens, and that requires changes in the macro-aware
piece of the preprocessor.  The above sniffer sets a counter in the
lexer state, and that triggers at the appropriate point.  We then do
the same header-name lexing that occurs on a #include directive or
has_include pseudo-macro.  Except that the header name ends up in the
token stream.

A couple of token emitters need to deal with the new token possibility.

	gcc/c-family/
	* c-lex.c (c_lex_with_flags): CPP_HEADER_NAMEs can now be seen.
	libcpp/
	* include/cpplib.h (struct cpp_options): Add module_directives
	option.
	(NODE_MODULE): New node flag.
	(struct cpp_hashnode): Make rid-code a bitfield, increase bits in
	flags and swap with type field.
	* init.c (post_options): Create module-directive identifier nodes.
	* internal.h (struct lexer_state): Add directive_file_token &
	n_modules fields.  Add module node enumerator.
	* lex.c (cpp_maybe_module_directive): New.
	(_cpp_lex_token): Call it.
	(cpp_output_token): Add '"' around CPP_HEADER_NAME token.
	(do_peek_ident, do_peek_module): New.
	(cpp_directives_only): Detect module-directive lines.
	* macro.c (cpp_get_token_1): Deal with directive_file_token
	triggering.
2020-11-18 10:24:12 -08:00
Nathan Sidwell
7ceb899e93 preprocessor: Add support for header unit translation
libcpp/
	* files.c (struct _cpp_file): Add header_unit field.
	(_cpp_stack_file): Add header unit support.
	(cpp_find_header_unit): New.
	* include/cpplib.h (cpp_find_header_unit): Declare.
2020-11-18 08:45:46 -08:00
Nathan Sidwell
db87f19ae3 preprocessor: Update mkdeps for modules
This is slightly different to the original patch I posted.  This adds
separate module target and dependency functions (rather than a single
bi-modal function).

	libcpp/
	* include/cpplib.h (struct cpp_options): Add modules to
	dep-options.
	* include/mkdeps.h (deps_add_module_target): Declare.
	(deps_add_module_dep): Declare.
	* mkdeps.c (class mkdeps): Add modules, module_name, cmi_name,
	is_header_unit fields.  Adjust cdtors.
	(deps_add_module_target, deps_add_module_dep): New.
	(make_write): Write module dependencies, if enabled.
2020-11-18 08:44:49 -08:00
Patrick Palka
d4a788c717 libstdc++: Fix ranges::join_view::_Iterator::operator-> [LWG 3500]
This applies the proposed resolution of LWG 3500, which corrects the
return type and constraints of this member function to use the right
iterator type.  Additionally, a nearby local variable is uglified.

libstdc++-v3/ChangeLog:

	* include/std/ranges (join_view::_Iterator::_M_satisfy): Uglify
	local variable inner.
	(join_view::_Iterator::operator->): Use _Inner_iter instead of
	_Outer_iter in the function signature as per LWG 3500.
	* testsuite/std/ranges/adaptors/join.cc (test08): Test it.
2020-11-18 10:23:57 -05:00
Vladimir N. Makarov
2f2709e691 [PR97870] LRA: don't remove asm goto, just nullify it.
gcc/

2020-11-18  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/97870
	* lra-constraints.c (curr_insn_transform): Do not delete asm goto
	with wrong constraints.  Nullify it saving CFG.
2020-11-18 10:11:33 -05:00
Tobias Burnus
cb1a4876a0 testsuite/libgomp.c/usleep.h: Use sleep-loop also for GCN
As typically configured, newlib's libc.a does not build 'posix' and,
hence, usleep is not available. Thus, use the same fallback as for nvptx.

libgomp/
	* testsuite/libgomp.c/usleep.h (fallback_usleep): Renamed from
	nvptx_usleep; use also for device={arch(gcn)}.
2020-11-18 14:11:27 +01:00
Matthias Klose
ba97b53260 Fix PR ada/97859, building ada cross compiler targeting powerpc64le-linux-gnu
2020-11-18  Matthias Klose  <doko@ubuntu.com>

	PR ada/97859
	* Makefile.rtl (powerpc% linux%): Also match powerpc64le cpu.
2020-11-18 13:24:33 +01:00
Jozef Lawrynowicz
bf7b94d407 MSP430: Add 64-bit hardware multiply support
Hardware multipliers that support widening 32-bit multiplication can
be used to perform a 64-bit * 64-bit multiplication more efficiently
than a software implementation.

The following equation is used to perform 64-bit multiplication for
devices with "32bit" or "f5series" hardware multiply versions:

  64bit_result = (low32_op0 * lop32_op1)
    + ((low32_op0 * high32_op1) << 32)
       + ((high32_op0 * low32_op1) << 32)

libgcc/ChangeLog:

	* config/msp430/lib2hw_mul.S (mult64_hw): New.
	(if MUL_32): Use mult64_hw for __muldi3.
	(if MUL_F5): Use mult64_hw for __muldi3.
	* config/msp430/lib2mul.c (__muldi3): New.
	* config/msp430/t-msp430 (LIB2FUNCS_EXCLUDE): Define.
2020-11-18 11:05:27 +00:00
Jozef Lawrynowicz
e045b85836 MSP430: Add mul{hi,si} and {u,}mulsidi3 expanders
GCC generates better code when multiplication operations, which require
library functions to perform, are caught in early in RTL, rather than
leaving the operation to be mapped to a library function later on.

When there is hardware multiply support, it is more efficient to perform
widening multiplication using the hardware multiplier instead of letting
GCC widen the arguments before calling the multiplication routine in the
wider mode.

gcc/ChangeLog:

	* config/msp430/msp430.md (mulhi3): New.
	(mulsi3): New.
	(mulsidi3): Rename to *mulsidi3_inline.
	(umulsidi3): Rename to *umulsidi3_inline.
	(mulsidi3): New define_expand.
	(umulsidi3): New define_expand.
2020-11-18 11:03:39 +00:00
Richard Biener
30270bf042 tree-optimization/97886 - deal with strange LC PHI nodes
This makes vectorization properly assign vector types to PHI
nodes that copy from externals on loop exit edges.

2020-11-18  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/97886
	* tree-vect-loop.c (vectorizable_lc_phi): Properly assign
	vector types to invariants for SLP.
2020-11-18 11:25:00 +01:00
Iain Buclaw
798bdfa0eb d: Fix LHS of array concatentation evaluated before the RHS.
In an array append expression:

    array ~= fun(array);

The array in the left hand side of the expression was extended before
evaluating the result of the right hand side, which resulted in the
newly uninitialized array index being used before set.

This fixes that so that the result of the right hand side is always
saved in a reusable temporary before assigning to the destination.

gcc/d/ChangeLog:

	PR d/97843
	* d-codegen.cc (build_assign): Evaluate TARGET_EXPR before use in
	the right hand side of an assignment.
	* expr.cc (ExprVisitor::visit (CatAssignExp *)): Force a TARGET_EXPR
	on the element to append if it is a CALL_EXPR.

gcc/testsuite/ChangeLog:

	PR d/97843
	* gdc.dg/torture/pr97843.d: New test.
2020-11-18 10:22:18 +01:00
Iain Buclaw
27d8c3516b d: Fix a couple of ICEs found in the dmd front-end (PR97842)
- Segmentation fault on incomplete static if.
- Segmentation fault resolving typeof() expression when gagging is on.

Reviewed-on: https://github.com/dlang/dmd/pull/11971

gcc/d/ChangeLog:

	PR d/97842
	* dmd/MERGE: Merge upstream dmd b6a779e49
2020-11-18 10:22:06 +01:00