https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123624
Bug ID: 123624
Summary: aarch64: Shrink wrapping incorrectly reduces streaming
mode usage in locally streaming functions
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: acarlotti at gcc dot gnu.org
Target Milestone: ---
Shrink wrapping can incorrectly postpone a switch into streaming mode until
after instructions like cntd, whose result can depend on whether or not we're
in streaming mode.
The following test is miscompiled:
int foo(int x);// __arm_streaming;
__arm_locally_streaming
int bar(int x)
{
if (x)
return foo(3);
return svcntd();
}
Shrink wrapping moves the prologue into the if (x) branch, leaving the cntd
instruction in !x branch executing in non-streaming mode.
I'll post a fix shortly.