Commit Graph

179450 Commits

Author SHA1 Message Date
Harald Anlauf
f7d2d4be76 PR fortran/97036 - [F2018] Allow ELEMENTAL RECURSIVE procedure prefix
gcc/fortran/ChangeLog:

	* symbol.c (gfc_check_conflict): Allow ELEMENTAL RECURSIVE
	procedure prefix for -std=f2018.

gcc/testsuite/ChangeLog:

	* gfortran.dg/pr97036.f90: New test.
2020-09-19 20:46:38 +02:00
H.J. Lu
c66c004ad6 x86: Add a testcase for PR target/96861
Add a testcase to verify that -march=skylake-avx512 -mtune=skylake-avx512
generates desired code sequence.

	PR target/96861
	* gcc.target/i386/pr96861.c: New test.
2020-09-19 10:03:10 -07:00
Patrick Palka
e5d72c840a c++: Fix self-mapping in map_arguments [PR96531, PR97103]
With r10-8077 we stopped passing the argified current_template_parms to
normalize_constraint_expression from finish_nested_requirement, and
instead made map_arguments perform a self-mapping of parameters when
args is NULL.  But we're currently not handling parameter packs and
BOUND_TEMPLATE_TEMPLATE_PARMs properly during this self-mapping, which
leads to ICEs later during satisfaction.

To properly handle self-mapping of a parameter pack, this patch
extends template_parm_to_arg to handle TEMPLATE_PARM_P nodes, and
makes map_arguments use it.  (This change revealed that the call to
template_parm_to_arg in convert_generic_types_to_packs was a no-op
because the argument 't' is never a TREE_LIST, so this patch
additionally removes this call.)

As for bound ttps, map_arguments before r10-8077 would map a
BOUND_TEMPLATE_TEMPLATE_PARM not to itself but to its underlying
TEMPLATE_TEMPLATE_PARM.  We could restore this behavior in
map_arguments, but since a bound ttp is not really a template parameter
it seems better to make keep_template_parm not give us a bound ttp in
the first place.  So this patch makes keep_template_parm return the
underlying ttp when it sees a bound ttp.

gcc/cp/ChangeLog:

	PR c++/96531
	PR c++/97103
	* constraint.cc (map_arguments): Call template_parm_to_arg
	in the self-mapping case.
	(finish_shorthand_constraint): No need to build a TREE_LIST
	before calling template_parm_to_arg.
	* pt.c (template_parm_to_arg): Rewrite to handle TEMPLATE_PARM_P
	nodes as well as DECL_TEMPLATE_PARM_P nodes, and to make the
	overlying TREE_LIST node optional.
	(keep_template_parm): Don't record a BOUND_TEMPLATE_TEMPLATE_PARM,
	instead record its corresponding TEMPLATE_TEMPLATE_PARM.
	(convert_generic_types_to_packs): Don't call
	template_parm_to_arg.

gcc/testsuite/ChangeLog:

	PR c++/96531
	PR c++/97103
	* g++.dg/cpp2a/concepts-ttp2.C: New test.
	* g++.dg/cpp2a/concepts-variadic1.C: New test.
2020-09-19 11:17:46 -04:00
Patrick Palka
dea470d091 c++: std::is_constant_evaluated inside constraint [PR97051]
According to [expr.const]/14, the result of substitution into an atomic
constraint is manifestly constant-evaluated; this patch adjusts the call
to maybe_constant_value in satisfy_atom to that effect.

gcc/cp/ChangeLog:

	PR c++/97051
	* constraint.cc (satisfy_atom): Pass true as the
	manifestly_const_eval argument to maybe_constant_value.

gcc/testsuite/ChangeLog:

	PR c++/97051
	* g++.dg/cpp2a/is-constant-evaluated11.C: New test.
2020-09-19 11:17:41 -04:00
liuhongt
83858ba1db Increase rtx cost of sse_to_integer in skylake_cost.
As https://gcc.gnu.org/pipermail/gcc-patches/2019-August/528839.html
indicates, movement between SSE and gpr should be much expensive than
movement inside gpr(which is 2 as default).

gcc/ChangeLog

	PR target/96861
	* config/i386/x86-tune-costs.h (skylake_cost): increase rtx
	cost of sse_to_integer from 2 to 6.

