Commit Graph

176814 Commits

Author SHA1 Message Date
Jason Merrill
7e7d9fcff5 c++: Fix stdcall attribute in template. [PR95222]
Another case that breaks with my fix for PR90750: we shouldn't move type
attributes in TYPENAME context either, as there's no decl for them to move
to.

gcc/cp/ChangeLog:

	PR c++/95222
	* decl.c (grokdeclarator): Don't shift attributes in TYPENAME
	context.

gcc/testsuite/ChangeLog:

	PR c++/95222
	* g++.dg/ext/tmplattr10.C: New test.
2020-05-27 10:05:36 -04:00
Nathan Sidwell
ac9face8d2 c++: Revert alias template change [pr95263]
Turns out templates are more complicated than you think, even when you
know they are more complicated than you think.  Reverting this change.

	PR c++/95263
	* pt.c (lookup_template_class_1): Restore alias template mutation.
2020-05-27 09:58:48 -04:00
Richard Biener
6c8e16aea8 tree-optimization/95295 - fix sinking after path merging in new SM code
This fixes a missed sinking of remat stores across unrelated stores
after merging from different paths.

2020-05-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/95295
	* tree-ssa-loop-im.c (sm_seq_valid_bb): Fix sinking after
	merging stores from paths.

	* gcc.dg/torture/pr95295-3.c: New testcase.
2020-05-27 14:56:43 +02:00
Jonathan Wakely
116e3cfc7b libstdc++: Add new testcase for comparison category types
Comparing a comparison category type to anything except a literal 0 is
undefined. This verifies that at least some misuses are diagnosed at
compile time.

	* testsuite/18_support/comparisons/categories/zero_neg.cc: New test.
2020-05-27 13:14:17 +01:00
Richard Biener
764ef40ba1 tree-optimization/95356 - fix vectorizable_shift vector types
This makes sure to always use the same vector type for the shift
operand as for the shifted operand.

2020-05-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/95356
	* tree-vect-stmts.c (vectorizable_shift): Adjust vector
	type for the shift operand.
2020-05-27 14:14:11 +02:00
Richard Biener
a5d8d86e8a tree-optimization/95335 - fix SLP nodes dropped to invariant
When we drop a SLP node to invariant because we cannot vectorize it
we have to make sure to revisit it in the users.

2020-05-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/95335
	* tree-vect-slp.c (vect_slp_analyze_node_operations): Reset
	lvisited for nodes made external.

	* gcc.dg/vect/bb-slp-pr95335.c: New testcase.
2020-05-27 13:08:22 +02:00
Martin Liska
e247d59274
Add new git-backport.py script.
contrib/ChangeLog:

	* gcc-git-customization.sh: Use git-backport.py to drop
	all changes for ChangeLog files.
	* git-backport.py: New file.
2020-05-27 12:04:57 +02:00
Martin Liska
8d6bae5548
Bump version to 11.
gcc/ada/ChangeLog:

	* gnatvsn.ads: Bump Library_Version to 11.
2020-05-27 11:42:32 +02:00
Richard Biener
f61f9b2879 Add debug (slp_tree) and dump infrastructure for this
This adds an alternate debug_dump_context similar to the one for
selftests but for interactive debugging routines.  This allows
to share code between user-visible dumping via the dump_* API
and those debugging routines.  The primary driver was SLP node
dumping which wasn't accessible from inside a gdb session up to
now.

2020-05-27  Richard Biener  <rguenther@suse.de>

	* dump-context.h (debug_dump_context): New class.
	(dump_context): Make it friend.
	* dumpfile.c (debug_dump_context::debug_dump_context):
	Implement.
	(debug_dump_context::~debug_dump_context): Likewise.
	* tree-vect-slp.c: Include dump-context.h.
	(vect_print_slp_tree): Dump a single SLP node.
	(debug): New overload for slp_tree.
	(vect_print_slp_graph): Rename from vect_print_slp_tree and
	use that.
	(vect_analyze_slp_instance): Adjust.
2020-05-27 11:07:37 +02:00
Jakub Jelinek
baff22c48b openmp: Fix up omp_declare_variant{s,_alt} htab handling
This patch fixes a GC ICE.  During debugging, I've found that during
gimplification we can actually call omp_resolve_declare_variant multiple
times and it would create a new magic declare_variant_alt FUNCTION_DECL
each time, which is undesirable, once we have such a decl, we should just
use that.  The other problem is that there was no cgraph node removal hook.
As the omp_declare_variants htab is used just early during gimplification,
we can just clear the whole htab, rather than trying to lookup and remove
a particular entry.  The other hash table is used later as well and that
one uses just DECL_UID as hash, so in that case the patch removes the elt.

2020-05-27  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/95315
	* omp-general.c (omp_declare_variant_remove_hook): New function.
	(omp_resolve_declare_variant): Always return base if it is already
	declare_variant_alt magic decl itself.  Register
	omp_declare_variant_remove_hook as cgraph node removal hook.

	* gcc.dg/gomp/pr95315.c: New test.
2020-05-27 10:25:56 +02:00
Jakub Jelinek
79ea774f9a Rewrite maintainer-scripts/update_version_git
This patch rewrites update_version_git to be just a thin wrapper around
Martin's new python script.  This just arranges to check out the gcc
repo in a temporary directory, copy out the contrib scripts so that
the running script doesn't change with branch checkouts and runs the script.

