https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110495
Bug ID: 110495
Summary: fre introduces signed wrap for vector
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: kristerw at gcc dot gnu.org
Target Milestone: ---
The following function (from gcc.dg/tree-ssa/addadd-2.c)
typedef int S __attribute__((vector_size(64)));
void j(S*x){
*x += __INT_MAX__;
*x += __INT_MAX__;
}
is optimized by fre1 to
void j (S * x)
{
vector(16) int _1;
vector(16) int _2;
vector(16) int _4;
<bb 2> :
_1 = *x_6(D);
_2 = _1 + { 2147483647, 2147483647, 2147483647, 2147483647, 2147483647,
2147483647, 2147483647, 2147483647, 2147483647, 2147483647, 2147483647,
2147483647, 2147483647, 2147483647, 2147483647, 2147483647 };
*x_6(D) = _2;
_4 = _1 + { -2(OVF), -2(OVF), -2(OVF), -2(OVF), -2(OVF), -2(OVF), -2(OVF),
-2(OVF), -2(OVF), -2(OVF), -2(OVF), -2(OVF), -2(OVF), -2(OVF), -2(OVF), -2(OVF)
};
*x_6(D) = _4;
return;
}
which has signed wrap for the cases where the original did not wrap.