Commit Graph

171114 Commits

Author SHA1 Message Date
Richard Biener 7a15b5060a Update ChangeLog and version files for release 2022-05-27 07:21:31 +00:00
Richard Biener 859eddcc06 Revert "libcpp: Fix up ##__VA_OPT__ handling [PR89971]"
This reverts commit 86b98701bf.
2022-05-27 08:49:47 +02:00
GCC Administrator f0d57d62b1 Daily bump. 2022-05-27 00:19:33 +00:00
GCC Administrator e6053d8646 Daily bump. 2022-05-26 00:20:02 +00:00
GCC Administrator a077c54d64 Daily bump. 2022-05-25 00:20:15 +00:00
GCC Administrator 2fd19bfef3 Daily bump. 2022-05-24 00:20:20 +00:00
GCC Administrator 29771c39b9 Daily bump. 2022-05-23 00:19:55 +00:00
GCC Administrator 8b8264d07b Daily bump. 2022-05-22 00:20:06 +00:00
GCC Administrator eef95e6c28 Daily bump. 2022-05-21 00:19:58 +00:00
GCC Administrator 1bc79c5062 Daily bump. 2022-05-20 00:20:02 +00:00
GCC Administrator 94a436f094 Daily bump. 2022-05-19 00:19:34 +00:00
GCC Administrator d3f2045a9c Daily bump. 2022-05-18 00:20:07 +00:00
GCC Administrator ae2fd75182 Daily bump. 2022-05-17 00:19:41 +00:00
Harald Anlauf a9717558aa Fortran: fix error recovery on invalid array section
gcc/fortran/ChangeLog:

	PR fortran/105230
	* expr.c (find_array_section): Correct logic to avoid NULL
	pointer dereference on invalid array section.

gcc/testsuite/ChangeLog:

	PR fortran/105230
	* gfortran.dg/pr105230.f90: New test.

Co-authored-by: Steven G. Kargl <kargl@gcc.gnu.org>
(cherry picked from commit 0acdbe29f6)
2022-05-16 21:53:54 +02:00
Harald Anlauf 6b8cd1fb40 Fortran: improve error recovery on invalid array section
gcc/fortran/ChangeLog:

	PR fortran/104849
	* expr.c (find_array_section): Avoid NULL pointer dereference on
	invalid array section.

gcc/testsuite/ChangeLog:

	PR fortran/104849
	* gfortran.dg/pr104849.f90: New test.

(cherry picked from commit 22015e77d3)
2022-05-16 21:53:50 +02:00
Harald Anlauf f43db17894 Fortran: a RECURSIVE procedure cannot be an INTRINSIC
gcc/fortran/ChangeLog:

	PR fortran/105138
	* intrinsic.c (gfc_is_intrinsic): When a symbol refers to a
	RECURSIVE procedure, it cannot be an INTRINSIC.

gcc/testsuite/ChangeLog:

	PR fortran/105138
	* gfortran.dg/recursive_reference_3.f90: New test.

Co-authored-by: Steven G. Kargl <kargl@gcc.gnu.org>
(cherry picked from commit d46685b040)
2022-05-16 21:50:59 +02:00
Jonathan Wakely 882739c259 libstdc++: Fix status docs for <bit> support
libstdc++-v3/ChangeLog:

	* doc/html/manual/status.html: Regenerate.
	* doc/xml/manual/status_cxx2020.xml: Fix supported version for
	C++20 bit operations and power-of-two operations.

(cherry picked from commit 64648821f1)
2022-05-16 15:26:34 +01:00
Sebastian Pop 407adcb310 [AArch64] add barriers to ool __sync builtins
2022-05-13  Sebastian Pop  <spop@amazon.com>

gcc/
	PR target/105162
	* config/aarch64/aarch64-protos.h (atomic_ool_names): Increase dimension
	of str array.
	* config/aarch64/aarch64.c (aarch64_atomic_ool_func): Call
	memmodel_from_int and handle MEMMODEL_SYNC_*.
	(DEF0): Add __aarch64_*_sync functions.