I've run it today manually but hopefully we can do it from cron again
from tomorrow.

2020-05-27  Jakub Jelinek  <jakub@redhat.com>

	* update_version_git: Rewrite using
	contrib/gcc-changelog/git_update_version.py.
2020-05-27 10:24:09 +02:00
Martin Liska
b423f910dc
Rename commit-mklog alias to gcc-commit-mklog.
contrib/ChangeLog:

	* gcc-git-customization.sh: Rename
	commit-mklog to gcc-commit-mklog.
2020-05-27 10:16:21 +02:00
Martin Liska
7b8ee33aff
prepare-commit-msg: Save diff if requested by user.
contrib/ChangeLog:

	* prepare-commit-msg: Save diff to a file if
	the GCC_GIT_DIFF_FILE variable is set.
2020-05-27 10:12:58 +02:00
GCC Administrator
c3a4169be9 Daily bump. 2020-05-27 07:45:56 +00:00
Jeff Law
bc48456d08 Fix pr20601-1.c on the H8
gcc/
	* config/h8300/testcompare.md (tst_extzv_1_n): Do not accept constants
	for the primary input operand.
	(tstsi_variable_bit_qi): Similarly.
2020-05-26 22:17:15 -06:00
David Malcolm
bf40f0ba95 jit: fix missing types for builtins [PR 95306]
PR jit/95306 reports that attempts to use builtins
__builtin_sadd_overflow" and "__builtin_memcpy" via
gcc_jit_context_get_builtin_function lead to inscrutable error
messages of the form:
  unimplemented primitive type for builtin: 42
and:
  unimplemented primitive type for builtin: 38

The root cause is that jit-builtins.c only implements a subset
of the types defined via DEF_PRIMITIVE_TYPE in builtin-types.def.

This patch:
- implements enough types to enable the above two builtins to be
  referenced
- documents gcc_jit_context_get_builtin_function, and notes the
  limitation that not all types are supported (supporting
  some of them would take a lot of extra work)
- improves the error message for the unsupported cases
- adds a testcase for __builtin_memcpy.  This required
  jit_langhook_global_bindings_p to be implemented (otherwise
  the assertion there failed deep inside "expand" on the builtin)
- adds test coverage for the above

gcc/jit/ChangeLog:
	PR jit/95306
	* docs/topics/functions.rst
	(gcc_jit_context_get_builtin_function): Document.
	* docs/_build/texinfo/libgccjit.texi: Regenerate.
	* dummy-frontend.c (jit_langhook_global_bindings_p): Remove
	gcc_unreachable.
	* jit-builtins.c (type_names): New array.
	(get_string_for_type_id): New function.
	(gcc::jit::builtins_manager::make_primitive_type): Show name of
	type in error messages.  Update cases to reflect the order in
	builtin-types.def.  Implement cases for BT_INT8, BT_INT16,
	BT_UINT8, BT_CONST_PTR, BT_VOLATILE_PTR, BT_INT_PTR, BT_FLOAT_PTR,
	BT_CONST_DOUBLE_PTR, BT_SIZE, BT_CONST_SIZE.

gcc/testsuite/ChangeLog:
	PR jit/95306
	* jit.dg/all-non-failing-tests.h: Add test-builtin-memcpy.c and
	test-pr95306-builtin-types.c.
	* jit.dg/test-builtin-memcpy.c: New test.
	* jit.dg/test-error-gcc_jit_context_get_builtin_function-unimplemented-type.c:
	New test.
	* jit.dg/test-pr95306-builtin-types.c: New test.
2020-05-26 18:00:46 -04:00
Harald Anlauf
56f03cd12b PR fortran/95104 - Segfault on a legal WAIT statement
Referencing a unit in a WAIT statement that has not been opened before
resulted in a NULL pointer dereference.  Check for this condition.

2020-05-26  Harald Anlauf  <anlauf@gmx.de>

libgfortran/
	PR libfortran/95104
	* io/transfer.c (st_wait_async): Do not dereference NULL pointer.

gcc/testsuite/
	PR libfortran/95104
	* gfortran.dg/pr95104.f90: New test.

Co-Authored-By: Steven G. Kargl  <kargl@gcc.gnu.org>
2020-05-26 23:29:52 +02:00
Patrick Palka
3bf5e7657b libstdc++: Fix common_iterator::operator-> [PR95322]
This patch fixes the definition of common_iterator::operator-> when the
underlying iterator's operator* returns a non-reference.

The first problem is that the class __detail::_Common_iter_proxy is used
unqualified.  Fixing that revealed another problem: the class's template
friend declaration of common_iterator doesn't match up with the
definition of common_iterator, because the friend declaration isn't
constrained.

If we try to make the friend declaration match up by adding constraints,
we run into frontend bug PR93467.  So we currently can't correctly
express this friend relation between __detail::_Common_iter_proxy and
common_iterator.

As a workaround to this frontend bug, this patch moves the definition of
_Common_iter_proxy into the class template of common_iterator so that we
could instead express the friend relation via the injected-class-name.

(This bug was found when attempting to use views::common to work around
the compile failure with the testcase in PR95322.)