gcc/testsuite

	* gcc.target/i386/pr95021-3.c: Add -mtune=generic.
2020-09-19 22:54:02 +08:00
GCC Administrator
239601c53b Daily bump. 2020-09-19 00:16:29 +00:00
Jakub Jelinek
4a5ff2b56b c++: Add testcase for already fixed PR97105
This has been fixed by the PR bootstrap/97118 fix.

2020-09-19  Jakub Jelinek  <jakub@redhat.com>

	PR c++/97105
	* g++.dg/template/pr97105.C: New test.
2020-09-19 00:09:11 +02:00
David Malcolm
1df487a520 analyzer: fix warning_event::get_desc for global state changes
When experimenting the a new state_machine with global state I noticed
that the fallback handling in warning_event::get_desc assumes we have
per-value states, and ICEs on global states.  Fixed thusly.

gcc/analyzer/ChangeLog:
	* checker-path.cc (warning_event::get_desc): Handle global state
	changes.
2020-09-18 17:39:46 -04:00
David Malcolm
c89956cba9 analyzer: handle strdup and strndup
gcc/analyzer/ChangeLog:
	* sm-malloc.cc (malloc_state_machine::on_stmt): Handle strdup and
	strndup as being malloc-like allocators.

gcc/testsuite/ChangeLog:
	* gcc.dg/analyzer/strdup-1.c: New test.
	* gcc.dg/analyzer/strndup-1.c: New test.
2020-09-18 17:38:34 -04:00
Jason Merrill
e1a1808cd1 c++: Fix bootstrap failure. [PR97118]
gcc/cp/ChangeLog:

	PR bootstrap/97118
	* decl.c (complete_vars): Only call layout_var_decl if completing
	the type succeeded.
2020-09-18 15:35:26 -04:00
Sudi Das
04dc198ce5 [PATCH 4/5][Arm] New pattern for CSNEG instructions
This patch adds a new pattern, *thumb2_csneg, for generating CSNEG
instructions. It also restricts *if_neg_move and *thumb2_negscc to only match
if !TARGET_COND_ARITH which prevents undesirable matches during ifcvt.

gcc/ChangeLog:

	* config/arm/thumb2.md (*thumb2_csneg): New.
	(*thumb2_negscc): Don't match if TARGET_COND_ARITH.
	* config/arm/arm.md (*if_neg_move): Don't match if TARGET_COND_ARITH.

gcc/testsuite/ChangeLog:

	* gcc.target/arm/csneg.c: New test.

Co-authored-by: Omar Tahir <omar.tahir@arm.com>
2020-09-18 17:05:05 +01:00
Sudi Das
778f19ff95 [PATCH 3/5][Arm] New pattern for CSINC instructions
This patch adds a new pattern, *thumb2_csinc, for generating CSINC
instructions. It also modifies an existing pattern, *thumb2_cond_arith, to
output CINC when the operation is an addition and TARGET_COND_ARITH is true.

gcc/ChangeLog:

	* config/arm/thumb2.md (*thumb2_csinc): New.
	(*thumb2_cond_arith): Generate CINC where possible.

gcc/testsuite/ChangeLog:

	* gcc.target/arm/csinc-1.c: New test.

Co-authored-by: Omar Tahir <omar.tahir@arm.com>
2020-09-18 17:04:37 +01:00
Sudi Das
c2bb84be4a [PATCH 2/5][Arm] New pattern for CSINV instructions
This patch adds a new pattern, *thumb2_csinv, for generating CSINV nstructions.

This pattern relies on a few general changes that will be used throughout
the following patches:
	- A new macro, TARGET_COND_ARITH, which is only true on 8.1-M Mainline
	  and represents the existence of these conditional instructions.
	- A change to the cond exec hook, arm_have_conditional_execution, which
	  now returns false if TARGET_COND_ARITH before reload. This allows for
	  some ifcvt transformations when they would usually be disabled. I've
	  written a rather verbose comment (with the risk of over-explaining)
	  as it's a bit of a confusing change.
	- One new predicate.
	- *thumb2_movcond has been restricted to only match if !TARGET_COND_ARITH,
	  otherwise it triggers undesirable combines.

