Commit graph

185677 commits

Author SHA1 Message Date
Christoph Muellner
d5ba2eaf70 REE: PR rtl-optimization/100264: Handle more PARALLEL SET expressions
Move the check for register targets (i.e. REG_P ()) into the function
get_sub_rtx () and change the restriction of REE to "only one child of
a PARALLEL expression is a SET register expression" (was "only one child of
a PARALLEL expression is a SET expression").

This allows to handle more PARALLEL SET expressions.

gcc/ChangeLog:
	PR rtl-optimization/100264
	* ree.c (get_sub_rtx): Ignore SET expressions without register
	destinations and remove assertion, as it is not valid anymore
	with this new behaviour.
	(merge_def_and_ext): Eliminate destination check for register
	as such SET expressions can't occur anymore.
	(combine_reaching_defs): Likewise.
2021-06-02 14:01:35 -07:00
Jakub Jelinek
50b1de860a xtensa: Fix 2 warnings during xtensa build [PR100841]
When building gcc targetting xtensa-linux, there are 2 warnings the PR
complains about:
../../gcc/dwarf2cfi.c: In function ‘void init_one_dwarf_reg_size(int, machine_mode, rtx, machine_mode, init_one_dwarf_reg_state*)’:
../../gcc/dwarf2cfi.c:291:12: warning: comparison of integer expressions of different signedness: ‘const unsigned int’ and ‘int’ [-Wsign-compare]
  291 |   if (rnum >= DWARF_FRAME_REGISTERS)
../../gcc/function.c: In function ‘void gen_call_used_regs_seq(rtx_insn*, unsigned int)’:
../../gcc/function.c:5897:63: warning: comparison of unsigned expression in ‘< 0’ is always false [-Wtype-limits]
 5897 |       if (crtl->uses_only_leaf_regs && LEAF_REG_REMAP (regno) < 0)
which might during bootstrap or when configured with --enable-werror-always
be turned into errors.

The first one is the -Wsign-compare warning, in c-family we do:
2281          /* Do not warn if the signed quantity is an unsuffixed integer
2282             literal (or some static constant expression involving such
2283             literals or a conditional expression involving such literals)
2284             and it is non-negative.  */
2285          if (tree_expr_nonnegative_warnv_p (sop, &ovf))
2286            /* OK */;
and so don't warn if that function determines the expression is
non-negative.  But xtensa defines DWARF_FRAME_REGISTERS as
(16 + (something ? 0 : 1)) and that isn't handled by
tree_expr_nonnegative_warnv_p, VRP can handle it of course, but that is much
later.
The second chunk rewrites it into a form that tree_expr_nonnegative_warnv_p
can handle, in particular (something ? 16 : 16 + 1), where for COND_EXPRs
that function checks both the 2nd and 3rd operand of the ternary operator
and if both are nonnegative, returns true.

The other warning has been introduced fairly recently; LEAF_REG_REMAP is
currently used by 2 targets only, and is documented to yield -1 if a hard
reg number can't be remapped and the remapped register number otherwise.
That means that the type of the expression should be signed (otherwise -1
could never appear), and on SPARC indeed it is defined as
 extern char leaf_reg_remap[];
 #define LEAF_REG_REMAP(REGNO) (leaf_reg_remap[REGNO])
so unless the host is -funsigned-char by default it works fine.
I guess sparc.[ch] should be fixed to use signed char of leaf_reg_remap,
Eric?
The argument to LEAF_REG_REMAP is often unsigned int though, hard
register numbers are usually not negative, and thus the warning.
I think xtensa doesn't have 2G hard registers and so it is ok to just cast
it to int.

2021-06-02  Jakub Jelinek  <jakub@redhat.com>

	PR target/100841
	* config/xtensa/xtensa.h (LEAF_REG_REMAP): Cast REGNO to int to avoid
	-Wtype-limits warnings.
	(DWARF_FRAME_REGISTER): Rewrite into ternary operator with addition
	in operands to avoid -Wsign-compare warnings.
2021-06-02 22:09:53 +02:00
Pat Haugen
d2d74c9fc0 Make sure link reg save MEM has frame alias set.
gcc/ChangeLog:

	* config/rs6000/rs6000-logue.c (rs6000_emit_prologue): Use
	gen_frame_store.
2021-06-02 15:07:28 -05:00
Jason Merrill
63d182b293 c++: missing dtor with -fno-elide-constructors [PR100838]
tf_no_cleanup only applies to the outermost TARGET_EXPR, and we already
clear it for nested calls in build_over_call, but in this case both
constructor calls came from convert_like, so we need to clear it in the
recursive call as well.  This revealed that we were adding an extra
ck_rvalue in direct-initialization cases where it was wrong.

	PR c++/100838

gcc/cp/ChangeLog:

	* call.c (convert_like_internal): Clear tf_no_cleanup when
	recursing.
	(build_user_type_conversion_1): Only add ck_rvalue if
	LOOKUP_ONLYCONVERTING.

gcc/testsuite/ChangeLog:

	* g++.dg/init/no-elide2.C: New test.