libstdc++-v3/ChangeLog:

	PR libstdc++/95322
	* include/bits/stl_iterator.h (__detail::_Common_iter_proxy):
	Remove and instead define it ...
	(common_iterator::_Proxy): ... here.
	(common_iterator::operator->): Use it.
	* testsuite/24_iterators/common_iterator/2.cc: New test.
	* testsuite/std/ranges/adaptors/95322.cc: New test.
2020-05-26 16:17:34 -04:00
Harald Anlauf
8d8a25b0a7 PR libfortran/95195 - improve runtime error for namelist i/o to unformatted file
Namelist input/output to unformatted files is prohibited.
Generate useful runtime errors instead instead of misleading ones.

2020-05-26  Harald Anlauf  <anlauf@gmx.de>

libgfortran/
	PR fortran/95195
	* io/transfer.c (finalize_transfer): Generate runtime error for
	namelist input/output to unformatted file.

gcc/testsuite/
	PR fortran/95195
	* gfortran.dg/namelist_97.f90: New test.
2020-05-26 21:33:46 +02:00
Eric Botcazou
73655feb9d Fix issue with LTO bootstrap
gcc/ada/ChangeLog
	PR ada/95333
	* gcc-interface/decl.c (gnat_to_gnu_param): Never make a variant of
	the type.
2020-05-26 21:23:27 +02:00
Harald Anlauf
48d5266139 PR fortran/95089 - ICE in gfc_get_derived_type, at fortran/trans-types.c:2843
For long module name, derive type and component name, the
generated name-mangled symbol did not fit into a buffer when
coarrays were enabled.  Provide sufficiently large temporary.

2020-05-26  Harald Anlauf  <anlauf@gmx.de>

gcc/fortran/
	PR fortran/95089
	* trans-types.c (gfc_get_derived_type): Enlarge temporary to hold
	mangled name "_caf_symbol".

gcc/testsuite/
	PR fortran/95089
	* gfortran.dg/pr95089.f90: New test.
2020-05-26 21:19:19 +02:00
Uros Bizjak
9f0cb44e9b i386: Add SSE2 alternative to mmx_pswapd2vsi2
2020-05-26  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:
	* config/i386/mmx.md (mmx_pswapdv2si2): Add SSE2 alternative.
2020-05-26 18:51:37 +02:00
Tobias Burnus
c5ab336ba1 [LTO/offloading] Fix offloading-compilation ICE without -flto (PR84320)
gcc/ChangeLog:
	PR ipa/95320
	* ipa-utils.h (odr_type_p): Also permit calls with
	only flag_generate_offload set.
2020-05-26 18:25:29 +02:00
Pierre-Marie de Rodat
519f250645 gcc-changelog: handle entries with multi-line file lists
This extends the ChangeLog entries parsing machinery to handle entries
that cover multiple files spanning over multiple lines. For instance:

    * first_file_patched.c, second_file_patched.c, third_file_patched.c,
    fourth_file_patched.c: Do things.

contrib/

	* gcc-changelog/git_commit.py (ChangeLogEntry): Handle entries
	with multi-line file lists.
	* gcc-changelog/test_email.py: New testcase.
	* gcc-changelog/test_patches.txt: Likewise.
2020-05-26 17:45:58 +02:00
Pierre-Marie de Rodat
bb07057a31 gcc-changelog: remove file descriptor leaks
Currently, running gcc-changelog's unit tests may clutter the output
with tons of warnings such as:

    .../contrib/gcc-changelog/git_email.py:40: ResourceWarning: unclosed
    file <_io.TextIOWrapper name='/tmp/tmpt5okd4qp.patch' mode='r'
    encoding='UTF-8'>
      lines = open(self.filename).read().splitlines()
    ResourceWarning: Enable tracemalloc to get the object allocation
    traceback

This commit fixes these leaks, which restores a clean testsuite output.

contrib/

	* gcc-changelog/git_update_version.py: Close file objects after
	use.
	* gcc-changelog/git_email.py: Likewise.
	* gcc-changelog/test_email.py: Likewise.
2020-05-26 17:45:38 +02:00
David Malcolm
0981cf960d jit: fix sphinx formatting issues in docs
gcc/jit/ChangeLog:
	* docs/topics/compatibility.rst: Fix underline.
	Fix missing labels.
	* docs/topics/types.rst: Fix missing blank line.
	* docs/_build/texinfo/libgccjit.texi: Regenerate.
2020-05-26 10:57:24 -04:00
David Malcolm
6f7585deed jit: check for void types [PR 95296]
PR jit/95296 reports an ICE when using libgccjit to create a local of void
type.

This patch adds checking to various API entrypoints in libgccjit.c so that
they fail gracefully with an error if the client code attempts to create
various kinds of rvalues or types involving void types.
The patch documents these and various pre-existing restrictions on types
in the API.

