https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123786
Alex Coplan <acoplan at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[16 Regression] AArch64: |[16 Regression] AArch64:
|Miscompile at -O3 |Miscompile at -O3
|-mtune=generic-armv9-a |-mtune=generic-armv9-a
| |since
| |r16-3628-g41b0c7a674e870
--- Comment #11 from Alex Coplan <acoplan at gcc dot gnu.org> ---
Just FTR, this started with the introduction of the dep_fusion pass, i.e.
r16-3628-g41b0c7a674e87074fdc8088479cb93f6fe1e070f.
Here is a slightly cleaned up testcase for the testsuite:
#include <arm_neon.h>
int g_36[3];
short g_s;
signed char g_82, g_179, g_x, g_101;
__attribute__((noipa))
void check(void)
{
if (g_36[0] != 1)
__builtin_abort ();
}
int main(void)
{
BS_LABEL_3:
short l_65 = g_s;
if (g_x) goto BS_LABEL_6;
for (; g_101; g_101 = 5)
{
BS_LABEL_6:
}
for (; g_82 < 1; g_82++)
{
switch (vqadds_u32 (0, 0))
{
case 4: goto BS_LABEL_3;
case 9: goto BS_LABEL_3;
}
short si1 = (l_65 &= 1) || (g_179 &= 0) != 6;
g_36[0] = g_36[2] == 0 ? 1 : si1 / g_36[2];
}
check ();
}
or for a pre-processed testcase that works with just a cc1:
int g_36[3];
short g_s;
signed char g_82, g_179, g_x, g_101;
__attribute__((noipa))
void check(void)
{
if (g_36[0] != 1)
__builtin_abort ();
}
int main(void)
{
BS_LABEL_3:
short l_65 = g_s;
if (g_x) goto BS_LABEL_6;
for (; g_101; g_101 = 5)
{
BS_LABEL_6:
}
for (; g_82 < 1; g_82++)
{
switch (__builtin_aarch64_usaddsi_uuu (0, 0))
{
case 4: goto BS_LABEL_3;
case 9: goto BS_LABEL_3;
}
short si1 = (l_65 &= 1) || (g_179 &= 0) != 6;
g_36[0] = g_36[2] == 0 ? 1 : si1 / g_36[2];
}
check ();
}