gcc/ChangeLog:

	* config/arm/arm.h (TARGET_COND_ARITH): New macro.
	* config/arm/arm.c (arm_have_conditional_execution): Return false if
	TARGET_COND_ARITH before reload.
	* config/arm/predicates.md (arm_comparison_operation): Returns true if
	comparing CC_REGNUM with constant zero.
	* config/arm/thumb2.md (*thumb2_csinv): New.
	(*thumb2_movcond): Don't match if TARGET_COND_ARITH.

gcc/testsuite/ChangeLog:

	* gcc.target/arm/csinv-1.c: New test.

Co-authored-by: Omar Tahir <omar.tahir@arm.com>
2020-09-18 17:03:39 +01:00
Richard Sandiford
3c7c5f1d4a ira: Fix elimination for global hard FPs [PR91957]
If the hard frame pointer is being used as a global register,
we should skip the usual handling for eliminations.  As the
comment says, the register cannot in that case be eliminated
(or eliminated to) and is already marked live where appropriate.

Doing this removes the duplicate error for gcc.target/i386/pr82673.c.
The “cannot be used in 'asm' here” message is meant to be for asm
statements rather than register asms, and the function that the
error is reported against doesn't use asm.

gcc/
2020-09-18  Richard Sandiford  <richard.sandiford@arm.com>

	PR middle-end/91957
	* ira.c (ira_setup_eliminable_regset): Skip the special elimination
	handling of the hard frame pointer if the hard frame pointer is fixed.

gcc/testsuite/
2020-09-18  H.J. Lu  <hjl.tools@gmail.com>
	    Richard Sandiford  <richard.sandiford@arm.com>

	PR middle-end/91957
	* g++.target/i386/pr97054.C: New test.
	* gcc.target/i386/pr82673.c: Remove redundant extra message.
2020-09-18 16:55:45 +01:00
Omar Tahir
f89e9bfac3 MAINTAINERS: Add myself for write after approval.
ChangeLog:

2020-09-18  Omar Tahir  <omar.tahir@arm.com>

	* MAINTAINERS (Write After Approval): Add myself.
2020-09-18 15:31:46 +01:00
Jakub Jelinek
3d3fe967b0 testsuite: add another test for the rotate vectorization miscompilation
This time with short and char where the used mask used to be larger
than it should have been.

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

	PR tree-optimization/97081
	* gcc.dg/vect/pr97081-2.c: New test.
2020-09-18 15:05:53 +02:00
Richard Biener
9c9b88fdcf tree-optimization/97081 - fix wrong-code with vectorized shift
This corrects the mask for creation of x << s | x >> (-x & mask)
from a rotate x <<r s to use the precision of x.

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

	PR tree-optimization/97081
	* tree-vect-patterns.c (vect_recog_rotate_pattern): Use the
	precision of the shifted operand to determine the mask.

	* gcc.dg/vect/pr97081.c: New testcase.
2020-09-18 14:48:42 +02:00
Jozef Lawrynowicz
2f8022873c MSP430: Add 'd', 'e', 'f' and 'g' asm operand modifiers
The new operand modifiers can be used to select odd-numbered bytes of a memory
reference or constant value.

gcc/ChangeLog:

	* config/msp430/msp430.c (msp430_print_operand): Update comment.
	Cast to long when printing values formatted as long.
	Support 'd', 'e', 'f' and 'g' modifiers.
	Extract operand value with a single operation for all modifiers.
	* doc/extend.texi (msp430Operandmodifiers): New.

gcc/testsuite/ChangeLog:

	* gcc.target/msp430/operand-modifiers.c: Extend test to handle new
	modifiers.
	* gcc.target/msp430/operand-modifiers-bad.c: New test.
2020-09-18 13:07:19 +01:00
Jozef Lawrynowicz
685c95ebc4 MSP430: Fix CFA generation during function epilogues
There is no CFA information generated for instructions that manipulate the
stack during function epilogues. This means a debugger cannot determine the
position of variables on the stack whilst the epilogue is in progress.

This can cause the debugger to give erroneous information when printing a
backtrace whilst stepping through the epilogue, or cause software watchpoints
set on stack variables to become invalidated after a function epilogue
is executed.