gcc/testsuite/
	PR target/105162
	* gcc.target/aarch64/sync-comp-swap-ool.c: New.
	* gcc.target/aarch64/sync-op-acquire-ool.c: New.
	* gcc.target/aarch64/sync-op-full-ool.c: New.
	* gcc.target/aarch64/target_attr_20.c: Update check.
	* gcc.target/aarch64/target_attr_21.c: Same.

libgcc/
	PR target/105162
	* config/aarch64/lse.S: Define BARRIER and handle memory MODEL 5.
	* config/aarch64/t-lse: Add a 5th memory model for _sync functions.
2022-05-16 12:57:37 +00:00
GCC Administrator c076ae572e Daily bump. 2022-05-16 00:20:02 +00:00
GCC Administrator acb0efcbfe Daily bump. 2022-05-15 00:19:51 +00:00
GCC Administrator acfab383ec Daily bump. 2022-05-14 00:21:05 +00:00
Jason Merrill 5b98dd6703 c++: static memfn from non-dependent base [PR101078]
After my patch for PR91706, or before that with the qualified call,
tsubst_baselink returned a BASELINK with BASELINK_BINFO indicating a base of
a still-dependent derived class.  We need to look up the relevant base binfo
in the substituted class.

	PR c++/101078

gcc/cp/ChangeLog:

	* pt.c (tsubst_baselink): Update binfos in non-dependent case.

gcc/testsuite/ChangeLog:

	* g++.dg/template/access39.C: New test.
2022-05-13 15:53:55 -04:00
Jason Merrill 950a97a503 c++: extern template and static data member [PR99066]
'extern template' should mean that the relevant symbols are never emitted.
But in this case we were assuming that DECL_EXTERNAL was already set on the
variable, so we just needed to clear DECL_NOT_REALLY_EXTERN.  Since
DECL_EXTERNAL was not set, we emitted a definition of npos.

gcc/cp/ChangeLog:

	PR c++/99066
	* pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.

gcc/testsuite/ChangeLog:

	PR c++/99066
	* g++.dg/cpp0x/extern_template-6.C: New test.
2022-05-13 14:05:20 -04:00
Jason Merrill 200d477d3c 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
	PR c++/105265

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.
	* g++.dg/cpp0x/initlist-new6.C: New test.
2022-05-13 14:02:01 -04:00
Jason Merrill da999d938e c++: NRV in lambda in template [PR91217]
tsubst_lambda_expr was producing a function with two blocks that claimed to
be the outermost block in the function body, one from the call to
start_lambda_function in tsubst_lambda_expr, and one from tsubsting the
block added by start_lambda_function when we first parsed the lambda.  This
messed with the named return value optimization, which only works for
variables in the outermost block.

gcc/cp/ChangeLog:

	PR c++/91217
	* pt.c (tsubst_lambda_expr): Skip the body block from
	DECL_SAVED_TREE.

gcc/testsuite/ChangeLog:

	PR c++/91217
	* g++.dg/opt/nrv20.C: New test.
2022-05-13 13:39:31 -04:00
Jason Merrill 4231a43fd4 c++: array new initialized from a call [PR99643]
Here the get_foo() call results in a TARGET_EXPR, which we strip in
massage_init_elt, but then when build_vec_init tries to use it to initialize
the array element we crash because build_aggr_init expects a class rvalue to
have a TARGET_EXPR.  So don't strip it.

The stripping was added in r206639 for PR59659, so I checked that removing
it didn't significantly increase compile time or memory usage for that
testcase; compile time was unaffected, memory usage increased by 0.00004%.

gcc/cp/ChangeLog:

	PR c++/99643
	* typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.

gcc/testsuite/ChangeLog:

	PR c++/99643
	* g++.dg/cpp0x/initlist-new5.C: New test.
2022-05-13 13:39:31 -04:00
Jason Merrill 2a9658132c c++: alignment of local typedef in template [PR65211]
Because common_handle_aligned_attribute only applies the alignment to the
TREE_TYPE of a typedef, not the DECL_ORIGINAL_TYPE, we need to copy it
explicitly in tsubst.

	PR c++/65211

gcc/cp/ChangeLog:

	* pt.c (tsubst_decl) [TYPE_DECL]: Copy TYPE_ALIGN.