gcc/jit/ChangeLog:
	PR jit/95296
	* docs/topics/expressions.rst (Unary Operations): Document that
	result_type of gcc_jit_context_new_unary_op must be a numeric type.
	(Binary Operations): Likewise for gcc_jit_context_new_binary_op.
	(Global variables): Document that "type" of
	gcc_jit_context_new_global must be non-`void`.
	* docs/topics/function-pointers.rst
	(gcc_jit_context_new_function_ptr_type): Document that the
	param_types must be non-void, but that return_type may be.
	* docs/topics/functions.rst (Params): Document that
	gcc_jit_context_new_param's type must be non-void.
	(Functions): Likewise for gcc_jit_function_new_local.
	* docs/topics/types.rst (gcc_jit_context_new_array_type): Document
	that the type must be non-void.
	(gcc_jit_context_new_field): Likewise.
	* docs/_build/texinfo/Makefile: Regenerate.
	* docs/_build/texinfo/libgccjit.texi: Regenerate.
	* libgccjit.c (gcc_jit_context_new_array_type): Fail if
	element_type is void.
	(gcc_jit_context_new_field): Likewise for "type".
	(gcc_jit_context_new_function_ptr_type): Likewise for each
	element of param_types.
	(gcc_jit_context_new_param): Likewise for "type".
	(gcc_jit_context_new_global): Likewise.
	(gcc_jit_function_new_local): Likewise.
	(gcc_jit_type_get_aligned): Likewise.

gcc/testsuite/ChangeLog:
	PR jit/95296
	* jit.dg/test-error-gcc_jit_context_new_global-void-type.c: New
	test.
	* jit.dg/test-error-gcc_jit_function_new_local-void-type.c: New
	test.
	* jit.dg/test-fuzzer.c (fuzzer_init): Allow for make_random_type
	to return NULL.
	(get_random_type): Allow for elements in f->types to be NULL.
2020-05-26 10:47:46 -04:00
Alexandre Oliva
6232d02b4f do not skip validation of switch after %<opt
After the patch that revamped dump and aux outputs, GCC compilation
drivers built without Ada would reject -d* options.  Such options
would only be validated because of the %{d*} in Ada lang specs, though
other languages had it as well.  Other languages had %< specs that had
to be there before %{d*} %:dumps(), while Ada was missing them.
Adding them to Ada brought the same problem to compilers that had Ada
enabled.

The reason validation failed was that they mishandled %< specs,
advancing past the beginning of the next spec, causing it not to be
handled.  Since %{d*} appeared after an odd %<, it was thus ignored.
The logic of validate_switches originally skipped the closing brace
that matched the opening brace, but this shouldn't happen for %<.
Fixed by letting validate_switches know whether it is handling a
braced group or a single atom, and behaving accordingly.


gcc/ChangeLog:

	* gcc.c (validate_switches): Add braced parameter.  Adjust all
	callers.  Expected and skip trailing brace only if braced.
	Return after handling one atom otherwise.
	(DUMPS_OPTIONS): New.
	(cpp_debug_options): Define in terms of it.

gcc/ada/ChangeLog:

	* gcc-interface/lang-specs.h (ADA_DUMPS_OPTIONS): Define in
	terms of DUMPS_OPTIONS.  Replace occurrences of %{d*} %:dumps
	with it.
2020-05-26 11:02:21 -03:00
Richard Biener
1d72079ba3 tree-optimization/95327 - fix another vectorizable_shift const SLP op
This fixes another case where we fail to set the type on a SLP
constant operand in vectorizable_shift.

2020-05-26  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/95327
	* tree-vect-stmts.c (vectorizable_shift): Compute op1_vectype
	when we are not using a scalar shift.
2020-05-26 15:58:32 +02:00
Uros Bizjak
9b8579a6b3 i386: Implement V2SI and V4HI shuffles
2020-05-26  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:
	* config/i386/mmx.md (*mmx_pshufd_1): New insn pattern.
	* config/i386/i386-expand.c (ix86_vectorize_vec_perm_const):
	Handle E_V2SImode and E_V4HImode.
	(expand_vec_perm_even_odd_1): Handle E_V4HImode.
	Assert that E_V2SImode is already handled.
	(expand_vec_perm_broadcast_1): Assert that E_V2SImode
	is already handled by standard shuffle patterns.

gcc/testsuite/ChangeLog:
	* gcc.target/i386/vperm-v2si.c: New test.
	* gcc.target/i386/vperm-v4hi.c: Ditto.
2020-05-26 15:17:51 +02:00
Iain Sandoe
f6615c2133 coroutines, testsuite: Fix co-ret-17-void-ret-coro.C.
This was a bad testcase, found with fsanitize=address; the final suspend
is 'suspend never' which flows off the end of the coroutine destroying
the promise and the frame.   At that point access via the handle is an
error.  Fixed by checking that the promise is destroyed via a global var.

gcc/testsuite/ChangeLog:

	* g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C: Check for
	promise destruction via a global variable.
2020-05-26 12:27:48 +01:00
Martin Liska
c8462662da
Support --dry-mode in git_update_version.py.
The patch improves the script based on Jakub's needs,
I'm going to install the patch.

contrib/ChangeLog:

	* gcc-changelog/git_update_version.py: Add 2 new options.
2020-05-26 12:13:13 +02:00
Jan Hubicka
5c8344e728 Simplify types of TYPE_VALUES in enumeral types
streaming code assumes that INTEGER_CST never appears in non-trivial component.
This is not true and we sometimes stream such components which sort of silently
works but breaks our IL invariant about tree sharing.  This patch fixes one
instance of this problem where ENUMERAL_TYPE lists all its valids in TYPE_VALUES
that with some FEs (like Ada and C++) are having the enumeral type as a type
while in other FEs (like C) are simple integer types.

I convert them all to integers which also increases chance that they will be
shared with other integer constants at stream time.

gcc/

	* tree.c (free_lang_data_in_type): Simpify types of TYPE_VALUES in
	enumeral types.