The patch fixes this by marking stack manipulation insns as
frame_related, and adding reg_note RTXs to stack pop instructions in the
epilogue.

gcc/ChangeLog:

	* config/msp430/msp430.c (increment_stack): Mark insns which increment
	the stack as frame_related.
	(msp430_expand_prologue): Add comments.
	(msp430_expand_epilogue): Mark insns which decrement
	the stack as frame_related.
	Add reg_note to stack pop insns describing position of register
	variables on the stack.
2020-09-18 13:03:13 +01:00
Andrew Stubbs
220724c311 amdgcn: Remove omp_gcn pass
This pass only had an optimization for obtaining team/thread numbers in it,
and that turns out to be invalid in the presence of nested parallel regions,
so we can simply delete the whole thing.

Of course, it would be nice to apply the optimization where it is valid, but
that will take more effort than I have to spend right now.

gcc/ChangeLog:

	* config/gcn/gcn-tree.c (execute_omp_gcn): Delete.
	(make_pass_omp_gcn): Delete.
	* config/gcn/t-gcn-hsa (PASSES_EXTRA): Delete.
	* config/gcn/gcn-passes.def: Removed.
2020-09-18 11:13:07 +01:00
Alex Coplan
2bc8c6ed84 cfgloop.h: Reword comment describing is_exit flag
This simple change rewords a comment in cfgloop.h to improve the grammar
and readability.

gcc/ChangeLog:

	* cfgloop.h (nb_iter_bound): Reword comment describing is_exit.
2020-09-18 10:45:40 +01:00
Richard Biener
3ea069da14 tree-optimization/97095 - fix typo in vectorizable_live_operation
This fixes a typo introduced with the last change and not noticed
because those vectorizer access macros are not type safe ...

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

	PR tree-optimization/97095
	* tree-vect-loop.c (vectorizable_live_operation): Get
	the SLP vector type from the correct object.

	* gfortran.dg/pr97095.f: New testcase.
2020-09-18 11:37:00 +02:00
Richard Biener
0f6150a5d3 tree-optimization/97089 - fix bogus unsigned division replacement
This fixes bogus replacing of an unsigned (-x)/y division by
-(x/y).

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

	PR tree-optimization/97089
	* tree-ssa-sccvn.c (visit_nary_op): Do not replace unsigned
	divisions.
2020-09-18 09:22:57 +02:00
Richard Biener
080ddd8a81 tree-optimization/97098 - fix compile-time hog in SLP live
This fixes a missed early-out in SLP live stmt marking when
all scalar stmts were already visited (oops).

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

	PR tree-optimization/97098
	* tree-vect-slp.c (vect_bb_slp_mark_live_stmts): Do not
	recurse to children when all stmts were already visited.
2020-09-18 09:00:12 +02:00
Jason Merrill
f627125855 c++: Layout decls with newly-complete type.
Martin's -Wplacement-new patch ran into a problem with DECL_SIZE not being
set on an extern variable for which the type was not complete until after
its declaration.  complete_vars was deliberately not calling layout_decl for
some reason, instead leaving that for expand_expr_real_1 much later in the
compilation.  But if we layout decls at declaration time, I don't see any
reason we shouldn't lay them out here, when their type is newly complete.

gcc/cp/ChangeLog:

	* decl.c (complete_vars): Call layout_var_decl.
2020-09-17 23:19:59 -04:00
GCC Administrator
2aad20c094 Daily bump. 2020-09-18 00:16:24 +00:00
Tom de Vries
e766449f22 [testsuite] Introduce effective target non_strict_prototype
Consider test-case gcc.c-torture/compile/pr71109.c.

It contains a prototype-less declaration of foo:
...
static void foo ();
...
followed by a call to foo
...
      foo (bar, a);
...
followed by the definition of foo:
...
static inline void
foo (int x, struct S y, struct T z)
...

The test-case has undefined behaviour, but for the nvptx target it doesn't even
assemble:
...
$ gcc src/gcc/testsuite/gcc.c-torture/compile/pr71109.c -c
ptxas pr71109.o, line 196; error   : Type of argument does not match \
  formal parameter '%in_ar0'
ptxas pr71109.o, line 196; error   : Alignment of argument does not match \
  formal parameter '%in_ar0'
