For X'Access, the designated subtype of the access type must statically
match the nominal subtype of X. This patch fixes a bug where the error
was not detected when there is an unrelated declaration of the form "Y :
T := X;", where T is an unconstrained array subtype.
gcc/ada/
* exp_util.adb (Expand_Subtype_From_Expr): Generate a new
subtype when Is_Constr_Subt_For_UN_Aliased is True, so the
Is_Constr_Subt_For_U_Nominal flag will not be set on the
preexisting subtype.
* sem_attr.adb, sem_ch3.adb: Minor.
It was only used in specific cases for controlled types but no longer
provides any significant benefit in practice.
gcc/ada/
* debug.adb (d.9): Remove usage.
* exp_ch6.adb (Expand_Simple_Function_Return): Remove redundant
test on Debug_Flag_Dot_L.
(Is_Build_In_Place_Result_Type): Return false for nonlimited types.
(Is_Build_In_Place_Function): Tidy up and remove redundant test on
Debug_Flag_Dot_L.
This changes the compiler to build in place almost all objects that need
finalization and are initialized with the result of a function call, thus
saving a pair of Adjust/Finalize calls for the anonymous return object.
gcc/ada/
* exp_ch3.adb (Expand_N_Object_Declaration): Don't adjust the object
if the expression is a function call.
<Rewrite_As_Renaming>: Return true if the object needs finalization
and is initialized with the result of a function call returned on
the secondary stack.
* exp_ch6.adb (Expand_Ctrl_Function_Call): Add Use_Sec_Stack boolean
parameter. Early return if the parent is an object declaration and
Use_Sec_Stack is false.
(Expand_Call_Helper): Adjust call to Expand_Ctrl_Function_Call.
* exp_ch7.adb (Find_Last_Init): Be prepared for initialization still
present in the object declaration.
* sem_ch3.adb (Analyze_Object_Declaration): Call the predicates
Needs_Secondary_Stack and Needs_Finalization to guard the renaming
optimization.
This patch adds the new Generic_Keys.Key function to the set children
of Ada.Containers.
gcc/ada/
* libgnat/a-cbhase.ads, libgnat/a-cborse.ads,
libgnat/a-cihase.ads, libgnat/a-ciorse.ads,
libgnat/a-cohase.ads, libgnat/a-coorse.ads (Key): New function
that takes a Container parameter, implemented as an expression
function, so it is self explanatory (doesn't need a comment).
In some cases when a legal allocator which defines a new subtype for the
allocated object occurs as part of a record component constraint
expression, the compiler would incorrectly reject the allocator.
gcc/ada/
* sem_ch4.adb (Analyze_Allocator): After calling Insert_Action
to insert a subtype declaration associated with an allocator,
the subtype declaration will usually be analyzed. But not
always. Add an explicit call to Preanalyze to cope with the
unusual case. The subtype declaration must be at least
preanalyzed before the call to Sem_Ch3.Process_Subtype a little
while later, during which we analyze an identifier that refers
to the subtype.
The -gnatwc switch enables warnings for test condition outcomes that are
known at compile time. Such warnings are unlikely to be useful in the
case of an assertion expression (or a subexpression thereof), so do not
generate them in that case.
gcc/ada/
* sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not
generate a warning if the expression in question is an assertion
expression, or a subexpression thereof. But do call
Test_Comparison so that it can generate warnings for the cases
that it generates warnings for.
* sem_prag.ads: Modify Assertion_Expression_Pragma constant so
that the predicate Sem_Util.In_Assertion_Expression_Pragma
returns True for the expression of a Compile_Time_Error pragma.
Modify the RM to take into account the new functional container.
gcc/ada/
* doc/gnat_rm/the_gnat_library.rst: Add the new entry.
* gnat_rm.texi: Regenerate.
When the code responsible for giving errors on ambiguous operands of
comparison and equality operators was moved from the 1st phase (analysis)
to the 2nd phase (resolution) of semantic processing, it was incorrectly
restricted to the operator case, which was valid during the 1st phase but
is not during the 2nd phase.
gcc/ada/
* sem_res.adb (Resolve_Comparison_Op): Deal with ambiguous operands
in all cases.
(Resolve_Equality_Op): Likewise, except for the case of the implicit
inequality operator created for a user-defined operator that is not
an intrinsic subprogram.
This patch adds some Ada 2022 features to the set children of
Ada.Containers.
gcc/ada/
* libgnat/a-cbhase.adb, libgnat/a-cbhase.ads,
libgnat/a-cborse.adb, libgnat/a-cborse.ads,
libgnat/a-cihase.adb, libgnat/a-cihase.ads,
libgnat/a-ciorse.adb, libgnat/a-ciorse.ads,
libgnat/a-cohase.adb, libgnat/a-cohase.ads,
libgnat/a-conhel.adb, libgnat/a-conhel.ads,
libgnat/a-coorse.adb, libgnat/a-coorse.ads: Add Has_Element,
Element, Query_Element, and Next subprograms that take a Set
parameter. Add Tampering_With_Cursors_Prohibited function. These
are all new in Ada 2022.
Functional containers are now controlled. Update the documentation
accordingly.
gcc/ada/
* doc/gnat_rm/the_gnat_library.rst: Functional vectors, sets,
and maps are now controlled.
* gnat_rm.texi: Regenerate.
All assertion pragmas are enabled by default when using -gnata. We need
to add the GNAT specific ones to the list.
gcc/ada/
* doc/gnat_ugn/building_executable_programs_with_gnat.rst
(Debugging and Assertion Control): Add GNAT specific assertion
pragmas to the equivalent Assertion_Policy for the -gnata
option.
* gnat_ugn.texi: Regenerate.
This patch corrects an error in the compiler whereby the presence of a
call to a function returning a type with an access discriminant within
an expanded loop condition caused the wrong value to be supplied for the
extra- accessibility-of-result actual, thus causing incorrect checks
within the callee at the point of return.
This change also corrects a problem where spurious "null value not
allowed" warnings were generated for tagged type declarations with an
access discriminant specified as "null."
gcc/ada/
* sem_disp.adb (Most_Descendant_Use_Clause): Remove call to
deprecated Is_Internal.
* sem_util.adb (Innermost_Master_Scope_Depth): Use
Find_Enclosing_Scope instead of Nearest_Dynamic_Scope to avoid
cases where relevant scopes get skipped leading to an incorrect
scope depth calculation.
When the result type of a function requiring built-in-place return is
only visible through a limited_with clause, the compiled needs to wait
for the nonlimited view to be available in order to compute whether
the built-in-place return is needed, and this comprises tagging the
function with the Returns_By_Ref flag.
gcc/ada/
* exp_ch6.adb (Build_In_Place_Formal): Also compute Returns_By_Ref
for the function if the extra formals were not built initially.
When resolving the Iterable aspect we look for a functions that are
declared in the same scope as the annotated type and that have the
required number and types formal parameters. However, we didn't guard
against functions that have no formal parameter at all.
gcc/ada/
* sem_ch13.adb (Resolve_Iterable_Operation): Add guard to
prevent crash when the examined function has no formal
parameters and Etype is called on Empty entity.
Add a new unbounded functional sequence. This sequence is indexed by
Big_Positive and so is unbounded from the user and spark points view.
Hower the actually implemented sequence are bounded by Count_Type'Last.
gcc/ada/
* libgnat/a-cfinse.adb, libgnat/a-cfinse.ads: Implementation
files of the sequence.
* Makefile.rtl, impunit.adb: Take into account the add of the
new files
The current wording can be read as implying that the result of a call
to a pure function does not depend on the context, which is incorrect.
The pragma only guarantees the absence of side effects of such a call.
gcc/ada/
* doc/gnat_rm/implementation_defined_pragmas.rst (Pure_Function):
Fix ambiguous wording about context dependence.
* gnat_rm.texi: Regenerate.
When autopar uses graphites canonicalize_loop_closed_ssa it fails to
check whether propagation is allowed and thus it ends up messing up
abnormal constraints.
2022-07-01 Richard Biener <rguenther@suse.de>
PR tree-optimization/106055
* graphite.cc (canonicalize_loop_closed_ssa): Check whether
we can propagate.
* gcc.dg/graphite/pr106055.c: New testcase.
1. Add a predicate for constant vectors which can be converted to integer
constants suitable for constant integer stores. For a 8-byte constant
vector, the converted 64-bit integer must be valid for store with 64-bit
immediate, which is a 64-bit integer sign-extended from a 32-bit integer.
2. Add a new pattern to allow 2-byte, 4-byte and 8-byte constant vector
stores, like
(set (mem:V2HI (reg:DI 84))
(const_vector:V2HI [(const_int 0 [0]) (const_int 1 [0x1])]))
3. After reload, convert constant vector stores to constant integer
stores, like
(set (mem:SI (reg:DI 5 di [84]))
(const_int 65536 [0x10000]))
For
void
foo (short * c)
{
c[0] = 0;
c[1] = 1;
}
it generates
movl $65536, (%rdi)
instead of
movl .LC0(%rip), %eax
movl %eax, (%rdi)
gcc/
PR target/106022
* config/i386/i386-protos.h (ix86_convert_const_vector_to_integer):
New.
* config/i386/i386.cc (ix86_convert_const_vector_to_integer):
New.
* config/i386/mmx.md (V_16_32_64): New.
(*mov<mode>_imm): New patterns for stores with 16-bit, 32-bit
and 64-bit constant vector.
* config/i386/predicates.md (x86_64_const_vector_operand): New.
gcc/testsuite/
PR target/106022
* gcc.target/i386/pr106022-1.c: New test.
* gcc.target/i386/pr106022-2.c: Likewise.
* gcc.target/i386/pr106022-3.c: Likewise.
* gcc.target/i386/pr106022-4.c: Likewise.
Now that vrange_storage is in its own file, I think it's prudent to
move all the vrange allocator code there since it's all related.
The users of value-range.h do not need to know the implementation
details of the storage facilities.
Tested and benchmarked on x86-64 Linux.
gcc/ChangeLog:
* gimple-range-cache.cc: Include value-range-storage.h.
* gimple-range-cache.h (class block_range_cache): Add "class" to
m_range_allocator.
* gimple-range-edge.cc
(gimple_outgoing_range::gimple_outgoing_range): Allocate allocator.
(gimple_outgoing_range::~gimple_outgoing_range): Free allocator.
(gimple_outgoing_range::calc_switch_ranges): Dereference allocator.
* gimple-range-edge.h: Add "class" to m_range_allocator.
* gimple-range-infer.cc
(infer_range_manager::infer_range_manager): Allocate allocator.
(infer_range_manager::~infer_range_manager): Free allocator.
(infer_range_manager::get_nonzero): Dereference allocator.
(infer_range_manager::add_range): Same.
* gimple-range-infer.h (class vrange_allocator): Add "class" to
m_range_allocator.
* value-range-storage.h (class vrange_allocator): Move from
value-range.h.
(class obstack_vrange_allocator): Same.
(class ggc_vrange_allocator): Same.
(vrange_allocator::alloc_vrange): Same.
(vrange_allocator::alloc_irange): Same.
* value-range.h (class vrange_allocator): Move to value-range-storage.h.
(class obstack_vrange_allocator): Same.
(class ggc_vrange_allocator): Same.
This patch implements a storage class that will be used to stream out
ranges to long term storage, initially in SSA_NAME_RANGE_INFO, but it
is flexible enough to use with our obstack allocator. For instance,
in the future we could use it in the ranger cache to save memory.
The current size of range_info_def which is used in
SSA_NAME_RANGE_INFO is 16 bytes. With this patch, the size of the
slot (irange_storage_slot) will be 24 bytes. But we'll have the
ability to be able to store up to 5 pairs of sub-ranges if necessary.
If we ever need to save more (say for switches), we could explore a
trailing_wide_ints structure with a pointer to the m_len[N] bits as
Jakub has suggested.
In follow-up patches I will contribute the SSA_NAME_RANGE_INFO changes
as well as changes storing the nonzero bits within an irange.
For reference, the main interface is rather simple:
class vrange_storage
{
public:
vrange_storage (vrange_allocator *alloc) : m_alloc (alloc) { }
void *alloc_slot (const vrange &r);
void free (void *slot);
void get_vrange (const void *slot, vrange &r, tree type);
void set_vrange (void *slot, const vrange &r);
static bool fits_p (const void *slot, const vrange &r);
};
The above class will have the knowledge to stream out the different
ranges we support (currently only irange_storage_slot). As has been
discussed, the irange storage will use trailing wide ints:
class GTY ((variable_size)) irange_storage_slot
{
<snip>
<snip>
// This is the maximum number of wide_int's allowed in the trailing
// ints structure, without going over 16 bytes (128 bits) in the
// control word that preceeds the HOST_WIDE_INTs in
// trailing_wide_ints::m_val[].
static const unsigned MAX_INTS = 12;
// Maximum number of range pairs we can handle, considering the
// nonzero bits take one wide_int.
static const unsigned MAX_PAIRS = (MAX_INTS - 1) / 2;
trailing_wide_ints<MAX_INTS> m_ints;
};
Tested on x86-64 Linux.
gcc/ChangeLog:
* Makefile.in (OBJS): Add value-range-storage.o.
(GTFILES): Add value-range-storage.h.
* gengtype.cc (open_base_files): Add value-range-storage.h.
* value-range-storage.cc: New file.
* value-range-storage.h: New file.
Integer division by zero is undefined behavior anyway, and there are
already many platforms where neither the GCC port and the hardware do
anything to trap on division by zero. So any portable program shall not
rely on SIGFPE on division by zero, in both theory and practice. As the
result, there is no real reason to cost two additional instructions just
for the trap on division by zero with a new ISA.
One remaining reason to trap on division by zero may be debugging,
especially while -fsanitize=integer-divide-by-zero is not implemented
for LoongArch yet. To make debugging easier, keep -mcheck-zero-division
as the default for -O0 and -Og, but use -mno-check-zero-division as the
default for all other optimization levels.
Co-authored-by: Lulu Cheng <chenglulu@loongson.cn>
gcc/ChangeLog:
* config/loongarch/loongarch.cc (loongarch_check_zero_div_p):
New static function.
(loongarch_idiv_insns): Use loongarch_check_zero_div_p instead
of TARGET_CHECK_ZERO_DIV.
(loongarch_output_division): Likewise.
* common/config/loongarch/loongarch-common.cc
(TARGET_DEFAULT_TARGET_FLAGS): Remove unneeded hook.
* doc/invoke.texi: Update to match the new behavior.
gcc/testsuite/ChangeLog:
* gcc.c-torture/execute/20101011-1.c (dg-additional-options):
add -mcheck-zero-division for LoongArch targets.
The patch changes the types inside the tests for the allocation size
checker to fixed-width types of stdint.h to account for different
architectures with different type widths.
2022-07-03 Tim Lange <mail@tim-lange.me>
gcc/testsuite/ChangeLog:
* gcc.dg/analyzer/allocation-size-1.c: Use fixed-length types.
* gcc.dg/analyzer/allocation-size-2.c: Likewise.
* gcc.dg/analyzer/allocation-size-3.c: Likewise.
* gcc.dg/analyzer/allocation-size-4.c: Likewise.
* gcc.dg/analyzer/allocation-size-5.c: Likewise.
gcc/ChangeLog:
* tree-ssa-dse.cc (dse_optimize_stmt): Only delete a trapping
statement if -fdelete-dead-exceptions.
gcc/testsuite/ChangeLog:
* g++.dg/torture/except-1.C: New test.
This patch adds an checker that warns about code paths in which a buffer
is assigned to a incompatible type, i.e. when the allocated buffer size
is not a multiple of the pointee's size.
Regression-tested on x86_64 Linux. Also compiled coreutils, curl, openssh and
httpd with the patch enabled.
2022-07-01 Tim Lange <mail@tim-lange.me>
gcc/analyzer/ChangeLog:
PR analyzer/105900
* analyzer.opt: Added Wanalyzer-allocation-size.
* checker-path.cc (region_creation_event::get_desc): Added call to new
virtual function pending_diagnostic::describe_region_creation_event.
* checker-path.h: Added region_creation_event::get_desc.
* diagnostic-manager.cc (diagnostic_manager::add_event_on_final_node):
New function.
* diagnostic-manager.h:
Added diagnostic_manager::add_event_on_final_node.
* pending-diagnostic.h (struct region_creation): New event_desc struct.
(pending_diagnostic::describe_region_creation_event): Added virtual
function to overwrite description of a region creation.
* region-model.cc (class dubious_allocation_size): New class.
(capacity_compatible_with_type): New helper function.
(class size_visitor): New class.
(struct_or_union_with_inheritance_p): New helper function.
(is_any_cast_p): New helper function.
(region_model::check_region_size): New function.
(region_model::set_value): Added call to
region_model::check_region_size.
* region-model.h (class region_model): New function check_region_size.
* svalue.cc (region_svalue::accept): Changed to post-order traversal.
(initial_svalue::accept): Likewise.
(unaryop_svalue::accept): Likewise.
(binop_svalue::accept): Likewise.
(sub_svalue::accept): Likewise.
(repeated_svalue::accept): Likewise.
(bits_within_svalue::accept): Likewise.
(widening_svalue::accept): Likewise.
(unmergeable_svalue::accept): Likewise.
(compound_svalue::accept): Likewise.
(conjured_svalue::accept): Likewise.
(asm_output_svalue::accept): Likewise.
(const_fn_result_svalue::accept): Likewise.
gcc/ChangeLog:
PR analyzer/105900
* doc/invoke.texi: Added Wanalyzer-allocation-size.
gcc/testsuite/ChangeLog:
PR analyzer/105900
* gcc.dg/analyzer/pr96639.c: Changed buffer size to omit warning.
* gcc.dg/analyzer/allocation-size-1.c: New test.
* gcc.dg/analyzer/allocation-size-2.c: New test.
* gcc.dg/analyzer/allocation-size-3.c: New test.
* gcc.dg/analyzer/allocation-size-4.c: New test.
* gcc.dg/analyzer/allocation-size-5.c: New test.
Signed-off-by: Tim Lange <mail@tim-lange.me>
This patch adds a new state machine to the analyzer for checking usage of POSIX file descriptor
APIs with five new warnings.
It adds:
- check for FD leaks (CWE 775).
- check for double "close" of a FD (CWE-1341).
- check for read/write of a closed file descriptor.
- check whether a file descriptor was used without being checked for validity.
- check for read/write of a descriptor opened for just writing/reading.
gcc/ChangeLog:
PR analyzer/106003
* Makefile.in (ANALYZER_OBJS): Add sm-fd.o.
* doc/invoke.texi: Add -Wanalyzer-fd-double-close, -Wanalyzer-fd-leak,
-Wanalyzer-fd-access-mode-mismatch, -Wanalyzer-fd-use-without-check,
-Wanalyzer-fd-use-after-close.
gcc/analyzer/ChangeLog:
PR analyzer/106003
* analyzer.opt (Wanalyzer-fd-leak): New option.
(Wanalyzer-fd-access-mode-mismatch): New option.
(Wanalyzer-fd-use-without-check): New option.
(Wanalyzer-fd-double-close): New option.
(Wanalyzer-fd-use-after-close): New option.
* sm.h (make_fd_state_machine): New decl.
* sm.cc (make_checkers): Call make_fd_state_machine.
* sm-fd.cc: New file.
gcc/testsuite/ChangeLog:
PR analyzer/106003
* gcc.dg/analyzer/fd-1.c: New test.
* gcc.dg/analyzer/fd-2.c: New test.
* gcc.dg/analyzer/fd-3.c: New test.
* gcc.dg/analyzer/fd-4.c: New test.
Use the correct initialization order for
var a = c
var b, c = x.(bool)
The global c is initialized by the preinit of b, but were missing a
dependency of c on b, so a would be initialized to the zero value of c
rather than the correct value.
Simply adding the dependency of c on b didn't work because the preinit
of b refers to c, so that appeared circular. So this patch changes
the init order to skip dependencies that only appear on the left hand
side of assignments in preinit blocks.
Doing that didn't work because the write barrier pass can transform "a
= b" into code like "gcWriteBarrier(&a, b)" that is not obviously a
simple assigment. So this patch moves the collection of dependencies
to just after lowering, before the write barriers are inserted.
Making those changes permit relaxing the requirement that we don't
warn about self-dependency in preinit blocks, so now we correctly warn
for
var a, b any = b.(bool)
The test case is https://go.dev/cl/415238.
Fixesgolang/go#53619
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/415594
Currently global ranges are stored in SSA_NAME_RANGE_INFO as a pair of
wide_int-like objects along with the nonzero bits. We frequently lose
precision when streaming out our higher resolution iranges. The plan
was always to store the full irange between passes. However, as was
originally discussed eons ago:
https://gcc.gnu.org/pipermail/gcc-patches/2017-May/475139.html
...we need a memory efficient way of saving iranges, preferably using
the trailing_wide_ints idiom.
The problem with doing so is that trailing_wide_ints assume a
compile-time specified number of elements. For irange, we need to
determine the size at run-time.
One solution is to adapt trailing_wide_ints such that N is the maximum
number of elements allowed, and allow setting the actual number at
run-time (defaulting to N). The attached patch does this, while
requiring no changes to existing users.
It uses a byte to store the number of elements in the
trailing_wide_ints control word. The control word is currently a
16-bit precision, an 8-bit max-length, and the rest is used for
m_len[N]. On a 64-bit architecture, this allows for 5 elements in
m_len without having to use an extra word. With this patch, m_len[]
would be smaller by one byte (4) before consuming the padding. This
shouldn't be a problem as the only users of trailing_wide_ints use N=2
for NUM_POLY_INT_COEFFS in aarch64, and N=3 for range_info_def.
For irange, my plan is to use one more word to fit a maximum of 12
elements (the above 4 plus 8 more). This would allow for 6 pairs of
sub-ranges which would be more than adequate for our needs. In
previous tests we found that 99% of ranges fit within 3-4 pairs. More
precisely, this would allow for 5 pairs, plus the nonzero bits, plus a
spare wide-int for future development.
Ultimately this means that streaming an irange would consume one more
word than what we currently do for range_info_def. IMO this is a nice
trade-off considering we started storing a slew of wide-ints directly
;-).
Tested and benchmarked on x86-64 Linux. There was no discernible
performance change in our benchmark suite.
gcc/ChangeLog:
* wide-int.h (struct trailing_wide_ints): Add m_num_elements.
(trailing_wide_ints::set_precision): Add num_elements argument.
(trailing_wide_ints::extra_size): Same.
The ${host_builddir}/largefile-config.h header can't be written until
its parent directory has been created, so it needs to have the creation
of that directory as a prerequisite.
libstdc++-v3/ChangeLog:
PR libstdc++/106162
* include/Makefile.am (largefile-config.h): Add
stamp-${host_alias} prerequisite.
* include/Makefile.in: Regenerate.
The code to determine whether a given token starts a module directive is
currently repeated in 4 places in parser.cc. I am about to submit a patch
that needs to add it in a 5th place, so since the code is not completely
trivial (needing to check for 3 different token types), it seems worthwhile
to factor this logic into its own function.
gcc/cp/ChangeLog:
* parser.cc (cp_token_is_module_directive): New function
refactoring common code.
(cp_parser_skip_to_closing_parenthesis_1): Use the new function.
(cp_parser_skip_to_end_of_statement): Likewise.
(cp_parser_skip_to_end_of_block_or_statement): Likewise.
(cp_parser_declaration): Likewise.
In this problem, we are failing to properly perform copy elision with
a conditional operator, so this:
constexpr A a = true ? A{} : A{};
fails with:
error: 'A{((const A*)(&<anonymous>))}' is not a constant expression
The whole initializer is
TARGET_EXPR <D.2395, 1 ? TARGET_EXPR <D.2393, {.p=(const struct A *) &<PLACEHOLDER_EXPR struct A>}> : TARGET_EXPR <D.2394, {.p=(const struct A *) &<PLACEHOLDER_EXPR struct A>}>>
where the outermost TARGET_EXPR is elided, but not the nested ones.
Then we end up replacing the PLACEHOLDER_EXPRs with the temporaries the
TARGET_EXPRs represent, which is precisely what should *not* happen with
copy elision.
I've tried the approach of tweaking ctx->object, but I ran into gazillion
problems with that. I thought that I would let cxx_eval_constant_expression
/TARGET_EXPR create a new object only when ctx->object was null, then
adjust setting of ctx->object in places like cxx_bind_parameters_in_call
and cxx_eval_component_reference but that failed completely. Sometimes
ctx->object has to be reset, sometimes it cannot be reset, 'this' needed
special handling, etc. I gave up.
Instead, this patch strips TARGET_EXPRs from the operands of ?: like
we do in various other places in constexpr.c.
PR c++/105550
gcc/cp/ChangeLog:
* constexpr.cc (cxx_eval_conditional_expression): Strip TARGET_EXPRs.
gcc/testsuite/ChangeLog:
* g++.dg/cpp1y/nsdmi-aggr16.C: Remove FIXME.
* g++.dg/cpp1y/nsdmi-aggr17.C: Remove FIXME.
* g++.dg/cpp0x/constexpr-elision1.C: New test.
* g++.dg/cpp1y/constexpr-elision1.C: New test.
In 5.2, a map clause can be map-entering or map-exiting,
either containing 'tofrom'. The main reason for this is
permit 'map(x)' with 'omp target enter/exit data',
avoiding to specify 'to:/from:' explicitly. (OpenMP
defaults to 'tofrom'.)
gcc/c/ChangeLog:
* c-parser.cc (c_parser_omp_target_enter_data,
c_parser_omp_target_exit_data): Accept tofrom
map-type modifier but use 'to' / 'from' internally.
gcc/cp/ChangeLog:
* parser.cc (cp_parser_omp_target_enter_data,
cp_parser_omp_target_exit_data): Accept tofrom
map-type modifier but use 'to' / 'from' internally.
gcc/fortran/ChangeLog:
* dump-parse-tree.cc (show_omp_namelist): For the map-type,
also handle the always modifer and release/delete.
* openmp.cc (resolve_omp_clauses): Accept tofrom
map-type modifier for target enter/exit data,
but use 'to' / 'from' internally.
libgomp/ChangeLog:
* libgomp.texi (OpenMP 5.2): Mark target enter/exit data
with fromto as implemented.
gcc/testsuite/ChangeLog:
* c-c++-common/gomp/target-data-2.c: New test.
* c-c++-common/gomp/target-data-3.c: New test.
* gfortran.dg/gomp/target-data-1.f90: New test.
* gfortran.dg/gomp/target-data-2.f90: New test.
ANDN is non-destructive, so use "r" instead of "0" for its operand 1 constraint.
2022-07-01 Uroš Bizjak <ubizjak@gmail.com>
gcc/ChangeLog:
* config/i386/i386.md (*andn<mode>3_doubleword_bmi):
Use "r" constraint for operand 1.
In C++03, -Wc++11-compat should warn about
int constexpr;
since 'constexpr' is a keyword in C++11. Jonathan reports that
we don't emit a similar warning for 'alignas' or 'alignof', and,
as I found out, 'thread_local'.
Similarly, we don't warn for most C++20 keywords. That happens
because RID_LAST_CXX20 hasn't been updated in a while.
PR c++/106111
gcc/c-family/ChangeLog:
* c-common.h (enum rid): Update RID_LAST_CXX20.
gcc/cp/ChangeLog:
* parser.cc (cp_lexer_get_preprocessor_token): Also warn about
RID_ALIGNOF, RID_ALIGNAS, RID_THREAD.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/keywords1.C: New test.
* g++.dg/cpp2a/keywords1.C: New test.
I experimented with giving this diagnostic in another place, which didn't
work out, but we can still benefit from adding the fixup.
gcc/cp/ChangeLog:
* parser.cc (missing_template_diag): Split out...
(cp_parser_id_expression): ...from here.
We were wrongly looking up the generic lambda op() in a dependent scope, and
then trying to look up its instantiation at substitution time, but lambdas
aren't instantiated, so we crashed. The fix is to not look into dependent
class scopes.
But this created trouble with wrongly trying to use a template from the
enclosing scope when we aren't actually looking at a template-argument-list,
in template/lookup18.C, so let's avoid that.
PR c++/106024
gcc/cp/ChangeLog:
* parser.cc (missing_template_diag): Factor out...
(cp_parser_id_expression): ...from here.
(cp_parser_lookup_name): Don't look in dependent object_type.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/lambda-generic10.C: New test.
The following avoids copying and using blocks_to_update to
the interesting_blocks sbitmap when doing update_ssa as it is
unused besides the redundant query in the domwalk.
* tree-into-ssa.cc (rewrite_update_dom_walker::before_dom_children):
Do not look at interesting_blocks which is a copy of
blocks_to_update.
(update_ssa): Do not initialize it.
(pass_build_ssa::execute): Set interesting_blocks to NULL
after releasing it.
This reverts the change as discussed.
2022-07-01 Richard Biener <rguenther@suse.de>
* tree-ssa-sccvn.cc (vn_reference_lookup_3): Revert
back to using maybe_ne (off, -1).
VN has checking code with gcc_unreachable (), the following makes
it cheaper by instead guarding the side-effect with flag_checking.
2022-07-01 Richard Biener <rguenther@suse.de>
* tree-ssa-sccvn.cc (vn_nary_op_insert_into): Make
checking dominance check conditional on flag_checking.