gcc/testsuite/ChangeLog:

	* g++.target/i386/vec-tmpl1.C: New test.
2022-05-13 13:39:31 -04:00
Jason Merrill de0b78d1e7 c++: template conversion op [PR101698]
Asking for conversion to a dependent type also makes a BASELINK dependent.

	PR c++/101698

gcc/cp/ChangeLog:

	* pt.c (tsubst_baselink): Also check dependent optype.

gcc/testsuite/ChangeLog:

	* g++.dg/template/conv19.C: New test.
2022-05-13 13:39:31 -04:00
Jason Merrill 48b8d5e028 c++: NRV and ref-extended temps [PR101442]
This issue goes back to r83221, where the cleanup for extended ref temps
changed from being unconditional to being tied to the declaration they
formed part of the initializer for.

The named return value optimization changes the cleanup for the NRV variable
to only run on the EH path; we don't want that change to affect temporary
cleanups.  The perform_member_init change isn't necessary (there 'decl' is a
COMPONENT_REF), it's just for consistency.

	PR c++/101442

gcc/cp/ChangeLog:

	* decl.c (cp_finish_decl): Don't pass decl to push_cleanup.
	* init.c (perform_member_init): Likewise.
	* semantics.c (push_cleanup): Adjust comment.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/initlist-nrv1.C: New test.
2022-05-13 13:39:31 -04:00
Jason Merrill 86d50501e4 c++: operator new lookup [PR98249]
The standard says, as we quote in the comment just above, that if we don't
find operator new in the allocated type, it should be looked up in the
global scope.  This is specifically ::, not just any namespace, and we
already give an error for an operator new declared in any other namespace.

	PR c++/98249

gcc/cp/ChangeLog:

	* call.c (build_operator_new_call): Just look in ::.

gcc/testsuite/ChangeLog:

	* g++.dg/lookup/new3.C: New test.
2022-05-13 13:39:30 -04:00
Jason Merrill 7b4bd8dbd8 c++: constexpr trivial -fno-elide-ctors [PR104646]
The constexpr constructor checking code got confused by the expansion of a
trivial copy constructor; we don't need to do that checking for defaulted
ctors, anyway.

	PR c++/104646

gcc/cp/ChangeLog:

	* constexpr.c (maybe_save_constexpr_fundef): Don't do extra
	checks for defaulted ctors.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/constexpr-fno-elide-ctors1.C: New test.
2022-05-13 13:39:30 -04:00
Jason Merrill 3daf541e8f c++: assignment to temporary [PR59950]
Given build_this of a TARGET_EXPR, cp_build_fold_indirect_ref returns the
TARGET_EXPR.  But that's the wrong value category for the result of the
defaulted class assignment operator, which returns an lvalue, so we need to
actually build the INDIRECT_REF.

	PR c++/59950

gcc/cp/ChangeLog:

	* call.c (build_over_call): Use cp_build_indirect_ref.

gcc/testsuite/ChangeLog:

	* g++.dg/init/assign2.C: New test.
2022-05-13 13:39:30 -04:00
Jason Merrill 623842bead c++: C++17 constexpr static data member linkage [PR99901]
C++17 makes constexpr static data members implicitly inline variables.  In
C++14, a subsequent out-of-class declaration is the definition.  We want to
continue emitting a symbol for such a declaration in C++17 mode, for ABI
compatibility with C++14 code that wants to refer to it.

Normally I'd distinguish in- and out-of-class declarations by looking at
DECL_IN_AGGR_P, but we never set DECL_IN_AGGR_P on inline variables.  I
think that's wrong, but don't want to mess with it so close to release.
Conveniently, we already have a test for in-class declaration earlier in the
function.

gcc/cp/ChangeLog:

	PR c++/99901
	* decl.c (cp_finish_decl): mark_needed an implicitly inline
	static data member with an out-of-class redeclaration.

gcc/testsuite/ChangeLog:

	PR c++/99901
	* g++.dg/cpp1z/inline-var9.C: New test.