ptxas pr71109.o, line 196; error   : Call has wrong number of parameters
ptxas fatal   : Ptx assembly aborted due to errors
nvptx-as: ptxas returned 255 exit status
...

The problem is that this call:
...
   191  {
   192  .param .u64 %out_arg1;
   193  st.param.u64 [%out_arg1],%r23;
   194  .param .u64 %out_arg2;
   195  st.param.u64 [%out_arg2],%r32;
   196  call foo,(%out_arg1,%out_arg2);
   197  }
...
does not match the preceding declaration:
...
     6  // BEGIN FUNCTION DECL: foo
     7  .func foo (.param .u32 %in_ar0, .param .u64 %in_ar1, .param .u64 %in_ar2);
...
which is a PTX error.

Introduce an effective target non_strict_prototype that returns 0 for nvptx,
and use it in this and similar test-cases.

Tested on nvptx.

gcc/testsuite/ChangeLog:

	* lib/target-supports.exp (check_effective_target_non_strict_prototype):
	New proc.
	* gcc.c-torture/compile/pr71109.c: Require effective target
	non_strict_prototype.
	* gcc.c-torture/compile/pr83051-2.c: Same.
	* gcc.c-torture/compile/pr89663-1.c: Same.
	* gcc.c-torture/compile/pr89663-2.c: Same.
	* gcc.c-torture/compile/pr96796.c: Same.
2020-09-18 01:24:39 +02:00
Sergei Trofimovich
f234870e1c profile: clarify comment around histogram format
gcc/ChangeLog:

	* profile.c (sort_hist_values): Clarify hist format:
	start with a value, not counter.
2020-09-17 23:29:53 +01:00
Yeting Kuo
f95bd50b4c RISC-V: fix a typo in riscv.h
gcc/ChangeLog:
	* config/riscv/riscv.h (CSW_MAX_OFFSET): Fix typo.

gcc/testsuite/ChangeLog:
	* gcc.target/riscv/shorten-memrefs-8.c: New test.
2020-09-17 15:29:57 -06:00
Dimitrij Mojoski
172178c0c3 Autodetect C++ dialect in use for clang-format
PR other//97076
	* clang-format: Autodetect C++ standard in use rather than
	forcing C++03.
2020-09-17 15:22:33 -06:00
Marek Polacek
4f0aa5b051 c++: Add tests for fixed PRs.
Bugzilla inspection turned up a bunch of old(er) PRs that have been
fixed.  Let's include them not to regress in the future.

gcc/testsuite/ChangeLog:

	PR c++/87530
	PR c++/58156
	PR c++/68828
	PR c++/86002
	PR c++/91525
	PR c++/96223
	PR c++/87032
	PR c++/35098
	* g++.dg/cpp0x/move-return4.C: New test.
	* g++.dg/cpp0x/vt-58156.C: New test.
	* g++.dg/cpp2a/concepts-pr68828.C: New test.
	* g++.dg/cpp2a/concepts-pr86002.C: New test.
	* g++.dg/cpp2a/concepts-pr91525.C: New test.
	* g++.dg/cpp2a/constexpr-indeterminate1.C: New test.
	* g++.dg/cpp2a/desig17.C: New test.
	* g++.dg/ext/attrib62.C: New test.
2020-09-17 15:32:43 -04:00
Paul E. Murphy
c560591408 libgo: fix ptrace syscall hooks into glibc
ptrace is actually declared as a variadic function.  On ppc64le
the ABI requires to the caller to allocate space for the parameters
and allows the caller to modify them.

On ppc64le, depending on how and what version of GCC is used,
it will save to parameter save area.  This happened to clobber
a saved LR, and caused syscall.TestExecPtrace to fail with a timeout
when the tracee segfaults, and waits for the parent process to inspect.

Wrap this function to avoid directly calling glibc's ptrace from go.

Fixes golang/go#36698
Fixes go/92567

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/254755
2020-09-17 12:14:09 -07:00
Patrick Palka
4839de55e2 c-family: Macro support in -Wmisleading-indentation [PR80076]
Currently the -Wmisleading-indentation warning doesn't do any analysis
when the guarded statement or the statement after it is produced by a
macro.  This means we warn for:

  if (flag)
    foo ();
    bar ();

