https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127160
Bug ID: 127160
Summary: [10-17 Regression] wrong code at -O2
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: xxs_chy at outlook dot com
Target Milestone: ---
Reproducer: https://godbolt.org/z/cb5jqvoY7
Reduced case:
#include <stdint.h>
struct s3
{
__attribute__((__vector_size__(sizeof(int)))) int f0;
uint32_t f3[19];
};
uint16_t g11, g24, g22, g12;
_Bool f5_repair25;
static void f5(struct s3 a1)
{
_Bool repair21;
if (f5_repair25) g24 = g12;
if (g22 != 50295) repair21 = g11 != 5;
if (repair21) return;
g24 = a1.f0[62119];
}
int main() { f5((struct s3){}); }
This case triggers SIGSECV at -O2, and terminates at -O0.