2021-06-02 14:40:20 -04:00
Jason Merrill
659cc7d632 MAINTAINERS: Add DCO section
ChangeLog:

	* MAINTAINERS: Add DCO section.
2021-06-02 09:45:49 -04:00
Jonathan Wakely
f8f0193b5b libstdc++: Value-initialize objects held by EBO helpers [PR 100863]
The allocator, hash function and equality function should all be
value-initialized by the default constructor of an unordered container.
Do it in the EBO helper, so we don't have to get it right in multiple
places.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	PR libstdc++/100863
	PR libstdc++/65816
	* include/bits/hashtable_policy.h (_Hashtable_ebo_helper):
	Value-initialize subobject.
	* testsuite/23_containers/unordered_map/allocator/default_init.cc:
	Remove XFAIL.
	* testsuite/23_containers/unordered_set/allocator/default_init.cc:
	Remove XFAIL.
2021-06-02 13:33:41 +01:00
Jonathan Wakely
81eab204a5 libstdc++: Fix tests for COW std::string [PR 96088]
The expected number of allocations is different when copying COW
strings.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	PR libstdc++/96088
	* testsuite/23_containers/unordered_map/96088.cc: Adjust
	expected number of allocations.
	* testsuite/23_containers/unordered_set/96088.cc: Likewise.
2021-06-02 13:33:24 +01:00
Claudiu Zissulescu
46d04271a4 ARC: gcc driver default to hs38_linux
arc700 is legacy and there's no active development for it, so switch to
latest hs38_linux as default

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>

gcc/
2021-06-02  Vineet Gupta  <vgupta@synopsys.com>

	* config/arc/arc.h (TARGET_CPU_DEFAULT): Change to hs38_linux.