but not for:

  #define BAR bar
  if (flag)
    foo ();
    BAR ();

This patch extends the -Wmisleading-indentation implementation to
support analyzing such statements and their tokens.  This is done in the
"natural" way by resolving the location of each of the three tokens to
the token's macro expansion point.  (Additionally, if the tokens all
resolve to the same macro expansion point then we instead use their
locations within the macro definition.)  When these resolved locations
are all different, then we can proceed with applying the warning
heuristics to them as if no macros were involved.

gcc/c-family/ChangeLog:

	PR c/80076
	* c-indentation.c (should_warn_for_misleading_indentation): Move
	declarations of local variables closer to their first use.
	Handle virtual token locations by resolving them to their
	respective macro expansion points.  If all three tokens are
	produced from the same macro expansion, then instead use their
	loci within the macro definition.

gcc/objc/ChangeLog:

	PR c/80076
	* objc-gnu-runtime-abi-01.c
	(gnu_runtime_abi_01_get_class_super_ref): Reduce indentation of
	misleadingly indented return statements.
	* objc-next-runtime-abi-01.c
	(next_runtime_abi_01_get_class_super_ref): Likewise.

gcc/ChangeLog:

	PR c/80076
	* gensupport.c (alter_attrs_for_subst_insn) <case SET_ATTR>:
	Reduce indentation of misleadingly indented code fragment.
	* lra-constraints.c (multi_block_pseudo_p): Likewise.
	* sel-sched-ir.c (merge_fences): Likewise.

libcpp/ChangeLog:

	PR c/80076
	* include/line-map.h (first_map_in_common): Declare.
	* line-map.c (first_map_in_common): Remove static.

gcc/testsuite/ChangeLog:

	PR c/80076
	* c-c++-common/Wmisleading-indentation-5.c: New test.
2020-09-17 14:27:22 -04:00
Mark Wielaard
71e3d1970c Add DWARF5 variants of assembly scan tests that use DW_FORM_implicit_const
Some DWARF tests scan the assembly output looking for constant values.
When using DWARF5 those constants might use DW_FORM_implicit_const,
which are output (in the comments) after the attribute instead of
before. To make sure these tests work introduce a -gdwarf-5 variant
of these tests and explicitly use -gdwarf-2 for the original.

gcc/testsuite/ChangeLog:

	* gcc.dg/debug/dwarf2/inline2.c: Add -gdwarf-2.
	* g++.dg/debug/dwarf2/inline-var-1.C: Likewise.
	* gcc.dg/debug/dwarf2/pr41445-5.c: Likewise.
	* gcc.dg/debug/dwarf2/pr41445-6.c: Likewise.
	* gcc.dg/debug/dwarf2/inline6.c: New variant with -gdwarf-5.
	* g++.dg/debug/dwarf2/inline-var-3.C: Likewise.
	* gcc.dg/debug/dwarf2/pr41445-7.c: Likewise.
	* gcc.dg/debug/dwarf2/pr41445-8.c: Likewise.
2020-09-17 20:13:13 +02:00
Andrea Corallo
ee7aa7e7b9 aarch64: Fix dejaGNU directive in clastb_8.c testcase
gcc/testsuite/ChangeLog

2020-09-17  Andre Corallo  <andrea.corallo@arm.com>

	* gcc.target/aarch64/sve/clastb_8.c: Fix a dg-final scan
	directive.
2020-09-17 19:32:41 +02:00
Martin Sebor
90e4dcb79a Document -Wuninitialized for allocated objects.
gcc/ChangeLog:

	* doc/invoke.texi (-Wuninitialized): Document -Wuninitialized for
	allocated objects.
	 (-Wmaybe-uninitialized): Same.
2020-09-17 09:07:09 -06:00
David Edelsohn
21fdebc519 aix: apply socket.h extern "C++" more narrowly.
Recent Technology Levels of AIX 7.2 have made sys/socket.h more C++-aware,
which causes the fix to be applied in too many locations.  This patch adds
more context for the selection to apply the fix more narrowly.

fixincludes/ChangeLog:

2020-09-17  David Edelsohn  <dje.gcc@gmail.com>

	* inclhack.def (aix_externcpp1): Add more context to select.
	(aix_externcpp2): Same.
	* fixincl.x: Regenerate.
	* tests/base/sys/socket.h: Update expected results.