2022-05-13 13:39:30 -04:00
Jason Merrill 7ce3d2ab2a c++: nested generic lambda in DMI [PR101717]
We were already checking COMPLETE_TYPE_P to recognize instantiation of a
generic lambda, but didn't consider that we might be nested in a non-generic
lambda.

	PR c++/101717

gcc/cp/ChangeLog:

	* lambda.c (lambda_expr_this_capture): Check all enclosing
	lambdas for completeness.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp1y/lambda-generic-this4.C: New test.
2022-05-13 13:39:30 -04:00
Jason Merrill 45fb36bf93 c++: PMF template parm and noexcept [PR90664]
The constexpr code only wants to preserve PTRMEM_CST in conversions if the
conversions are only qualification conversions; dropping noexcept counts as
a qualification adjustment in overload resolution, so let's include it here.

gcc/cp/ChangeLog:

	PR c++/90664
	* cvt.c (can_convert_qual): Check fnptr_conv_p.

gcc/testsuite/ChangeLog:

	PR c++/90664
	* g++.dg/cpp1z/noexcept-type24.C: New test.
2022-05-13 13:39:30 -04:00
Jason Merrill cf475f6e23 c++: lambda in DMI in class template [PR95870]
Here enclosing_instantiation_of was failing to find a match because otctx is
struct S<T> and current_function_decl is S<int>::S(), so the latter has more
function contexts, and we end up trying to compare S() to NULL_TREE.

After spending a bit of time working on establishing the correspondence in
this case (class <=> constructor), it occurred to me that we could just use
DECL_SOURCE_LOCATION, which is unique for lambdas, since they cannot be
redeclared.  Since we're so close to release, for now I'm only doing this
for the case that was failing before.

gcc/cp/ChangeLog:

	PR c++/95870
	* pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION if
	there is no enclosing non-lambda function.

gcc/testsuite/ChangeLog:

	PR c++/95870
	* g++.dg/cpp0x/lambda/lambda-nsdmi10.C: New test.
2022-05-13 13:39:30 -04:00
Jason Merrill aa3e2a2119 c++: -Wunused, constant, and generic lambda [PR96311]
We never called mark_use for a return value in a function with dependent
return type.  In that situation we don't know if the use is as an rvalue or
lvalue, but we can use mark_exp_read instead.

gcc/cp/ChangeLog:

	PR c++/96311
	* typeck.c (check_return_expr): Call mark_exp_read in dependent
	case.

gcc/testsuite/ChangeLog:

	PR c++/96311
	* g++.dg/cpp1y/lambda-generic-Wunused.C: New test.
2022-05-13 13:39:30 -04:00
Jason Merrill e0cc2713a4 c++: access checking in aggregate initialization [PR96673]
We were deferring access checks while parsing B<int>{}, didn't adjust that
when we went to instantiate the default member initializer for B::c,
deferred access checking for C::C, and then checked it after parsing
B<int>{}, back in the main() context which has no access.  We need to do the
access checks in the class context of the DMI.

I tried fixing this in push_to/pop_from_top_level, but that caused several
regressions.

gcc/cp/ChangeLog:

	PR c++/96673
	* init.c (get_nsdmi): Don't defer access checking.

gcc/testsuite/ChangeLog:

	PR c++/96673
	* g++.dg/cpp1y/nsdmi-aggr13.C: New test.
2022-05-13 13:39:30 -04:00
Jason Merrill 370440f9f9 c++: constexpr, inheritance, and local class [PR91933]
Here we complained about referring to nm3 from the local class member
function because referring to the base class subobject involved taking the
variable's address.  Let's shortcut this case to avoid that.

gcc/cp/ChangeLog:

	PR c++/91933
	* class.c (build_base_path): Shortcut simple non-pointer case.

gcc/testsuite/ChangeLog:

	PR c++/91933
	* g++.dg/cpp0x/constexpr-base7.C: New test.
2022-05-13 13:39:30 -04:00
Jason Merrill 945c2afcb3 c++: alias template equivalence and cv-quals [PR100032]
We also need to check that the cv-qualifiers are the same.

gcc/cp/ChangeLog:

	PR c++/100032
	* pt.c (get_underlying_template): Compare TYPE_QUALS.