2020-05-26 10:14:38 +02:00
Jakub Jelinek
f1f862aec2 openmp: Ensure copy ctor for composite distribute parallel for class iterators is instantiated [PR95197]
During gimplification omp_finish_clause langhook is called in several places
to add the language specific info to the clause like what default/copy ctors,
dtors and assignment operators should be used.

Unfortunately, if it refers to some not yet instantiated method, during
gimplification it is too late and the methods will not be instantiated
anymore.  For other cases, the genericizer has code to detect those and
instantiate whatever is needed, this change adds the same for
distribute parallel for class iterators where we under the hood need
a copy constructor for the iterator to implement it.

2020-05-26  Jakub Jelinek  <jakub@redhat.com>

	PR c++/95197
	* gimplify.c (find_combined_omp_for): Move to omp-general.c.
	* omp-general.h (find_combined_omp_for): Declare.
	* omp-general.c: Include tree-iterator.h.
	(find_combined_omp_for): New function, moved from gimplify.c.

	* cp-gimplify.c: Include omp-general.h.
	(cp_genericize_r) <case OMP_DISTRIBUTE>: For class iteration
	variables in composite distribute parallel for, instantiate copy
	ctor of their types.
2020-05-26 09:35:21 +02:00
Alexandre Oliva
1c7f8cbcc7 accept for dir/ChangeLog entries
I've long introduced ChangeLog entries as "for  dir/ChangeLog", a
format adopted by GNU CVS-Utilities some 20 years ago.  My commits
have been formatted like this forever.

This patch makes it acceptable for git gcc-verify.


contrib/ChangeLog:

	* gcc-changelog/git_commit.py (changelog_regex): Accept optional
	'for' prefix.
2020-05-26 04:30:18 -03:00
Alexandre Oliva
1dedc12d18 revamp dump and aux output names
This patch simplifies (!!!) the logic governing the naming of dump
files and auxiliary output files in the driver, in the compiler, and
in the LTO wrapper.  No changes are made to the naming of primary
outputs, there are often ways to restore past behavior, and a number
of inconsistencies are fixed.  Some internal options are removed
(-auxbase and -auxbase-strip), sensible existing uses of -dumpdir and
-dumpbase options remain unchanged, additional useful cases are added,
making for what is still admittedly quite complex.  Extensive
documentation and testcases provide numerous examples, from normal to
corner cases.

The most visible changes are:

- aux and dump files now always go in the same directory, that
defaults to the directory of the primary output, but that can be
overridden with -dumpdir, -save-temps=*, or, preserving past behavior,
with a -dumpbase with a directory component.

- driver and compiler now have the same notion of naming of auxiliary
outputs, e.g. .dwo files will no longer be in one location while the
debug info suggests they are elsewhere, and -save-temps and .dwo
auxiliary outputs now go in the same location as .su, .ci and
coverage data, with consistent naming.

- explicitly-specified primary output names guide not only the
location of aux and dump outputs: the output base name is also used in
their base name, as a prefix when also linking (e.g. foo.c bar.c -o
foobar creates foobar-foo.dwo and foobar-bar.dwo with -gsplit-dwarf),
or as the base name instead of the input name (foo.c -c -o whatever.o
creates whatever.su rather than foo.su with -fstack-usage).  The
preference for the input file base name, quite useful for our
testsuite, can be restored with -dumpbase "".  When compiling and
linking tests in the testsuite with additional inputs, we now use this
flag.  Files named in dejagnu board ldflags, libs, and ldscripts are
now quoted in the gcc testsuite with -Wl, so that they are not counted
as additional inputs by the compiler driver.

- naming a -dumpbase when compiling multiple sources used to cause
dumps from later compiles to overwrite those of earlier ones; it is
now used as a prefix when compiling multiple sources, like an
executable name above.

- the dumpbase, explicitly specified or computed from output or input
names, now also governs the naming of aux outputs; since aux outputs
usually replaced the suffix from the input name, while dump outputs
append their own additional suffixes, a -dumpbase-ext option is
introduced to enable a chosen suffix to be dropped from dumpbase to
form aux output names.

- LTO dump and aux outputs were quite a mess, sometimes leaking
temporary output names into -save-temps output names, sometimes
conversely generating desirable aux outputs in temporary locations.
They now obey the same logic of compiler aux and dump outputs, landing
in the expected location and taking the linker output name or an
explicit dumpbase overrider into account.

- Naming of -fdump-final-insns outputs now follows the dump file
naming logic for the .gkd files, and the .gk dump files generated in
the second -fcompare-debug compilation get the .gk inserted before the
suffix that -dumpbase-ext drops in aux outputs.