2020-09-17 14:18:32 +00:00
Patrick Palka
b28b621ac6 c++: requires-expressions and partial instantiation [PR96410]
This patch makes tsubst_requires_expr avoid substituting into a
requires-expression when partially instantiating a generic lambda.
This is necessary in general to ensure that we always check requirements
in lexical order (as in the first testcase below).  A mechanism similar
to PACK_EXPANSION_EXTRA_ARGS is added to remember template arguments and
defer substitution of requires-expressions.

Incidentally, this change also fixes the two mentioned PRs -- the
problem there is that tsubst_requires_expr was performing semantic
checks on template trees, and some of the checks are not prepared to
handle such trees.  With this patch, tsubst_requires_expr no longer
does any semantic checking at all when processing_template_decl.

gcc/cp/ChangeLog:

	PR c++/96409
	PR c++/96410
	* constraint.cc (tsubst_requires_expr): Use REQUIRES_EXPR_PARMS
	and REQUIRES_EXPR_REQS.  Use REQUIRES_EXPR_EXTRA_ARGS,
	add_extra_args and build_extra_args to defer substitution until
	we have all the template arguments.
	(finish_requires_expr): Adjust the call to build_min so that
	REQUIRES_EXPR_EXTRA_ARGS gets set to NULL_TREE.
	* cp-tree.def (REQUIRES_EXPR): Give it a third operand.
	* cp-tree.h (REQUIRES_EXPR_PARMS, REQUIRES_EXPR_REQS,
	REQUIRES_EXPR_EXTRA_ARGS): Define.
	(add_extra_args, build_extra_args): Declare.

gcc/testsuite/ChangeLog:

	PR c++/96409
	PR c++/96410
	* g++.dg/cpp2a/concepts-lambda13.C: New test.
	* g++.dg/cpp2a/concepts-lambda14.C: New test.
2020-09-17 09:16:02 -04:00
Christophe Lyon
9fcedcc391 libgcc/config/arm/fp16.c: Make _internal functions static inline
This patch makes the *_internal functions 'static inline' to avoid these warnings during the build:
/libgcc/config/arm/fp16.c:169:1: warning: no previous prototype for '__gnu_h2f_internal' [-Wmissing-prototypes]
/libgcc/config/arm/fp16.c:194:1: warning: no previous prototype for '__gnu_f2h_ieee' [-Wmissing-prototypes]
/libgcc/config/arm/fp16.c:200:1: warning: no previous prototype for '__gnu_h2f_ieee' [-Wmissing-prototypes]
/libgcc/config/arm/fp16.c:206:1: warning: no previous prototype for '__gnu_f2h_alternative' [-Wmissing-prototypes]
/libgcc/config/arm/fp16.c:212:1: warning: no previous prototype for '__gnu_h2f_alternative' [-Wmissing-prototypes]
/libgcc/config/arm/fp16.c:218:1: warning: no previous prototype for '__gnu_d2h_ieee' [-Wmissing-prototypes]
/libgcc/config/arm/fp16.c:224:1: warning: no previous prototype for '__gnu_d2h_alternative' [-Wmissing-prototypes]

2020-09-11  Torbjörn SVENSSON  <torbjorn.svensson@st.com>
	    Christophe Lyon  <christophe.lyon@linaro.org>

	libgcc/
	* config/arm/fp16.c (__gnu_h2f_internal): Add 'static inline'
	qualifier.
	(__gnu_f2h_ieee, __gnu_h2f_ieee, __gnu_f2h_alternative)
	(__gnu_h2f_alternative,__gnu_d2h_ieee, __gnu_d2h_alternative): Add
	missing prototypes.
2020-09-17 12:23:36 +00:00
Tobias Burnus
c12facd228 Fortran: Avoid double-free with parse error (PR96041, PR93423)
gcc/fortran/

	PR fortran/96041
	PR fortran/93423
	* decl.c (gfc_match_submod_proc): Avoid later double-free
	in the error case.
2020-09-17 14:01:09 +02:00
Richard Biener
c7f4be78cb CSE negated multiplications and divisions
This adds the capability to look for available negated multiplications
and divisions, replacing them with cheaper negates.