gcc/testsuite/ChangeLog:

	PR c++/100032
	* g++.dg/cpp0x/alias-decl-equiv1.C: New test.
2022-05-13 13:39:30 -04:00
Jakub Jelinek 30a100abe4 re PR c++/67184 (Missed optimization with C++11 final specifier)
PR c++/67184
	PR c++/69445
	* call.c (build_new_method_call_1): Remove set but not used variable
	binfo.
2022-05-13 13:39:29 -04:00
Jason Merrill 967f950b74 c++: fix testcases
Only the first dg-error in constexpr-array23.C needs to be xfailed on the 9
branch.

lambda-pack-init6.C depends on the fix for PR94546; rather than backport
that as well, let's remove the test.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/constexpr-array23.C: Remove xfail.
	* g++.dg/cpp2a/lambda-pack-init6.C: Removed.
2022-05-13 13:39:14 -04:00
GCC Administrator 029021d219 Daily bump. 2022-05-13 00:19:58 +00:00
GCC Administrator 3a04311377 Daily bump. 2022-05-12 00:20:37 +00:00
Jakub Jelinek 6d79958a50 testsuite: Fix up pr102860.f90 for gcc 9 [PR105570]
Apparently -mcpu=power10 is gcc 10+, but the PR102860 change otherwise
made sense also for 9.x.  So just adjusting testcase...

2022-05-11  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/102860
	PR testsuite/105570
	* gfortran.dg/pr102860.f90: Use -mcpu=power9 instead of -mcpu=power10.
2022-05-11 20:37:01 +02:00
Patrick Palka 3d1c151bc1 c++: ICE when building builtin operator->* set [PR103455]
Here when constructing the builtin operator->* candidate set according
to the available conversion functions for the operand types, we end up
considering a candidate with C1=T (through B's dependent conversion
function) and C2=F, during which we crash from DERIVED_FROM_P because
dependent_type_p sees a TEMPLATE_TYPE_PARM outside of a template
context.

Sidestepping the question of whether we should be considering such a
dependent conversion function here in the first place, it seems futile
to test DERIVED_FROM_P for anything other than an actual class type, so
this patch fixes this ICE by simply guarding the DERIVED_FROM_P test
with CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.

	PR c++/103455

gcc/cp/ChangeLog:

	* call.c (add_builtin_candidate) <case MEMBER_REF>: Test
	CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.

gcc/testsuite/ChangeLog:

	* g++.dg/overload/builtin6.C: New test.

(cherry picked from commit 04f19580e8)
2022-05-11 08:30:29 -04:00
Patrick Palka 4df77364f7 c++: deleted fn and noexcept inst [PR101532, PR104225]
Here when attempting to use B's implicitly deleted default constructor,
mark_used rightfully returns false, but for the wrong reason: it
tries to instantiate the synthesized noexcept specifier which then only
silently fails because get_defaulted_eh_spec suppresses diagnostics
for deleted functions.  This lack of diagnostics causes us to crash on
the first testcase below (thanks to the assert in finish_expr_stmt), and
silently accept the second testcase.

To fix this, this patch makes mark_used avoid attempting to instantiate
the noexcept specifier of a deleted function, so that we'll instead
directly reject (and diagnose) the function due to its deletedness.

	PR c++/101532
	PR c++/104225

gcc/cp/ChangeLog:

	* decl2.c (mark_used): Don't consider maybe_instantiate_noexcept
	on a deleted function.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/nsdmi-template21.C: New test.
	* g++.dg/cpp0x/nsdmi-template21a.C: New test.

(cherry picked from commit bc90dd0ecf)
2022-05-11 08:30:29 -04:00
Patrick Palka c6432e1796 c++: Fix deduction with reference NTTP [PR83476]
In the testcase ref11.C below, during deduction for the call f(a),
uses_deducible_template_parms returns false for the dependent
specialization A<V> because the generic template argument V here is
wrapped in an implicit INDIRECT_REF (formed from template_parm_to_arg).
Since uses_deducible_template_parms returns false, unify_one_argument
exits early without ever attempting to deduce 'n' for 'V'.  This patch
fixes this by making deducible_expression look through such implicit
INDIRECT_REFs.