gcc/ChangeLog:

	* common.opt (aux_base_name): Define.
	(dumpbase, dumpdir): Mark as Driver options.
	(-dumpbase, -dumpdir): Likewise.
	(dumpbase-ext, -dumpbase-ext): New.
	(auxbase, auxbase-strip): Drop.
	* doc/invoke.texi (-dumpbase, -dumpbase-ext, -dumpdir):
	Document.
	(-o): Introduce the notion of primary output, mention it
	influences auxiliary and dump output names as well, add
	examples.
	(-save-temps): Adjust, move examples into -dump*.
	(-save-temps=cwd, -save-temps=obj): Likewise.
	(-fdump-final-insns): Adjust.
	* dwarf2out.c (gen_producer_string): Drop auxbase and
	auxbase_strip; add dumpbase_ext.
	* gcc.c (enum save_temps): Add SAVE_TEMPS_DUMP.
	(save_temps_prefix, save_temps_length): Drop.
	(save_temps_overrides_dumpdir): New.
	(dumpdir, dumpbase, dumpbase_ext): New.
	(dumpdir_length, dumpdir_trailing_dash_added): New.
	(outbase, outbase_length): New.
	(The Specs Language): Introduce %".  Adjust %b and %B.
	(ASM_FINAL_SPEC): Use %b.dwo for an aux output name always.
	Precede object file with %w when it's the primary output.
	(cpp_debug_options): Do not pass on incoming -dumpdir,
	-dumpbase and -dumpbase-ext options; recompute them with
	%:dumps.
	(cc1_options): Drop auxbase with and without compare-debug;
	use cpp_debug_options instead of dumpbase.  Mark asm output
	with %w when it's the primary output.
	(static_spec_functions): Drop %:compare-debug-auxbase-opt and
	%:replace-exception.  Add %:dumps.
	(driver_handle_option): Implement -save-temps=*/-dumpdir
	mutual overriding logic.  Save dumpdir, dumpbase and
	dumpbase-ext options.  Do not save output_file in
	save_temps_prefix.
	(adds_single_suffix_p): New.
	(single_input_file_index): New.
	(process_command): Combine output dir, output base name, and
	dumpbase into dumpdir and outbase.
	(set_collect_gcc_options): Pass a possibly-adjusted -dumpdir.
	(do_spec_1): Optionally dumpdir instead of save_temps_prefix,
	and outbase instead of input_basename in %b, %B and in
	-save-temps aux files.  Handle empty argument %".
	(driver::maybe_run_linker): Adjust dumpdir and auxbase.
	(compare_debug_dump_opt_spec_function): Adjust gkd dump file
	naming.  Spec-quote the computed -fdump-final-insns file name.
	(debug_auxbase_opt): Drop.
	(compare_debug_self_opt_spec_function): Drop auxbase-strip
	computation.
	(compare_debug_auxbase_opt_spec_function): Drop.
	(not_actual_file_p): New.
	(replace_extension_spec_func): Drop.
	(dumps_spec_func): New.
	(convert_white_space): Split-out parts into...
	(quote_string, whitespace_to_convert_p): ... these.  New.
	(quote_spec_char_p, quote_spec, quote_spec_arg): New.
	(driver::finalize): Release and reset new variables; drop
	removed ones.
	* lto-wrapper.c (HAVE_TARGET_EXECUTABLE_SUFFIX): Define if...
	(TARGET_EXECUTABLE_SUFFIX): ... is defined; define this to the
	empty string otherwise.
	(DUMPBASE_SUFFIX): Drop leading period.
	(debug_objcopy): Use concat.
	(run_gcc): Recognize -save-temps=* as -save-temps too.  Obey
	-dumpdir.  Pass on empty dumpdir and dumpbase with a directory
	component.  Simplify temp file names.
	* opts.c (finish_options): Drop aux base name handling.
	(common_handle_option): Drop auxbase-strip handling.
	* toplev.c (print_switch_values): Drop auxbase, add
	dumpbase-ext.
	(process_options): Derive aux_base_name from dump_base_name
	and dump_base_ext.
	(lang_dependent_init): Compute dump_base_ext along with
	dump_base_name.  Disable stack usage and callgraph-info	during
	lto generation and compare-debug recompilation.

gcc/fortran/ChangeLog:

	* options.c (gfc_get_option_string): Drop auxbase, add
	dumpbase_ext.

gcc/ada/ChangeLog:

	* gcc-interface/lang-specs.h: Drop auxbase and auxbase-strip.
	Use %:dumps instead of -dumpbase.  Add %w for implicit .s
	primary output.
	* switch.adb (Is_Internal_GCC_Switch): Recognize dumpdir and
	dumpbase-ext.  Drop auxbase and auxbase-strip.

lto-plugin/ChangeLog:

	* lto-plugin.c (skip_in_suffix): New.
	(exec_lto_wrapper): Use skip_in_suffix and concat to build
	non-temporary output names.
	(onload): Look for -dumpdir in COLLECT_GCC_OPTIONS, and
	override link_output_name with it.

contrib/ChangeLog:

	* compare-debug: Adjust for .gkd files named as dump files,
	with the source suffix rather than the object suffix.

gcc/testsuite/ChangeLog:

	* gcc.misc-tests/outputs.exp: New.
	* gcc.misc-tests/outputs-0.c: New.
	* gcc.misc-tests/outputs-1.c: New.
	* gcc.misc-tests/outputs-2.c: New.
	* lib/gcc-defs.exp (gcc_adjusted_linker_flags): New.
	(gcc_adjust_linker_flags): New.
	(dg-additional-files-options): Call it.  Pass -dumpbase ""
	when there are additional sources.
	* lib/profopt.exp (profopt-execute): Pass the executable
	suffix with -dumpbase-ext.
	* lib/scandump.exp (dump-base): Mention -dumpbase "" use.
	* lib/scanltranstree.exp: Adjust dump suffix expectation.
	* lib/scanwpaipa.exp: Likewise.
