Make sure they're all handled in 'execute_oacc_device_lower'. Why we at all
can have 'level == -1' cases is a separate bug to be fixed.
gcc/
PR middle-end/90115
* omp-offload.c (execute_oacc_device_lower)
<IFN_UNIQUE_OACC_PRIVATE>: Diagnose and handle for 'level == -1'
case, too.
* internal-fn.c (expand_UNIQUE): Don't expect
'IFN_UNIQUE_OACC_PRIVATE'.
This patch implements a method to track the "private-ness" of
OpenACC variables declared in offload regions in gang-partitioned,
worker-partitioned or vector-partitioned modes. Variables declared
implicitly in scoped blocks and those declared "private" on enclosing
directives (e.g. "acc parallel") are both handled. Variables that are
e.g. gang-private can then be adjusted so they reside in GPU shared
memory.
The reason for doing this is twofold: correct implementation of OpenACC
semantics, and optimisation, since shared memory might be faster than
the main memory on a GPU. Handling of private variables is intimately
tied to the execution model for gangs/workers/vectors implemented by
a particular target: for current targets, we use (or on mainline, will
soon use) a broadcasting/neutering scheme.
That is sufficient for code that e.g. sets a variable in worker-single
mode and expects to use the value in worker-partitioned mode. The
difficulty (semantics-wise) comes when the user wants to do something like
an atomic operation in worker-partitioned mode and expects a worker-single
(gang private) variable to be shared across each partitioned worker.
Forcing use of shared memory for such variables makes that work properly.
In terms of implementation, the parallelism level of a given loop is
not fixed until the oaccdevlow pass in the offload compiler, so the
patch delays fixing the parallelism level of variables declared on or
within such loops until the same point. This is done by adding a new
internal UNIQUE function (OACC_PRIVATE) that lists (the address of) each
private variable as an argument, and other arguments set so as to be able
to determine the correct parallelism level to use for the listed
variables. This new internal function fits into the existing scheme for
demarcating OpenACC loops, as described in comments in the patch.
Two new target hooks are introduced: TARGET_GOACC_ADJUST_PRIVATE_DECL and
TARGET_GOACC_EXPAND_VAR_DECL. The first can tweak a variable declaration
at oaccdevlow time, and the second at expand time. The first or both
of these target hooks can be used by a given offload target, depending
on its strategy for implementing private variables.
This patch updates the TARGET_GOACC_ADJUST_PRIVATE_DECL target hook in
the AMD GCN backend to the current name and prototype. (An earlier
version of the hook was already present, but dormant.)
gcc/
PR middle-end/90115
* doc/tm.texi.in (TARGET_GOACC_EXPAND_VAR_DECL)
(TARGET_GOACC_ADJUST_PRIVATE_DECL): Add documentation hooks.
* doc/tm.texi: Regenerate.
* expr.c (expand_expr_real_1): Expand decls using the
expand_var_decl OpenACC hook if defined.
* internal-fn.c (expand_UNIQUE): Handle IFN_UNIQUE_OACC_PRIVATE.
* internal-fn.h (IFN_UNIQUE_CODES): Add OACC_PRIVATE.
* omp-low.c (omp_context): Add oacc_privatization_candidates
field.
(lower_oacc_reductions): Add PRIVATE_MARKER parameter. Insert
before fork.
(lower_oacc_head_tail): Add PRIVATE_MARKER parameter. Modify
private marker's gimple call arguments, and pass it to
lower_oacc_reductions.
(oacc_privatization_scan_clause_chain)
(oacc_privatization_scan_decl_chain, lower_oacc_private_marker):
New functions.
(lower_omp_for, lower_omp_target, lower_omp_1): Use these.
* omp-offload.c (convert.h): Include.
(oacc_loop_xform_head_tail): Treat private-variable markers like
fork/join when transforming head/tail sequences.
(struct var_decl_rewrite_info): Add struct.
(oacc_rewrite_var_decl, is_sync_builtin_call): New functions.
(execute_oacc_device_lower): Support rewriting gang-private
variables using target hook, and fix up addr_expr and var_decl
nodes afterwards.
* target.def (adjust_private_decl, expand_var_decl): New hooks.
* config/gcn/gcn-protos.h (gcn_goacc_adjust_gangprivate_decl):
Rename to...
(gcn_goacc_adjust_private_decl): ...this.
* config/gcn/gcn-tree.c (gcn_goacc_adjust_gangprivate_decl):
Rename to...
(gcn_goacc_adjust_private_decl): ...this. Add LEVEL parameter.
* config/gcn/gcn.c (TARGET_GOACC_ADJUST_GANGPRIVATE_DECL): Rename
definition using gcn_goacc_adjust_gangprivate_decl...
(TARGET_GOACC_ADJUST_PRIVATE_DECL): ...to this, using
gcn_goacc_adjust_private_decl.
* config/nvptx/nvptx.c (tree-pretty-print.h): Include.
(gang_private_shared_size): New global variable.
(gang_private_shared_align): Likewise.
(gang_private_shared_sym): Likewise.
(gang_private_shared_hmap): Likewise.
(nvptx_option_override): Initialize these.
(nvptx_file_end): Output gang_private_shared_sym.
(nvptx_goacc_adjust_private_decl, nvptx_goacc_expand_var_decl):
New functions.
(nvptx_set_current_function): Clear gang_private_shared_hmap.
(TARGET_GOACC_ADJUST_PRIVATE_DECL): Define hook.
(TARGET_GOACC_EXPAND_VAR_DECL): Likewise.
libgomp/
PR middle-end/90115
* testsuite/libgomp.oacc-c-c++-common/private-atomic-1-gang.c: New
test.
* testsuite/libgomp.oacc-fortran/private-atomic-1-gang.f90:
Likewise.
* testsuite/libgomp.oacc-fortran/private-atomic-1-worker.f90:
Likewise.
Co-Authored-By: Chung-Lin Tang <cltang@codesourcery.com>
Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
It is only defined for i386 and everyone uses the default:
#define MAX_BITSIZE_MODE_ANY_INT (64*BITS_PER_UNIT)
Whatever problems we had before, they have been fixed now.
* config/i386/i386-modes.def (MAX_BITSIZE_MODE_ANY_INT): Removed.
Elide expand_constructor when the constructor is static storage and not
mostly zeros and we can move it by pieces prefer to do so since that's
usually more efficient than performing a series of stores from immediates.
2021-05-21 Richard Biener <rguenther@suse.de>
H.J. Lu <hjl.tools@gmail.com>
gcc/
PR middle-end/90773
* expr.c (expand_constructor): Elide expand_constructor if
move by pieces is preferred.
gcc/testsuite/
* gcc.target/i386/pr90773-24.c: New test.
* gcc.target/i386/pr90773-25.c: Likewise.
Besides the builtins in aarch64-simd-builtins.def there are a number of builtins defined in aarch64-builtins.c itself.
They could also benefit from the attributes generated by aarch64_get_attributes.
However aarch64_get_attributes and its helpers are only set up to handle a aarch64_simd_builtin_datum.
This patch changes these functions to instead take a flag and mode value that are extracted from
aarch64_simd_builtin_datum.flags and aarch64_simd_builtin_datum.mode anyway.
Then the various builtin init functions in aarch64-builtins.c can pass down their own FLAG_* flags
that they want to derive attributes from.
gcc/ChangeLog:
* config/aarch64/aarch64-builtins.c (aarch64_call_properties):
Take a flag and mode value as arguments.
(aarch64_modifies_global_state_p): Likewise.
(aarch64_reads_global_state_p): Likewise.
(aarch64_could_trap_p): Likewise.
(aarch64_get_attributes): Likewise.
(aarch64_init_simd_builtins): Adjust callsite of above.
(aarch64_init_fcmla_laneq_builtins): Use aarch64_get_attributes to get
function attributes to apply to builtins.
(aarch64_init_crc32_builtins): Likewise.
(aarch64_init_builtin_rsqrt): Likewise.
This adds new values for insn attr type for p10 fusion. The genfusion.pl
script is modified to use them, and fusion.md regenerated to capture
the new patterns. There are also some formatting only changes to
fusion.md that apparently weren't captured after a previous commit
of genfusion.pl.
gcc/
* config/rs6000/rs6000.md (define_attr "type"): Add types for fusion.
* config/rs6000/genfusion.pl (gen_ld_cmpi_p10): Use new fusion types.
(gen_2logical): Use new fusion types.
* config/rs6000/fusion.md: Regenerate.
Enforce comment from sinfo.ads about the Condition field in N_Raise_xxx_Error
nodes. Only an extra sanity check; the behaviour is not affected.
gcc/ada/
* gcc-interface/trans.c (Raise_Error_to_gnu): Add an assertion.
The Linux kernel has removed the interface to cyclades from
the latest kernel headers[1] due to them being orphaned for the
past 13 years.
libsanitizer uses this header when compiling against glibc, but
glibcs itself doesn't seem to have any references to cyclades.
Further more it seems that the driver is broken in the kernel and
the firmware doesn't seem to be available anymore.
As such since this is breaking the build of libsanitizer (and so the
GCC bootstrap[2]) I propose to remove this.
[1] https://lkml.org/lkml/2021/3/2/153
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379
(cherry picked from commit f7c5351552387bd43f6ca3631016d7f0dfe0f135)
libsanitizer/ChangeLog:
PR sanitizer/100379
* sanitizer_common/sanitizer_common_interceptors_ioctl.inc: Cherry-pick
llvm-project revision f7c5351552387bd43f6ca3631016d7f0dfe0f135.
* sanitizer_common/sanitizer_platform_limits_posix.cpp: Likewise.
* sanitizer_common/sanitizer_platform_limits_posix.h: Likewise.
gcc/ada/
* gcc-interface/utils.c (gnat_pushdecl): Fix typo in comment.
* gcc-interface/utils2.c (build_simple_component_ref): Build NULL_EXPR
if the offset of the field has overflowed.
(build_component_ref): Add gigi checking assertion that the reference
has been built and replace the discriminant check by a Program_Error.
This makes sure that debug info is generated for elaboration variables,
even if the variables are not generated exclusively for this purpose.
gcc/ada/
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Named_Integer>: Do
not pass default value in call to create_var_decl.
<E_Variable>: Likewise.
<E_Record_Subtype>: Both pass true for const_flag and false for
const_decl_allowed_p in call to create_var_decl.
Small tweaks in the generic record type case.
(elaborate_expression): Rename need_debug into need_for_debug and
adjust throughout.
(elaborate_expression_1): Likewise. Pass Needs_Debug_Info instead
of need_for_debug in call to create_var_decl.
(elaborate_expression_2): Likewise.
* gcc-interface/utils.c (maybe_pad_type): Pass false for
const_decl_allowed_p in call to create_var_decl.
The former has been deprecated in favor of the latter.
gcc/ada/
* gcc-interface/decl.c (gnat_to_gnu_entity): Replace ? with ??.
(gnat_to_gnu_param): Likewise.
(gnat_to_gnu_subprog_type): Likewise.
(warn_on_field_placement): Likewise.
(intrin_arglists_compatible_p): Likewise.
* gcc-interface/trans.c (Pragma_to_gnu): Likewise.
(gnat_to_gnu): Likewise.
(validate_unchecked_conversion): Likewise.
* gcc-interface/utils.c (maybe_pad_type): Likewise.
This is a regression present on the mainline, 11 and 10 branches,
in the form of an ICE on a locally derived bit-packed array type.
gcc/ada/
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Process
the implementation type of a packed type implemented specially.
gcc/testsuite/
* gnat.dg/derived_type7.adb, gnat.dg/derived_type7.ads: New test.
Gigi has historically translated the Is_Pure flag of the front-end into
the "const" attribute of GNU C. That's correct for subprograms of pure
Ada units, but not fully exact according to the semantics of the flag.
gcc/ada/
* gcc-interface/decl.c (gnat_to_gnu_subprog_type): Always translate
the Is_Pure flag into the "pure" attribute of GNU C.
This fixes a regression present on the mainline and 11 branch by
restricting the problematic change dealing with bitfields whose
nomimal subtype is self-referential to the cases where the size
is really lower.
gcc/ada/
* gcc-interface/trans.c (Call_to_gnu): Restrict previous change
to bitfields whose size is not equal to the type size.
(gnat_to_gnu): Likewise.
On Wed, May 19, 2021 at 01:30:31PM -0400, Jason Merrill via Gcc-patches wrote:
> Here, when genericizing lexicographical_compare_three_way, we haven't yet
> walked the operands, so (a == a) still sees ADDR_EXPR <a>, but this is after
> we've changed the type of a to REFERENCE_TYPE. When we try to fold (a == a)
> by constexpr evaluation, the constexpr code doesn't understand trying to
> take the address of a reference, and we end up crashing.
>
> Fixed by avoiding constexpr evaluation in genericize_spaceship, by using
> fold_build2 instead of build_new_op on scalar operands. Class operands
> should have been expanded during parsing.
Unfortunately this slightly changed the IL and spaceship_replacement no
longer pattern matches it.
Here are 3 improvements that make it match:
1) as mentioned in the comment above spaceship_replacement, for
strong_ordering, we are pattern matching something like:
x == y ? 0 : x < y ? -1 : 1;
and for partial_ordering
x == y ? 0 : x < y ? -1 : x > y ? 1 : 2;
but given the == comparison done first and the other comparisons only
if == was false, we actually don't care if the other comparisons
are < vs. <= (or > vs. >=), provided the operands of the comparison
are the same; we know == is false when doing those and < vs. <= or
> vs. >= have the same behavior for NaNs too
2) when y is an integral constant, we should treat x < 5 equivalently
to x <= 4 etc.
3) the code punted if cond2_phi_edge wasn't a EDGE_TRUE_VALUE edge, but
as the new IL shows, that isn't really needed; given 1) that
> and >= are equivalent in the code, any of swapping the comparison
operands, changing L[TE]_EXPR to G[TE]_EXPR or vice versa or
swapping the EDGE_TRUE_VALUE / EDGE_FALSE_VALUE bits on the edges
reverses one of the two comparisons
2021-05-21 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/94589
* tree-ssa-phiopt.c (spaceship_replacement): For integral rhs1 and
rhs2, treat x <= 4 equivalently to x < 5 etc. In cmp1 and cmp2 (if
not the same as cmp3) treat <= the same as < and >= the same as >.
Don't require that cond2_phi_edge is true edge, instead take
false/true edges into account based on cmp1/cmp2 comparison kinds.
We optimize the associated range check but nevertheless flag a violation.
gcc/ada/
* gcc-interface/trans.c (Call_to_gnu): Minor tweaks.
(gnat_to_gnu_external): Likewise.
(Raise_Error_to_gnu): Return an empty statement list if there is a
condition and it is always false.
(gnat_to_gnu): Do not check for elaboration code a priori during the
translation but a posteriori instead.
This puts the missing SLOC on a statement generated by a return.
gcc/ada/
* gcc-interface/trans.c (gnat_to_gnu) <N_Simple_Return_Statement>:
Put a SLOC on the assignment from the return value to the return
object in the copy-in/copy-out case.
...when the division is exact, typically dividing TYPE_SIZE by BITS_PER_UNIT.
gcc/ada/
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Replace
CEIL_DIV_EXPR with EXACT_DIV_EXPR.
* gcc-interface/misc.c (gnat_type_max_size): Likewise.
* gcc-interface/utils.c (maybe_pad_type): Likewise.
(finish_record_type): Likewise. And always compute the unit size.
2021-05-21 Uroš Bizjak <ubizjak@gmail.com>
gcc/
PR target/100637
* config/i386/mmx.md (SMAXMIN_MMXMODEI): New mode iterator.
(<smaxmin:code><SMAXMIN_MMXMODEI:mode>3): Macroize expander
from <smaxmin:code>v4hi3> and <smaxmin:code><MMXMODE14:mode>3
using SMAXMIN_MMXMODEI mode iterator.
(*<smaxmin:code>v4qi3): New insn pattern.
(*<smaxmin:code>v2hi3): Ditto.
(SMAXMIN_VI_32): New mode iterator.
(<smaxmin:code><SMAXMIN_VI_32>mode3): New expander.
(UMAXMIN_MMXMODEI): New mode iterator.
(<umaxmin:code><UMAXMIN_MMXMODEI:mode>3): Macroize expander
from <umaxmin:code>v8qi3> and <umaxmin:code><MMXMODE24:mode>3
using UMAXMIN_MMXMODEI mode iterator.
(*<umaxmin:code>v4qi3): New insn pattern.
(*<umaxmin:code>v2hi3): Ditto.
(UMAXMIN_VI_32): New mode iterator.
(<umaxmin:code><UMAXMIN_VI_32>mode3): New expander.
(abs<VI_32:mode>2): New insn pattern.
(ssse3_abs<MMXMODEI:mode>2, abs<MMXMODEI:mode>2): Move from ...
* config/i386/sse.md: ... here.
libstdc++-v3/ChangeLog:
PR libstdc++/100690
* include/std/ranges (iota_view::_Sentinel::_M_distance_from):
Split out this member function from ...
(iota_view::_Sentinel::operator-): ... here, for sake of access
control.
* testsuite/std/ranges/iota/iota_view.cc (test05): New test.
Rust places text files in archives. AIX ld ignores such files with a
warning. The collect2 wrapper for ld had been exiting with a fatal
error if it scanned an archive that contained a non-COFF file.
This patch updates collect2.c to issue a warning and ignore the file
member, matching the behavior of AIX ld. GCC can encounter archives
created by Rust and should not issue a fatal error. This changes
fatal_error to warning, with an implicit location and no associated
optimization flag.
gcc/ChangeLog:
2021-05-20 Clement Chigot <clement.chigot@atos.net>
David Edelsohn <dje.gcc@gmail.com>
* collect2.c (scan_prog_file): Issue non-fatal warning for
non-COFF files.
While looking at PR100489, it occurred to me that places that currently
use an initializer-list with a single element to initialize an object of the
same type shouldn't do that if the element has a designator.
gcc/cp/ChangeLog:
* call.c (reference_binding): Check for designator.
(implicit_conversion_1, build_special_member_call): Likewise.
* decl.c (reshape_init_r): Likewise.
* pt.c (do_class_deduction): Likewise.
* typeck2.c (digest_init_r): Likewise.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/desig19.C: New test.
My patch for PR98463 added an assert that tripped on this testcase, because
we ended up with a U CONSTRUCTOR with an initializer for a, which is not a
member of U. We need to wrap the a initializer in another CONSTRUCTOR for
the anonymous union.
There was already support for this in process_init_constructor_record, but
not in process_init_constructor_union. But since this is about brace
elision, it really belongs under reshape_init rather than digest_init, so
this patch moves the handling to reshape_init_class, which also handles
unions.
PR c++/100489
gcc/cp/ChangeLog:
* decl.c (reshape_init_class): Handle designator for
member of anonymous aggregate here.
* typeck2.c (process_init_constructor_record): Not here.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/desig18.C: New test.
The current implementation of compile-time precondition checks causes
compilation to fail by calling a non-constexpr function declared at
block scope. This breaks the CUDA compiler, which wraps some libstdc++
headers in a pragma that declares everything as a __host__ __device__
function, but others are not wrapped and so everything is a __host__
function. The local declaration thus gets redeclared as two different
types of function, which doesn't work.
Just use __builtin_unreachable to make constant evaluation fail, instead
of the local function declaration. Also simplify the assertion macros,
which has the side effect of giving simpler compilation errors when
using Clang.
libstdc++-v3/ChangeLog:
PR libstdc++/100676
* include/bits/c++config (__glibcxx_assert_1): Rename to ...
(__glibcxx_constexpr_assert): ... this.
(__glibcxx_assert_impl): Use __glibcxx_constexpr_assert.
(__glibcxx_assert): Define as either __glibcxx_constexpr_assert
or __glibcxx_assert_impl.
(__glibcxx_assert_2): Remove
* include/debug/macros.h (_GLIBCXX_DEBUG_VERIFY_AT_F): Use
__glibcxx_constexpr_assert instead of __glibcxx_assert_1.
* testsuite/21_strings/basic_string_view/element_access/char/back_constexpr_neg.cc:
Adjust expected error.
* testsuite/21_strings/basic_string_view/element_access/char/constexpr_neg.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/char/front_constexpr_neg.cc:
Likewise.
Likewise.
* testsuite/21_strings/basic_string_view/element_access/wchar_t/back_constexpr_neg.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/wchar_t/constexpr_neg.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/wchar_t/front_constexpr_neg.cc:
Likewise.
* testsuite/23_containers/span/back_neg.cc: Likewise.
* testsuite/23_containers/span/front_neg.cc: Likewise.
* testsuite/23_containers/span/index_op_neg.cc: Likewise.
This adds new warning flags, enabled by default: -Wc++11-extensions,
-Wc++14-extensions, -Wc++17-extensions, -Wc++20-extensions, and
-Wc++23-extensions. The names of the flags are copied from Clang, which
already has similar options.
No new diagnostics are added, but the new OPT_Wxxx variables are used to
control existing pedwarns about occurences of new C++ constructs in code
using an old C++ standard dialect. This allows several existing warnings
that cannot currently be disabled to be controlled by the appropriate
-Wno-xxx flag. For example, it will now be possible to disable warnings
about using variadic templates in C++98 code, by using the new
-Wno-c++11-extensions option. This will allow libstdc++ headers to
disable those warnings unconditionally by using diagnostic pragmas, so
that they are not emitted even if -Wsystem-headers is used.
Some of the affected diagnostics are currently only given when
-Wpedantic is used. Now that we have a more specific warning flag, we
could consider making them not depend on -Wpedantic, and only on the new
flag. This patch does not do that, as it intends to make no changes to
what is accepted/rejected by default. The only effect should be that
the new option is shown when -fdiagnostics-show-option is active, and
that some warnings can be disabled by using the new flags (and for the
warnings that previously only dependend on -Wpedantic, it will now be
possible to disable just those warnings while still using -Wpedantic for
its other benefits).
gcc/c-family/ChangeLog:
* c.opt (Wc++11-extensions, Wc++14-extensions)
(Wc++17-extensions, Wc++20-extensions, Wc++23-extensions): New
options.
gcc/cp/ChangeLog:
* call.c (maybe_warn_array_conv): Use new warning option.
* decl.c (mark_inline_variable, grokdeclarator): Likewise.
* error.c (maybe_warn_cpp0x): Likewise.
* parser.c (cp_parser_primary_expression)
(cp_parser_unqualified_id)
(cp_parser_pseudo_destructor_name)
(cp_parser_lambda_introducer)
(cp_parser_lambda_declarator_opt)
(cp_parser_selection_statement)
(cp_parser_init_statement)
(cp_parser_decomposition_declaration)
(cp_parser_function_specifier_opt)
(cp_parser_static_assert)
(cp_parser_namespace_definition)
(cp_parser_using_declaration)
(cp_parser_asm_definition)
(cp_parser_ctor_initializer_opt_and_function_body)
(cp_parser_initializer_list)
(cp_parser_type_parameter_key)
(cp_parser_member_declaration)
(cp_parser_try_block)
(cp_parser_std_attribute_spec): Likewise.
* pt.c (check_template_variable): Likewise.
gcc/ChangeLog:
* doc/invoke.texi (-Wno-c++11-extensions)
(-Wno-c++14-extensions, -Wno-c++17-extensions)
(-Wno-c++20-extensions, -Wno-c++23-extensions): Document
new options.
To support multiple debug formats, we need to move away from explicit
enumeration of each individual combination of debug formats.
gcc/c-family/ChangeLog:
* c-opts.c (c_common_post_options): Adjust access to debug_type_names.
* c-pch.c (struct c_pch_validity): Use type uint32_t.
(pch_init): Renamed member.
(c_common_valid_pch): Adjust access to debug_type_names.
gcc/ChangeLog:
* common.opt: Change type to support bitmasks.
* flag-types.h (enum debug_info_type): Rename enumerator constants.
(NO_DEBUG): New bitmask.
(DBX_DEBUG): Likewise.
(DWARF2_DEBUG): Likewise.
(XCOFF_DEBUG): Likewise.
(VMS_DEBUG): Likewise.
(VMS_AND_DWARF2_DEBUG): Likewise.
* flags.h (debug_set_to_format): New function declaration.
(debug_set_count): Likewise.
(debug_set_names): Likewise.
* opts.c (debug_type_masks): Array of bitmasks for debug formats.
(debug_set_to_format): New function definition.
(debug_set_count): Likewise.
(debug_set_names): Likewise.
(set_debug_level): Update access to debug_type_names.
* toplev.c: Likewise.
gcc/objc/ChangeLog:
* objc-act.c (synth_module_prologue): Use uint32_t instead of enum
debug_info_type.
gcc/testsuite/ChangeLog:
* gcc.dg/pch/valid-1.c: Adjust diagnostic message in testcase.
* lib/dg-pch.exp: Adjust diagnostic message.
Adjust the line number due to previous commit,
which added a line for dg-require-effective-target.
2021-05-20 Bernd Edlinger <bernd.edlinger@hotmail.de>
* g++.dg/modules/omp-1_c.C: Fix testcase.
This implements the P0896R4 changes to reverse_iterator's member types
value_type, difference_type and reference in C++20 mode, which fixes
taking the reverse_iterator of an iterator with a non-integral
difference_type (such as iota_view<long long>).
libstdc++-v3/ChangeLog:
PR libstdc++/100639
* include/bits/stl_iterator.h (reverse_iterator::difference_type):
In C++20 mode, define in terms of iter_difference_t as per P0896R4.
(reverse_iterator::reference): Likewise, but with iter_reference_t.
(reverse_iterator::value_type): Likewise, but with iter_value_t.
* testsuite/std/ranges/adaptors/reverse.cc (test08): New test.
* testsuite/24_iterators/reverse_iterator/100639.cc: New test.
gcc/fortran/ChangeLog:
* openmp.c (gfc_match_omp_clauses): Support map-type-modifier 'close'.
gcc/testsuite/ChangeLog:
* gfortran.dg/gomp/map-6.f90: New test.
* gfortran.dg/gomp/map-7.f90: New test.
* gfortran.dg/gomp/map-8.f90: New test.
This patch conditionally disables the compilation of floating_to_chars.cc
on 16 bit targets, thus fixing a build failure for these targets as
the POW10_SPLIT_2 array exceeds the maximum object size.
libstdc++-v3/
PR libstdc++/100361
* include/std/charconv (to_chars): Hide the overloads for
floating-point types for 16 bit targets.
* src/c++17/floating_to_chars.cc: Don't compile for 16 bit targets.
* testsuite/20_util/to_chars/double.cc: Run this test only on
size32plus targets.
* testsuite/20_util/to_chars/float.cc: Likewise.
* testsuite/20_util/to_chars/long_double.cc: Likewise.
Commit r12-939 missed to add the required include files for
the newly used type loop_vec_info. This patch is to add
the include file "tree-vectorizer.h" which defines
loop_vec_info and its required include file "cfgloop.h".
gcc/ChangeLog:
* config/arm/arm.c: Include head files tree-vectorizer.h and
cfgloop.h.
2021-05-20 Uroš Bizjak <ubizjak@gmail.com>
gcc/
PR target/100637
* config/i386/mmx.md (Yv_Yw): Revert adding V4QI and V2HI modes.
(*<plusminus:insn><VI_32:mode>3): Use Yw instad of <Yv_Yw> constrint.
(<s>mulv4hi3_highpart): New expander.
(*<s>mulv2hi3_highpart): New insn pattern.
(<s>mulv2hi3_higpart): New expander.
(*<any_shift:insn>v2hi3): New insn pattern.
(<any_shift:insn>v2hi3): New expander.
* config/i386/sse.md (smulhrsv2hi3): New expander.
(*smulhrsv2hi3): New insn pattern.
gcc/testsuite/
PR target/100637
* gcc.target/i386/pr100637-1w.c (shl, ashr, lshr): New tests.
This patch is to replace the current hardcoded weight factor
50, which is applied by the loop vectorizer to the cost of
statements in an inner loop relative to the loop being
vectorized, with one newly added member inner_loop_cost_factor
in loop vinfo. It also introduces one parameter
vect-inner-loop-cost-factor whose default value is 50, and
is used to initialize the inner_loop_cost_factor member.
The motivation here is that: if targets want to have one
unique function to gather some information in each add_stmt_cost
call, no matter that it's put before or after the cost tweaking
part for inner loop, it may have the need to adjust (expand or
shrink) the gathered data as the factor. Now the factor is
hardcoded, it's not easily maintained.
Bootstrapped/regtested on powerpc64le-linux-gnu P9,
x86_64-redhat-linux and aarch64-linux-gnu.
gcc/ChangeLog:
* doc/invoke.texi (vect-inner-loop-cost-factor): Document new
parameter.
* params.opt (vect-inner-loop-cost-factor): New.
* targhooks.c (default_add_stmt_cost): Replace hardcoded factor
50 with LOOP_VINFO_INNER_LOOP_COST_FACTOR, include head file
tree-vectorizer.h and its required ones.
* config/aarch64/aarch64.c (aarch64_add_stmt_cost): Replace
hardcoded factor 50 with LOOP_VINFO_INNER_LOOP_COST_FACTOR.
* config/arm/arm.c (arm_add_stmt_cost): Likewise.
* config/i386/i386.c (ix86_add_stmt_cost): Likewise.
* config/rs6000/rs6000.c (rs6000_add_stmt_cost): Likewise.
* tree-vect-loop.c (vect_compute_single_scalar_iteration_cost):
Likewise.
(_loop_vec_info::_loop_vec_info): Init inner_loop_cost_factor.
* tree-vectorizer.h (_loop_vec_info): Add inner_loop_cost_factor.
(LOOP_VINFO_INNER_LOOP_COST_FACTOR): New macro.
The toolchain provided by ST for stm32 has had support for
__FILENAME__ for a while, but clang/llvm has recently implemented
support for __FILE_NAME__, so it seems better to use the same macro
name in GCC.
It happens that the ST patch is similar to the one proposed in PR
c/42579.
Given these input files:
::::::::::::::
mydir/myinc.h
::::::::::::::
char* mystringh_file = __FILE__;
char* mystringh_filename = __FILE_NAME__;
char* mystringh_base_file = __BASE_FILE__;
::::::::::::::
mydir/mysrc.c
::::::::::::::
char* mystring_file = __FILE__;
char* mystring_filename = __FILE_NAME__;
char* mystring_base_file = __BASE_FILE__;
we produce:
$ gcc mydir/mysrc.c -I . -E
char* mystringh_file = "./mydir/myinc.h";
char* mystringh_filename = "myinc.h";
char* mystringh_base_file = "mydir/mysrc.c";
char* mystring_file = "mydir/mysrc.c";
char* mystring_filename = "mysrc.c";
char* mystring_base_file = "mydir/mysrc.c";
2021-05-20 Christophe Lyon <christophe.lyon@linaro.org>
Torbjörn Svensson <torbjorn.svensson@st.com>
PR c/42579
libcpp/
* include/cpplib.h (cpp_builtin_type): Add BT_FILE_NAME entry.
* init.c (builtin_array): Likewise.
* macro.c (_cpp_builtin_macro_text): Add support for BT_FILE_NAME.
gcc/
* doc/cpp.texi (Common Predefined Macros): Document __FILE_NAME__.
gcc/testsuite/
* c-c++-common/spellcheck-reserved.c: Add tests for __FILE_NAME__.
* c-c++-common/cpp/file-name-1.c: New test.
gcc/testsuite/ChangeLog:
PR fortran/96983
* gfortran.dg/pr96711.f90: Use 2**digit(x) instead of a hard-coded value;
add comments regarding what the code does.
linear clause should have the effect of firstprivate+lastprivate (or for IVs
not declared in the construct lastprivate) on outer constructs and eventually
map(tofrom:) on target when combined with it.
2021-05-20 Jakub Jelinek <jakub@redhat.com>
PR middle-end/99928
* gimplify.c (gimplify_scan_omp_clauses) <case OMP_CLAUSE_LINEAR>: For
explicit linear clause when combined with target, make it map(tofrom:)
instead of no clause or firstprivate.
* c-c++-common/gomp/pr99928-4.c: Remove all xfails.
* c-c++-common/gomp/pr99928-5.c: Likewise.