gcc/cp/ChangeLog:

	PR c++/83476
	PR c++/99885
	* pt.c (deducible_expression): Look through implicit
	INDIRECT_REFs as well.

gcc/testsuite/ChangeLog:

	PR c++/83476
	PR c++/99885
	* g++.dg/cpp1z/class-deduction85.C: New test.
	* g++.dg/template/ref11.C: New test.

(cherry picked from commit 2ccc05a514)
2022-05-11 08:30:29 -04:00
Tobias Burnus d042fa8e2c g++.dg/gomp/clause-3.C: Fix - missing in r12-438-g1580fc7 [PR100422]
gcc/testsuite/
	PR testsuite/100422
	* g++.dg/gomp/clause-3.C: Use 'reduction(&:..)' instead of '...(&&:..)'.

(cherry picked from commit af4e4d35f0)
2022-05-11 08:18:01 +02:00
Jakub Jelinek 4431014dc2 asan: Fix up asan_redzone_buffer::emit_redzone_byte [PR105396]
On the following testcase, we have in main's frame 3 variables,
some red zone padding, 4 byte d, followed by 12 bytes of red zone padding, then
8 byte b followed by 24 bytes of red zone padding, then 40 bytes c followed
by some red zone padding.
The intended content of shadow memory for that is (note, each byte describes
8 bytes of memory):
f1 f1 f1 f1 04 f2 00 f2 f2 f2 00 00 00 00 00 f3 f3 f3 f3 f3
left red    d  mr b  middle r c              right red zone

f1 is left red zone magic
f2 is middle red zone magic
f3 is right red zone magic
00 when all 8 bytes are accessible
01-07 when only 1 to 7 bytes are accessible followed by inaccessible bytes

The -fdump-rtl-expand-details dump makes it clear that it misbehaves:
Flushing rzbuffer at offset -160 with: f1 f1 f1 f1
Flushing rzbuffer at offset -128 with: 04 f2 00 00
Flushing rzbuffer at offset -128 with: 00 00 00 f2
Flushing rzbuffer at offset -96 with: f2 f2 00 00
Flushing rzbuffer at offset -64 with: 00 00 00 f3
Flushing rzbuffer at offset -32 with: f3 f3 f3 f3
In the end we end up with
f1 f1 f1 f1 00 00 00 f2 f2 f2 00 00 00 00 00 f3 f3 f3 f3 f3
shadow bytes because at offset -128 there are 2 overlapping stores
as asan_redzone_buffer::emit_redzone_byte has flushed the temporary 4 byte
buffer in the middle.

The function is called with an offset and value.  If the passed offset is
consecutive with the prev_offset + buffer size (off == offset), then
we handle it correctly, similarly if the new offset is far enough from the
old one (we then flush whatever was in the buffer and if needed add up to 3
bytes of 00 before actually pushing value.

But what isn't handled correctly is when the offset isn't consecutive to
what has been added last time, but it is in the same 4 byte word of shadow
memory (32 bytes of actual memory), like the above case where
we have consecutive 04 f2 and then skip one shadow memory byte (aka 8 bytes
of real memory) and then want to emit f2.  Emitting that as a store
of little-endian 0x0000f204 followed by a store of 0xf2000000 to the same
address doesn't work, we want to emit 0xf200f204.

The following patch does that by pushing 1 or 2 00 bytes.
Additionally, as a small cleanup, instead of using
      m_shadow_bytes.safe_push (value);
      flush_if_full ();
in all of if, else if and else bodies it sinks those 2 stmts to the end
of function as all do the same thing.

2022-04-27  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/105396
	* asan.c (asan_redzone_buffer::emit_redzone_byte): Handle the case
	where offset is bigger than off but smaller than m_prev_offset + 32
	bits by pushing one or more 0 bytes.  Sink the
	m_shadow_bytes.safe_push (value); flush_if_full (); statements from
	all cases to the end of the function.

	* gcc.dg/asan/pr105396.c: New test.

(cherry picked from commit 9715f10c06)
2022-05-11 08:18:01 +02:00