2020-05-26 04:30:15 -03:00
Martin Liska
4945b4c2c8
Allow ChangeLog entries for ignored location.
We should be able to generate ChangeLog entries for
commits like b3d566f570.
I'm going to install the patch.

contrib/ChangeLog:

	* gcc-changelog/git_commit.py: Parse changelog entries for
	ignored locations.
	* gcc-changelog/test_email.py: Add new test for it.
	* gcc-changelog/test_patches.txt: Likewise.
2020-05-26 09:02:43 +02:00
Martin Liska
b3d566f570
Update merge.sh to reflect usage of git.
After switching to GIT, we should use it in libsanitizer
merge script. I'll do merge from master as soon as
PR95311 gets fixed.

I'm going to install the patch.

libsanitizer/ChangeLog:

	* LOCAL_PATCHES: Use git hash instead of SVN id.
	* merge.sh: Use git instead of VCS.  Update paths
	relative to upstream git repository.
2020-05-26 08:48:14 +02:00
Jason Merrill
757dbb59c1
gcc-git: Add prepare-commit-msg hook.
This patch introduces a prepare-commit-msg hook that appends a ChangeLog
skeleton to a commit message when the GCC_FORCE_MKLOG environment variable
is set, and a 'git commit-mklog' command set that variable while running
'git commit'.

contrib/ChangeLog:

	* prepare-commit-msg: New file.
	* gcc-git-customization.sh: Install it.  Add commit-mklog alias.
	* mklog.py: Add new option -c which appends
	to a ChangeLog file.
2020-05-26 08:38:24 +02:00
Martin Liska
b8e5f22671
Revert "Add ChangeLog entry for my last commit."
This reverts commit cfdff3eeb9.
2020-05-26 08:07:30 +02:00
liuhongt
cfdff3eeb9 Add ChangeLog entry for my last commit. 2020-05-26 11:46:50 +08:00
liuhongt
9d0dc47de6 Fix non-comforming expander for floatv2div2sf2,floatunsv2div2sf2,fix_truncv2sfv2di,fixuns_truncv2sfv2di.
2020-05-26  Hongtao Liu  <hongtao.liu@intel.com>
	    Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:
	PR target/95211
	PR target/95256
	* config/i386/sse.md (<floatunssuffix>v2div2sf2): New expander.
	(fix<fixunssuffix>_truncv2sfv2di2): Ditto.
	(avx512dq_float<floatunssuffix>v2div2sf2): Renaming from
	float<floatunssuffix>v2div2sf2.
	(avx512dq_fix<fixunssuffix>_truncv2sfv2di2<mask_name>):
	Renaming from fix<fixunssuffix>_truncv2sfv2di2<mask_name>.
	(vec_pack<floatprefix>_float_<mode>): Adjust icode name.
	(vec_unpack_<fixprefix>fix_trunc_lo_<mode>): Ditto.
	(vec_unpack_<fixprefix>fix_trunc_hi_<mode>): Ditto.
	* config/i386/i386-builtin.def: Ditto.
	* emit-rtl.c (validate_subreg): Allow use of *paradoxical* vector
	subregs when both omode and imode are vector mode and
	have the same inner mode.

gcc/testsuite/ChangeLog
	* gcc.target/i386/pr95211.c: New test.
2020-05-26 11:41:15 +08:00
GCC Administrator
0b0d9a77d0 Daily bump. 2020-05-26 00:16:21 +00:00
Clément Chigot
adad99eb90 libgo: update x/sys/cpu after gccgo support added
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/234597
2020-05-25 13:43:44 -07:00
Eric Botcazou
ed01d707f8 Fix internal error on store to FP component at -O2
This is about a GIMPLE verification failure at -O2 or above because
the GIMPLE store merging pass generates a NOP_EXPR between a FP type
and an integral type.  This happens when the bit-field insertion path
is taken for a FP field, which can happen in Ada for bit-packed record
types.

It is fixed by generating an intermediate VIEW_CONVERT_EXPR.  The patch
also tames a little the bit-field insertion path because, for bit-packed
record  types in Ada, you can end up with large bit-field regions, which
results in a lot of mask-and-shifts instructions.

gcc/ChangeLog
	* gimple-ssa-store-merging.c (merged_store_group::can_be_merged_into):
	Only turn MEM_REFs into bit-field stores for small bit-field regions
	(imm_store_chain_info::output_merged_store): Be prepared for sources
	with non-integral type in the bit-field insertion case.
	(pass_store_merging::process_store): Use MAX_BITSIZE_MODE_ANY_INT as
	the largest size for the bit-field case.

gcc/testsuite/ChangeLog
	* gnat.dg/opt84.adb: New test.
2020-05-25 22:19:03 +02:00
Uros Bizjak
14cd049afc i386: Remove broadcasts from TARGET_MMX_WITH_SSE vec_dup insn patterns
XMM broadcast instructions broadcast value from general reg to all
elements of the vector.  This is not allowed for TARGET_MMX_WITH_SSE,
where it is expected that bits outside lower 64bits load or retain
zero value.  Following testcases expect broadcast, and are thus invalid:

FAIL: gcc.target/i386/sse2-mmx-18b.c scan-assembler-not movd
FAIL: gcc.target/i386/sse2-mmx-18b.c scan-assembler-times pbroadcastd 1
FAIL: gcc.target/i386/sse2-mmx-19b.c scan-assembler-not movd
FAIL: gcc.target/i386/sse2-mmx-19b.c scan-assembler-times pbroadcastw 1
FAIL: gcc.target/i386/sse2-mmx-19d.c scan-assembler-times pbroadcastw 1
FAIL: gcc.target/i386/sse2-mmx-19e.c scan-assembler-times pbroadcastw 1