2020-09-17  Richard Biener  <rguenther@suse.de>

	* tree-ssa-sccvn.c (visit_nary_op): Value-number multiplications
	and divisions to negates of available negated forms.

	* gcc.dg/tree-ssa/ssa-fre-88.c: New testcase.
2020-09-17 13:56:15 +02:00
Eric Botcazou
225a08220e Fix assertion checking failure with tail call
gcc/ChangeLog:
	PR middle-end/97078
	* function.c (use_register_for_decl): Test cfun->tail_call_marked
	for a parameter here instead of...
	(assign_parm_setup_reg): ...here.

gcc/testsuite/ChangeLog:
	* gcc.dg/pr97078.c: New test.
2020-09-17 13:00:24 +02:00
Aldy Hernandez
80cbca3246 Allow copying of symbolic ranges to an irange.
This fixes an ICE when trying to copy a legacy value_range containing
a symbolic to a multi-range:

	min = make_ssa_name (type);
	max = build_int_cst (type, 55);
	value_range vv (min, max);
	int_range<2> vr = vv;

gcc/ChangeLog:

	* range-op.cc (multi_precision_range_tests): Normalize symbolics when copying to a
	multi-range.
	* value-range.cc (irange::copy_legacy_range): Add test.
2020-09-17 12:51:54 +02:00
Jan Hubicka
27eac88a3f Fix availability of functions in other partitions
* cgraph.c (cgraph_node::get_availability): Fix availability of
	functions in other partitions
	* varpool.c (varpool_node::get_availability): Likewise.
2020-09-17 12:41:07 +02:00
Wei Wentao
ec7ef30421 aarch64: Fixed unused variable warning in aarch64-unwind.h
libgcc/
	* config/aarch64/aarch64-unwind.h (aarch64_demangle_return_addr): Fix
	unused variable warning.
2020-09-17 10:40:23 +01:00
Christophe Lyon
21138a4e9b fixincludes/fixfixes.c: Fix 'set but not used' warning.
pz_tmp_base and pz_tmp_dot are always set, but used only when
_PC_NAME_MAX is defined.

This patch moves their declaration and definition undef #ifdef
_PC_NAME_MAX to avoid this warning.

2020-09-11  Torbjörn SVENSSON  <torbjorn.svensson@st.com>
	    Christophe Lyon  <christophe.lyon@linaro.org>

	fixincludes/
	* fixfixes.c (pz_tmp_base, pz_tmp_dot): Define only with
	_PC_NAME_MAX.
2020-09-17 09:36:42 +00:00
Jojo R
6ee9c21653 C-SKY: Add -msim option
gcc/ChangeLog:

	* config/csky/csky.opt (msim): New.
	* doc/invoke.texi (C-SKY Options): Document -msim.
	* config/csky/csky-elf.h (LIB_SPEC): Add simulator runtime.
2020-09-17 15:01:32 +08:00
Sergei Trofimovich
f723794355 doc: use @code{} instead of @samp{@command{}} around 'date %s'
Before the change 'man gcc' rendered "SOURCE_DATE_EPOCH" section as:
    ... the output of @command{date +%s} on GNU/Linux ...
After the change it renders as:
    ... the output of "date +%s" on GNU/Linux ...

gcc/ChangeLog:

	* doc/cppenv.texi: Use @code{} instead of @samp{@command{}}
	around 'date %s'.
2020-09-17 07:47:11 +01:00
liuhongt
a8c4b66a41 If -mavx implies -mxsave, then -mno-xsave should imply -mno-avx.
Current status is -mno-avx implies -mno-xsave which should be wrong.

gcc/ChangeLog

	* common/config/i386/i386-common.c
	(OPTION_MASK_ISA_AVX_UNSET): Remove OPTION_MASK_ISA_XSAVE_UNSET.
	(OPTION_MASK_ISA_XSAVE_UNSET): Add OPTION_MASK_ISA_AVX_UNSET.

gcc/testsuite/ChangeLog

	* gcc.target/i386/xsave-avx-1.c: New test.
2020-09-17 12:59:35 +08:00
GCC Administrator
ecde1b0a46 Daily bump. 2020-09-17 00:16:31 +00:00