2021-06-02 15:17:00 +03:00
Jonathan Wakely
ca35586cf5 libstdc++: Improve punctuation in implementation status docs
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* doc/xml/manual/status_cxxis29124.xml: Improve punctuation.
	* doc/xml/manual/status_cxxtr1.xml: Likewise.
	* doc/xml/manual/status_cxxtr24733.xml: Likewise.
	* doc/html/*: Regenerate.
2021-06-02 12:32:13 +01:00
Ilya Leoshkevich
22d834e32b IBM Z: Remove match_scratch workaround
Since commit dd1ef00c45 ("Fix bug in the define_subst handling that
made match_scratch unusable for multi-alternative patterns.") the
workaround for that bug in *ashrdi3_31<setcc><cconly> is not only no
longer necessary, but actually breaks the build.

Get rid of it by using only one alternative in (match_scratch).  It
will be replicated as many times as needed in order to match the
pattern with which (define_subst) is used.

gcc/ChangeLog:

	* config/s390/s390.md(*ashrdi3_31<setcc><cconly>): Use a single
	constraint.
	* config/s390/subst.md(cconly_subst): Use a single constraint
	in (match_scratch).

gcc/testsuite/ChangeLog:

	* gcc.target/s390/ashr.c: New test.
2021-06-02 11:56:32 +02:00
Tobias Burnus
9ca24bd34b Fortran/OpenMP: Add gfortran.dg/gomp/taskloop-2.f90 [PR99928]
PR middle-end/99928

gcc/testsuite/ChangeLog

	* gfortran.dg/gomp/taskloop-2.f90: New.
2021-06-02 11:48:21 +02:00
Jakub Jelinek
c3ab6266bc testsuite: Add -Wno-psabi -w to g++.dg/ext/builtin-shufflevector-1.C
The testcase without this FAILs on i686-linux, where we warn about returning
of a generic vector changing the ABI.

2021-06-02  Jakub Jelinek  <jakub@redhat.com>

	* g++.dg/ext/builtin-shufflevector-1.C: Add -Wno-psabi -w to
	dg-options.
2021-06-02 10:24:56 +02:00
Martin Liska
088264ea44 icf: Fix memory leak of a vector.
gcc/ChangeLog:

	* ipa-icf.h: Use auto_vec for memory_access_types.
2021-06-02 08:46:24 +02:00
Jeff Law
4ea5fe8b40 Fix minor bugs in H8 port logical ops. Prepare for more compare/test removal
gcc/
	* config/h8300/h8300-protos.h (compute_a_shift_length): Drop unused
	argument from prototype.
	(output_logical_op): Add rtx_code argument.
	(compute_logical_op_length): Likewise.
	* config/h8300/h8300.c (h8300_and_costs): Pass additional argument
	to compute_a_shift_length.
	(output_logical_op); New argument with the rtx code rather than
	extracting it from an operand.  Handle QImode too.
	(compute_logical_op_length): Similary.
	(compute_a_shift_length): Drop unused argument.
	* config/h8300/h8300.md (logicals): New code iterator.
	* config/h8300/logical.md (<code><mode>3 expander): Combine
	the "and" expander with the "ior"/"xor" expander.
	(bclr<mode>msx): Combine the QI/HI mode patterns.
	(<logical><mode>3 insns): Use code iterator rather than match_operator.
	Handle QImode as well.   Update call to output_logical_op and
	compute_logical_op_length to pass in rtx_code
	Fix split condition on all define_insn_and_split patterns.
	(one_cmpl<mode>2<cczn>): Use <cczn> to support both clobbering
	the flags and setting ZN via existing define_subst.
	* config/h8300/shiftrotate.md: Drop unused argument from
	calls to compute_a_shift_length.

	Signed-off-by: Jeff Law <jeffreyalaw@gmail.com>
2021-06-02 01:06:35 -04:00
GCC Administrator
b75978d14f Daily bump. 2021-06-02 00:16:43 +00:00
Patrick Palka
ac0bc21bd6 c++: value-init vs zero-init in expand_aggr_init_1 [PR65816]
In the case of value-initializing an object of class type T,
[dcl.init.general]/8 says:

  - if T has either no default constructor ([class.default.ctor]) or
    a default constructor that is user-provided or deleted, then the
    object is default-initialized;
  - otherwise, the object is zero-initialized and ...  if T has a
    non-trivial default constructor, the object is default-initialized;

But when determining whether to first zero-initialize the object,
expand_aggr_init_1 incorrectly considers the user-providedness of _all_
constructors rather than only that of the _default_ constructors.  This
causes us to skip the zero-initialization step when the class type has a
defaulted default constructor alongside a user-defined constructor.

It seems the predicate type_has_non_user_provided_default_constructor
accurately captures the above rule for when to first perform a
zero-initialization during value-initialization, so this patch adjusts
expand_aggr_init_1 to use this predicate instead.

	PR c++/65816

gcc/cp/ChangeLog:

	* init.c (expand_aggr_init_1): Check
	type_has_non_user_provided_default_constructor instead of
	type_has_user_provided_constructor.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/constexpr-delegating3.C: New test.
	* g++.dg/cpp0x/dc10.C: New test.
	* g++.dg/cpp0x/initlist-base4.C: New test.
	* g++.dg/cpp2a/constexpr-init22.C: New test.

libstdc++-v3/ChangeLog:

	* testsuite/23_containers/deque/allocator/default_init.cc,
	testsuite/23_containers/forward_list/allocator/default_init.cc,
	testsuite/23_containers/list/allocator/default_init.cc,
	testsuite/23_containers/map/allocator/default_init.cc,
	testsuite/23_containers/set/allocator/default_init.cc,
	testsuite/23_containers/vector/allocator/default_init.cc,
	testsuite/23_containers/vector/bool/allocator/default_init.cc:
	Remove xfail.
2021-06-01 16:21:10 -04:00
Andrew Pinski
9f55df6315 Replace conditional_replacement with match and simplify
This is the first of series of patches to simplify phi-opt
to use match and simplify in many cases.  This simplification
will more things to optimize.

This is what Richard requested in
https://gcc.gnu.org/pipermail/gcc-patches/2021-May/571197.html
and I think it is the right thing to do too.

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

gcc/ChangeLog:

	PR tree-optimization/25290
	* tree-ssa-phiopt.c (match_simplify_replacement):
	New function.
	(tree_ssa_phiopt_worker): Use match_simplify_replacement.
	(two_value_replacement): Change the comment about
	conditional_replacement.
	(conditional_replacement): Delete.
2021-06-01 18:50:32 +00:00
Andrew Pinski
ea418485c7 Fix PR 95481: tail call fails with empty struct types
The problem here is we don't have an assignment type any more
for empty structs as they were removed during gimplifcation.
This adds a special case where the assignment var does not exist
and the return decl is empty typed.

OK? Tested on aarch64-linux-gnu with no regressions.

Thanks,
Andrew Pinski

changes since v1:
v2: Use is_empty_type instead of zero-sized type.

gcc/ChangeLog:
	PR tree-optimization/95481
	* tree-tailcall.c (find_tail_calls): Handle empty typed
	return decls.

gcc/testsuite/ChangeLog:

	PR tree-optimization/95481
	* gcc.dg/tree-ssa/tailcall-10.c: New test.
	* gcc.dg/tree-ssa/tailcall-11.c: New test.
	* gcc.dg/tree-ssa/tailcall-12.c: New test.
	* gcc.dg/tree-ssa/tailcall-13.c: New test.
	* gcc.dg/tree-ssa/tailrecursion-8.c: New test.
2021-06-01 18:28:59 +00:00
Andrew Pinski
34aae6b561 Use is_empty_type instead of zero-sized type.
Instead of only removing assignments of zero-sized types,
assignments of all empty types should be removed during gimplification.
This moves to use is_empty_type which will be used in other places too.

OK?  Bootstrapped and tested on aarch64-linux-gnu with no regressions.

Thanks,
Andrew Pinski

gcc/ChangeLog:

	* gimplify.c (zero_sized_field_decl): Delete
	(zero_sized_type): Delete
	(gimplify_init_ctor_eval): Use is_empty_type instead
	of zero_sized_field_decl.
	(gimplify_modify_expr): Use is_empty_type instead of
	zero_sized_type.
2021-06-01 18:25:47 +00:00
Jonathan Wakely
833d348aec libstdc++: Fix effective target for new tests [PR 96088]
These tests use <string_view> so must not run for anything older than
C++17.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* testsuite/23_containers/unordered_map/96088.cc: Change
	effective target to c++17.
	* testsuite/23_containers/unordered_set/96088.cc: Likewise.
2021-06-01 19:09:27 +01:00
Jonathan Wakely
b514fce354 libstdc++: Fix new test for C++98 mode [PR 89728]
The isblank class is not supported until C++11.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* testsuite/22_locale/ctype/is/string/89728_neg.cc: Only test
	isblank for C++11 and later.
2021-06-01 19:02:42 +01:00
Bill Schmidt
250cf86735 PR100750: Require ELFv2 ABI for ROP test
2021-06-01  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/testsuite/
	PR testsuite/100750
	* gcc.target/powerpc/rop-5.c: Require ELFv2 ABI.
2021-06-01 11:11:03 -05:00
Jonathan Wakely
d832629169 libstdc++: Fix return value of std::ranges::advance [PR 100833]
The three-argument form of ranges::advance is supposed to return the
difference between the second argument and the distance the iterator was
advanced. When a non-random-access iterator is not advanced (because it
already equals the sentinel) we were returning 0 rather than n - 0.

libstdc++-v3/ChangeLog:

	PR libstdc++/100833
	* include/bits/ranges_base.h (ranges::advance(iter, n, sentinel)):
	Fix return value for no-op case.
	* testsuite/24_iterators/range_operations/advance.cc: Test
	return values of three-argument overload.
2021-06-01 17:09:06 +01:00
Jason Merrill
cf2b7020ee c++: no clobber for C++20 destroying delete [PR91859]
Before C++20 added destroying operator delete, by the time we called
operator delete for a pointer, the object would already be gone.  But that
isn't true for destroying delete.  Since the optimizers' assumptions about
operator delete are based on either DECL_IS_REPLACEABLE_OPERATOR (which
already is not set) or CALL_FROM_NEW_OR_DELETE_P, let's avoid setting the
latter flag in this case.

	PR c++/91859

gcc/ChangeLog:

	* tree.h (CALL_FROM_NEW_OR_DELETE_P): Adjust comment.

gcc/cp/ChangeLog:

	* call.c (build_op_delete_call): Don't set CALL_FROM_NEW_OR_DELETE_P
	for destroying delete.
	* init.c (build_delete): Don't clobber before destroying delete.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/destroying-delete5.C: New test.
2021-06-01 11:38:21 -04:00
Jason Merrill
620cd7861e c++: -Wdeprecated-copy and #pragma diagnostic [PR94492]
-Wdeprecated-copy was depending only on the state of the warning at the
point where we call the function, making it hard to use #pragma diagnostic
to suppress the warning for a particular implicitly declared function.

But checking whether the warning is enabled at the location of the implicit
declaration turned out to be a bit complicated; option_enabled only tests
whether it was enabled at the start of compilation, the actual test only
existed in the middle of diagnostic_report_diagnostic.  So this patch
factors it out and adds a new warning_enabled function to diagnostic.h.

gcc/ChangeLog:

	PR c++/94492
	* diagnostic.h (warning_enabled_at): Declare.
	* diagnostic.c (diagnostic_enabled): Factor out from...
	(diagnostic_report_diagnostic): ...here.
	(warning_enabled_at): New.

gcc/cp/ChangeLog:

	PR c++/94492
	* decl2.c (cp_warn_deprecated_use): Check warning_enabled_at.

gcc/testsuite/ChangeLog:

	PR c++/94492
	* g++.dg/cpp0x/depr-copy4.C: New test.
2021-06-01 11:35:47 -04:00
Aldy Hernandez
18b8841206 Revert patch that disabled exporting of global ranges.
Andrew's last set of changes fixes the bootstrap problem on i686 when
global ranges are exported from evrp.  The specific patch that fixes the
problem is 715914d3:

	Author: Andrew MacLeod <amacleod@redhat.com>
	Date:   Mon May 31 12:13:50 2021 -0400

	    Do not calculate new values when evaluating a debug statement.

	    Add a flag to enable/disable immediately improving poor values found during
	    cache propagation. Then disable it when processing debug statements.

This patch reverts commit 2364b58 now that exporting of global ranges works.

Tested on x86-64 Linux with default flags, and on i686 with the flags in
the PR: --enable-clocale=gnu --with-system-zlib --with-demangler-in-ld --with-fpmath=sse --enable-languages=c,c++ --enable-cet i686-linux --enable-bootstrap --with-fpmath=sse --disable-libcc1 --disable-libcilkrts --disable-libsanitizer

gcc/ChangeLog:

	* gimple-ssa-evrp.c: Enable exporting of global ranges.

gcc/testsuite/ChangeLog:

	* gcc.dg/Wstringop-overflow-55.c: Adjust for global ranges changes.
	* gcc.dg/pr80776-1.c: Same.
2021-06-01 16:59:30 +02:00
Martin Liska
b195d84561 Fix sanity checking of global_options.
gcc/c-family/ChangeLog:

	PR other/100759
	* c-attribs.c (handle_optimize_attribute): Limit sanity check
	to a situation where we are not in processing of an optimize
	pragma.
	* c-pragma.c (handle_pragma_pop_options): Restore target
	options.
2021-06-01 15:23:58 +02:00
Jonathan Wakely
9f7bc160b4 libstdc++: Fix installation of python hooks [PR 99453]
When no shared library is installed, the new code to determine the name
of the -gdb.py file yields an empty string. Use the name of the static
library in that case.

libstdc++-v3/ChangeLog:

	PR libstdc++/99453
	* python/Makefile.am: Use archive name for printer hook if no
	dynamic library name is available.
	* python/Makefile.in: Regenerate.
2021-06-01 13:29:34 +01:00
Martin Liska
fdbd0cb73a docs: Mention that -fgcse-after-reload is enabled with -O3.
gcc/ChangeLog:

	PR other/100826
	* doc/invoke.texi: Mention that -fgcse-after-reload
	is enabled with -O3.
2021-06-01 14:19:05 +02:00
Tobias Burnus
f6bf436d9a Fortran/OpenMP: Support (parallel) master taskloop (simd) [PR99928]
PR middle-end/99928

gcc/fortran/ChangeLog:

	* dump-parse-tree.c (show_omp_node, show_code_node): Handle
	(parallel) master taskloop (simd).
	* frontend-passes.c (gfc_code_walker): Set in_omp_workshare
	to false for parallel master taskloop (simd).
	* gfortran.h (enum gfc_statement):
	Add ST_OMP_(END_)(PARALLEL_)MASTER_TASKLOOP(_SIMD).
	(enum gfc_exec_op): EXEC_OMP_(PARALLEL_)MASTER_TASKLOOP(_SIMD).
	* match.h (gfc_match_omp_master_taskloop,
	gfc_match_omp_master_taskloop_simd,
	gfc_match_omp_parallel_master_taskloop,
	gfc_match_omp_parallel_master_taskloop_simd): New prototype.
	* openmp.c (gfc_match_omp_parallel_master_taskloop,
	gfc_match_omp_parallel_master_taskloop_simd,
	gfc_match_omp_master_taskloop,
	gfc_match_omp_master_taskloop_simd): New.
	(gfc_match_omp_taskloop_simd): Permit 'reduction' clause.
	(resolve_omp_clauses): Handle new combined directives; remove
	inscan-reduction check to reduce multiple errors; add
	task-reduction error for 'taskloop simd'.
	(gfc_resolve_omp_parallel_blocks,
	resolve_omp_do, omp_code_to_statement,
	gfc_resolve_omp_directive): Handle new combined constructs.
	* parse.c (decode_omp_directive, next_statement,
	gfc_ascii_statement, parse_omp_do, parse_omp_structured_block,
	parse_executable): Likewise.
	* resolve.c (gfc_resolve_blocks, gfc_resolve_code): Likewise.
	* st.c (gfc_free_statement): Likewise.
	* trans.c (trans_code): Likewise.
	* trans-openmp.c (gfc_split_omp_clauses,
	gfc_trans_omp_directive): Likewise.
	(gfc_trans_omp_parallel_master): Move after gfc_trans_omp_master_taskloop;
	handle parallel master taskloop (simd) as well.
	(gfc_trans_omp_taskloop): Take gfc_exec_op as arg.
	(gfc_trans_omp_master_taskloop): New.

gcc/testsuite/ChangeLog:

	* gfortran.dg/gomp/reduction5.f90: Remove dg-error; the issue is
	now diagnosed with less error output.
	* gfortran.dg/gomp/scan-1.f90: Likewise.
	* gfortran.dg/gomp/pr99928-3.f90: New test.
	* gfortran.dg/gomp/taskloop-1.f90: New test.
2021-06-01 12:47:57 +02:00
liuhongt
28daadc980 Extend is_cond_scalar_reduction to handle nop_expr after/before scalar reduction.[PR98365]
gcc/ChangeLog:

	PR tree-optimization/98365
	* tree-if-conv.c (strip_nop_cond_scalar_reduction): New function.
	(is_cond_scalar_reduction): Handle nop_expr in cond scalar reduction.
	(convert_scalar_cond_reduction): Ditto.
	(predicate_scalar_phi): Ditto.

gcc/testsuite/ChangeLog:

	PR tree-optimization/98365
	* gcc.target/i386/pr98365.c: New test.
2021-06-01 09:58:14 +08:00
Andrew MacLeod
715914d3f9 Do not calculate new values when evaluating a debug statement.
Add a flag to enable/disable immediately improving poor values found during
cache propagation. Then disable it when processing debug statements.

	gcc/
	PR tree-optimization/100781
	* gimple-range-cache.cc (ranger_cache::ranger_cache): Enable new
	value calculation by default.
	(ranger_cache::enable_new_values): New.
	(ranger_cache::disable_new_values): New.
	(ranger_cache::push_poor_value): Check if new values are allowed.
	* gimple-range-cache.h (class ranger_cache): New member/methods.
	* gimple-range.cc (gimple_ranger::range_of_expr): Check for debug
	statement, and disable/renable new value calculation.

	gcc/testsuite/
	PR tree-optimization/100781
	* gcc.dg/pr100781.c: New.
2021-05-31 20:51:18 -04:00
Andrew MacLeod
2e0f3246e0 Replace ssa_range_in_bb with entry exit and def range
Split the old functionality of ssa_name_in_bb into the components for
definition in a block, entry and exit range.  Call these as appropriate.

	* gimple-range-cache.cc (ranger_cache::ssa_range_in_bb): Delete.
	(ranger_cache::range_of_def): New.
	(ranger_cache::entry_range): New.
	(ranger_cache::exit_range): New.
	(ranger_cache::range_of_expr): Adjust.
	(ranger_cache::range_on_edge): Adjust.
	(ranger_cache::propagate_cache): Call exit_range directly.
	* gimple-range-cache.h (class ranger_cache): Adjust.
2021-05-31 20:49:40 -04:00
Andrew MacLeod
47ea02bb86 Move Ranger cache to range-query and fur_source model.
Flatten and simplify gori-computes. Tweak debug output.
range-cache now provides range_of_expr and range_on_edge in the
standard formats, but in a "query what you have" mode rather than
"go figure out anything that is missing" mode.

	* gimple-range-cache.cc (ranger_cache::ranger_cache): Adjust for
	gori_compute being a member rather than base class.
	dervied call to member call.
	(ranger_cache::dump): No longer dump gori_map.
	(ranger_cache::dump_bb): New.
	(ranger_cache::get_non_stale_global_range): Adjust for gori_compute
	being a member rather than base class.
	(ranger_cache::set_global_range): Ditto.
	(ranger_cache::ssa_range_in_bb): Ditto.
	(ranger_cache::range_of_expr): New.
	(ranger_cache::range_on_edge): New.
	(ranger_cache::block_range): Adjust for gori_computes.  Debug changes.
	(ranger_cache::propagate_cache):  Adjust debugging output.
	(ranger_cache::fill_block_cache): Adjust for gori_computes.  Debug
	output changes.
	* gimple-range-cache.h (class ranger_cache): Make gori_compute a
	member, and inherit from range_query instead.
	(ranger_cache::dump_bb): New. split from dump.
	* gimple-range-gori.cc (gori_compute::ssa_range_in_bb): Delete.
	(gori_compute::expr_range_at_stmt): Delete.
	(gori_compute::compute_name_range_op): Delete.
	(gori_compute::compute_operand_range_switch): Add fur_source.
	(gori_compute::compute_operand_range): Add fur_source param, inline
	old compute_name_range_op and optimize_logical_operands.
	(struct tf_range): Delete.
	(gori_compute::logical_combine): Adjust
	(gori_compute::optimize_logical_operands): Delete.
	(gori_compute::compute_logical_operands_in_chain): Delete.
	(gori_compute::compute_logical_operands): Adjust.
	(gori_compute::compute_operand1_range): Adjust to fur_source.
	(gori_compute::compute_operand2_range): Ditto.
	(gori_compute::compute_operand1_and_operand2_range): Ditto.
	(gori_compute::outgoing_edge_range_p): Add range_query parameter,
	and adjust to fur_source.
	* gimple-range-gori.h (class gori_compute): Simplify and adjust to
	range_query and fur_source.
	* gimple-range.cc (gimple_ranger::range_on_edge): Query range_on_edge
	from the ranger_cache..
	(gimple_ranger::fold_range_internal): Adjust to base class change of
	ranger_cache.
	(gimple_ranger::dump_bb): Adjust dump.
	* gimple-range.h (gimple_ranger):export gori computes object.
2021-05-31 20:49:39 -04:00
Andrew MacLeod
1ffbfc2659 Range invariant global values are also always current.
when a range evolves to the point where it becomes a constant, it is
marked as invariant.  Rather than marking it as always_current in the
timestamp, give it the correct timestamp and just never flag it as stale.
This will allow other names which use this value to become stale and be
recomputed using the newly invariant value.

	gcc/
	PR tree-optimization/100774
	* gimple-range-cache.cc (ranger_cache::get_non_stale_global_range):
	Constant values are also not stale.
	(ranger_cache::set_global_range): Range invariant values should also
	have the correct timestamp.

	gcc/testsuite
	PR tree-optimization/100774
	* g++.dg/pr100774.C: New.
2021-05-31 20:49:39 -04:00
GCC Administrator
ee68219275 Daily bump. 2021-06-01 00:16:37 +00:00
Indu Bhagat
a87efd3238 PR testsuite/100749 - gcc.dg/pch/valid-1.c fails after r12-949
Fix failing pch testcases. Use xstrdup to retain a reliable copy of the debug
format str containing the names (df_set_names is a static string var).

2021-05-31  Indu Bhagat  <indu.bhagat@oracle.com>

gcc/c-family/
	PR testsuite/100749
	* c-pch.c (c_common_valid_pch): Use xstrdup for debug format set names.
2021-05-31 09:19:38 -07:00
Indu Bhagat
bdf1a4026a MAINTAINERS: Add myself for write after approval
ChangeLog:

2021-05-31  Indu Bhagat  <indu.bhagat@oracle.com>

	* MAINTAINERS (Write After Approval): Add myself.
2021-05-31 08:37:06 -07:00
Tobias Burnus
9faaa091e5 gfortran.dg/gomp/depend-iterator-{1,2}.f90: Use dg-do compile
'dg-do run' is pointless -1 due to dg-error. And it won't work except
by chance for gomp tests; as -2 only has depend(out:), a 'dg-do compile'
is sufficient.

gcc/testsuite/ChangeLog:

	* gfortran.dg/gomp/depend-iterator-1.f90: Use dg-do compile.
	* gfortran.dg/gomp/depend-iterator-2.f90: Use dg-do compile.
2021-05-31 16:38:05 +02:00
Martin Liska
21d7bba242 LTO: stream properly FUNCTION_DECL_DECL_TYPE.
gcc/lto/ChangeLog:

	* lto-common.c (compare_tree_sccs_1): Compare
	FUNCTION_DECL_DECL_TYPE.

gcc/ChangeLog:

	* tree-streamer-in.c (unpack_ts_function_decl_value_fields):
	Unpack FUNCTION_DECL_DECL_TYPE.
	* tree-streamer-out.c (pack_ts_function_decl_value_fields):
	Stream FUNCTION_DECL_DECL_TYPE instead of
	DECL_IS_OPERATOR_NEW_P.
	* tree.h (set_function_decl_type): Use FUNCTION_DECL_DECL_TYPE
	macro.
	(DECL_IS_OPERATOR_NEW_P): Likewise.
	(DECL_IS_OPERATOR_DELETE_P): Likewise.
	(DECL_LAMBDA_FUNCTION_P): Likewise.
2021-05-31 11:25:37 +02:00
Richard Biener
ef8176e0fa c++/88601 - [C/C++] __builtin_shufflevector support
This adds support for the clang __builtin_shufflevector extension to
the C and C++ frontends.  The builtin is lowered to VEC_PERM_EXPR.
Because VEC_PERM_EXPR does not support different sized vector inputs
or result or the special permute index of -1 (don't-care)
c_build_shufflevector applies lowering by widening inputs and output
to the widest vector, replacing -1 by a defined index and
subsetting the final vector if we produced a wider result than
desired.

Code generation thus can be sub-optimal, followup patches will
aim to fix that by recovering from part of the missing features
during RTL expansion and by relaxing the constraints of the GIMPLE
IL with regard to VEC_PERM_EXPR.

2021-05-21  Richard Biener  <rguenther@suse.de>

	PR c++/88601
gcc/c-family/
	* c-common.c: Include tree-vector-builder.h and
	vec-perm-indices.h.
	(c_common_reswords): Add __builtin_shufflevector.
	(c_build_shufflevector): New funtion.
	* c-common.h (enum rid): Add RID_BUILTIN_SHUFFLEVECTOR.
	(c_build_shufflevector): Declare.

gcc/c/
	* c-decl.c (names_builtin_p): Handle RID_BUILTIN_SHUFFLEVECTOR.
	* c-parser.c (c_parser_postfix_expression): Likewise.

gcc/cp/
	* cp-objcp-common.c (names_builtin_p): Handle
	RID_BUILTIN_SHUFFLEVECTOR.
	* cp-tree.h (build_x_shufflevector): Declare.
	* parser.c (cp_parser_postfix_expression): Handle
	RID_BUILTIN_SHUFFLEVECTOR.
	* pt.c (tsubst_copy_and_build): Handle IFN_SHUFFLEVECTOR.
	* typeck.c (build_x_shufflevector): Build either a lowered
	VEC_PERM_EXPR or an unlowered shufflevector via a temporary
	internal function IFN_SHUFFLEVECTOR.

gcc/
	* internal-fn.c (expand_SHUFFLEVECTOR): Define.
	* internal-fn.def (SHUFFLEVECTOR): New.
	* internal-fn.h (expand_SHUFFLEVECTOR): Declare.
	* doc/extend.texi: Document __builtin_shufflevector.

gcc/testsuite/
	* c-c++-common/builtin-shufflevector-2.c: New testcase.
	* c-c++-common/torture/builtin-shufflevector-1.c: Likewise.
	* g++.dg/ext/builtin-shufflevector-1.C: Likewise.
	* g++.dg/ext/builtin-shufflevector-2.C: Likewise.
2021-05-31 08:46:04 +02:00
Peter Bergner
df4e0359da rs6000: MMA test case ICEs using -O3 [PR99842]
The mma_assemble_input_operand predicate does not accept reg+reg indexed
addresses which can lead to ICEs.  The lxv and lxvp instructions have
indexed forms (lxvx and lxvpx), so the simple solution is to just allow
indexed addresses in the predicate.

2021-05-30  Peter Bergner  <bergner@linux.ibm.com>

gcc/
	PR target/99842
	* config/rs6000/predicates.md(mma_assemble_input_operand): Allow
	indexed form addresses.

gcc/testsuite/
	PR target/99842
	* g++.target/powerpc/pr99842.C: New.
2021-05-30 22:45:55 -05:00
GCC Administrator
e21e934072 Daily bump. 2021-05-31 00:16:25 +00:00
Gerald Pfeifer
a0a7adeea3 libstdc++: Remove "Intel Compilers" bibliography entry
The original link redirects to a very generic page that advertises
lots of tools and other things, just not this.

libstdc++-v3/ChangeLog:

2021-05-31  Gerald Pfeifer  <gerald@pfeifer.com>

	* doc/xml/manual/abi.xml: Remove dead reference to "Intel
	Compilers for Linux: Compatibility with GNU Compilers" article.
	* doc/html/manual/abi.html: Regenerate.
2021-05-31 00:27:17 +02:00
Gerald Pfeifer
a8f588be03 Fortran: Fix typo in documentation of BOZ
gcc/fortran/ChangeLog:

2021-05-30  Gerald Pfeifer  <gerald@pfeifer.com>

	* gfortran.texi (BOZ literal constants): Fix typo.
2021-05-30 15:27:53 +02:00
GCC Administrator
1a87f83810 Daily bump. 2021-05-30 00:16:26 +00:00
Bernd Edlinger
ade5ac7c79 diagnostics: Fix sporadic test failure
it turns out to be reproducible this way:

COLUMNS=80 make check-gcc-c RUNTESTFLAGS="plugin.exp=diagnostic*"

Running /home/ed/gnu/gcc-trunk/gcc/testsuite/gcc.dg/plugin/plugin.exp ...
FAIL: gcc.dg/plugin/diagnostic-test-expressions-1.c
 -fplugin=./diagnostic_plugin_test_tree_expression_range.so  1 blank line(s) in output
FAIL: gcc.dg/plugin/diagnostic-test-expressions-1.c
 -fplugin=./diagnostic_plugin_test_tree_expression_range.so  expected multiline pattern lines 550-551 not found: "                            __builtin_types_compatible_p \(long, int\) \+ f \(i\)\);.*\n                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\^~~~~~~\n"
FAIL: gcc.dg/plugin/diagnostic-test-expressions-1.c
 -fplugin=./diagnostic_plugin_test_tree_expression_range.so (test for excess errors)

a lot more errors happen with COLUMNS=20.

2021-05-29  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* gcc.dg/plugin/diagnostic_plugin_show_trees.c (plugin_init): Fix caret_max_with.
	* gcc.dg/plugin/diagnostic_plugin_test_inlining.c
	(plugin_init): Likewise.
	* gcc.dg/plugin/diagnostic_plugin_test_paths.c (plugin_init): Likewise.
	* gcc.dg/plugin/diagnostic_plugin_test_string_literals.c
	(plugin_init): Likewise.
	* gcc.dg/plugin/diagnostic_plugin_test_tree_expression_range.c
	(plugin_init): Likewise.
2021-05-29 22:28:11 +02:00
Jeff Law
12bb62fbb4 [committed][PR bootstrap/100730] Fix warnings in H8 target files
gcc/

	* config/h8300/h8300.c (h8300_emit_stack_adjustment): Drop unused
	parameter.  Call callers fixed.
	(push): Likewise.
	(output_plussi): Add FALLTHRU markers.
	(h8300_shift_needs_scratch_p): Add gcc_unreachable marker.
2021-05-29 09:37:30 -06:00
Mike Frysinger
f14c9bd4dc sim: leverage gnulib
We use getline, so leverage gnulib to provide fallback implementation.

ChangeLog:

	* configure.ac: Add gnulib to configdirs for sim.
	* configure: Regenerate.
2021-05-29 10:59:54 -04:00
Jakub Jelinek
5d21c0cbda openmp: Add shared to parallel for linear on parallel master taskloop simd [PR99928]
I forgot to add default(none) and defaultmap(none) wherever possible on the
testcases to make sure none of the required clauses are added implicitly (because
in that case it doesn't work with these none arguments of those default* clauses
or works differently with other default* settings.

And that revealed we didn't add shared on parallel for linear clause
on parallel master taskloop simd, so this patch fixes that too.

2021-05-29  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/99928
	* gimplify.c (gimplify_scan_omp_clauses): For taskloop simd
	combined with parallel, make sure to add shared clause to
	parallel for explicit linear clause.

	* c-c++-common/gomp/pr99928-1.c: Add default(none) to constructs
	combined with parallel, teams or taskloop and defaultmap(none)
	to constructs combined with target.
	* c-c++-common/gomp/pr99928-2.c: Likewise.
	* c-c++-common/gomp/pr99928-3.c: Likewise.
	* c-c++-common/gomp/pr99928-4.c: Likewise.
	* c-c++-common/gomp/pr99928-5.c: Likewise.
	* c-c++-common/gomp/pr99928-6.c: Likewise.
	* c-c++-common/gomp/pr99928-7.c: Likewise.
	* c-c++-common/gomp/pr99928-8.c: Likewise.
	* c-c++-common/gomp/pr99928-9.c: Likewise.
	* c-c++-common/gomp/pr99928-10.c: Likewise.
	* c-c++-common/gomp/pr99928-13.c: Likewise.
	* c-c++-common/gomp/pr99928-14.c: Likewise.
2021-05-29 10:05:38 +02:00