These testcases are removed entirely.

2020-05-25  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:
	* config/i386/mmx.md (*vec_dupv2sf): Redefine as define_insn.
	(mmx_pshufw_1): Change Yv constraint to xYw.  Correct type attribute.
	(*vec_dupv4hi): Redefine as define_insn.
	Remove alternative with general register input.
	(*vec_dupv2si): Ditto.

gcc/testsuite/ChangeLog:
	* gcc.target/i386/sse2-mmx-18a.c (dg-options): Remove -mno-avx512vl.
	* gcc.target/i386/sse2-mmx-19a.c (dg-options): Remove -mno-avx.
	* gcc.target/i386/sse2-mmx-18b.c: Remove.
	* gcc.target/i386/sse2-mmx-18c.c: Ditto.
	* gcc.target/i386/sse2-mmx-19b.c: Ditto.
	* gcc.target/i386/sse2-mmx-19c.c: Ditto.
	* gcc.target/i386/sse2-mmx-19d.c: Ditto.
	* gcc.target/i386/sse2-mmx-19e.c: Ditto.
2020-05-25 16:11:18 +02:00
Martin Jambor
a42cc1f883 BRIG FE testsuite: Fix dump scan patterns in packed.hsail test
Starting with r11-165-eb72dc663e9 which converted DECL_GIMPLE_REG_P to
DECL_NOT_GIMPLE_REG_P we have failing BRIG testcase:

-PASS: packed.hsail.brig scan-tree-dump gimple "_[0-9]+ = q2 \\+ q3;"
-PASS: packed.hsail.brig scan-tree-dump gimple "= VEC_PERM_EXPR <new_output.[0-9]+_[0-9]+, [a-z0-9_]+, { 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }>;"
+FAIL: packed.hsail.brig scan-tree-dump gimple "_[0-9]+ = q2 \\+ q3;"
+FAIL: packed.hsail.brig scan-tree-dump gimple "= VEC_PERM_EXPR <new_output.[0-9]+_[0-9]+, [a-z0-9_]+, { 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }>;"

because the gimplifier is now smarter and generates nicer code, which
however, does not match the regexp in the testsuite:

--- before/packed.hsail.brig.005t.gimple        2020-05-12 17:59:26.434305513 +0200
+++ after/packed.hsail.brig.005t.gimple 2020-05-12 17:52:34.477055987 +0200
@@ -109,277 +109,267 @@
   q2 = q1 + _24;
   _25 = VEC_PERM_EXPR <q1, q1, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }>;
   q3 = q2 + _25;
-  _26 = q2 + q3;
-  new_output.11 = _26;
-  new_output.21_27 = new_output.11;
-  _28 = VEC_PERM_EXPR <new_output.21_27, q4, { 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }>;
-  s_output.12 = _28;
+  new_output.11 = q2 + q3;
+  s_output.12 = VEC_PERM_EXPR <new_output.11, q4, { 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }>;
   q4 = s_output.12;

I have looked at the SSA dump and verified that the variable in
question is a gimple register because it gets its SSA name.  I have
not looked into why the gimplifier previously though it had to go
through the additional temporaries though.

Tested with make -k check-brig.

	* brig.dg/test/gimple/packed.hsail: Fix scan dump patterns.
2020-05-25 16:07:48 +02:00
Richard Biener
dc0c019634 tree-optimization/95309 - fix invariant SLP node costing
This makes sure to compute SLP_TREE_NUMBER_OF_VEC_STMTS during SLP
analysis even for invariant / external nodes so costing properly
knows what to cost.

2020-05-25  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/95309
	* tree-vect-slp.c (vect_get_constant_vectors): Move number
	of vector computation ...
	(vect_slp_analyze_node_operations): ... to analysis phase.
2020-05-25 16:02:08 +02:00
Yannick Moy
431e762fae [Ada] Fix spurious error on checking of null Abstract_State
2020-05-25  Yannick Moy  <moy@adacore.com>

gcc/ada/

	* sem_util.adb (Check_No_Hidden_State): Stop propagation at
	first block/task/entry.
2020-05-25 10:00:55 -04:00
Yannick Moy
1a14bfbd78 [Ada] Change pragma Compile_Time_Error to force compile-time evaluation
2020-05-25  Yannick Moy  <moy@adacore.com>

gcc/ada/

	* doc/gnat_rm/implementation_defined_pragmas.rst: Document
	changes to pragmas Compile_Time_Error/Compile_Time_Warning.
	* gnat_rm.texi: Regenerate.
	* libgnat/g-bytswa.adb: Change uses of Compile_Time_Error to
	Compile_Time_Warning, as the actual expression may not always be
	known statically.
	* sem_prag.adb (Analyze_Pragma): Handle differently pragma
	Compile_Time_Error in both compilation and in GNATprove mode.
	(Validate_Compile_Time_Warning_Or_Error): Issue an error or
	warning when the expression is not known at compile time.
	* usage.adb: Add missing documentation for warning switches _c
	and _r.
	* warnsw.ads: Update comment.
2020-05-25 10:00:55 -04:00