https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126320

            Bug ID: 126320
           Summary: [16/17 Regression] wrong code at -O1/2/3 -mavx
           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/WfGo1shbc
Testcase:
#include <stdint.h>
typedef int64_t v2i64 __attribute__((vector_size(16)));
void *g4, *f3_p2;
int8_t g15, g23;
v2i64 g21;
_Bool g22, f3_c4;
__attribute__((__vector_size__(16 * sizeof(int)))) int g26;
int16_t g29;
void f3(v2i64 a1)
{
    int16_t v3;
lbl_entry:
    f3_p2 = &a1;
    v3 = g29;
    if (g22) goto lbl_bf4;
    f3_c4 = v3 - 709;
    if (f3_c4) return;
lbl_bf4:
    g21 = a1;
    uint8_t __ov_tmp_g15;
    g15 = __ov_tmp_g15;
    a1[0] = 0;
    g26 = g26 == ~g26;
    g4 = f3_p2;
    g23 = 0;
    goto lbl_entry;
}
int main() { f3(g21); }

This case triggers SIGSEGV at -O1 -mavx, and terminates normally at -O0.

Reply via email to