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

            Bug ID: 128406
           Summary: [16/17 Regression] ICE with abnormal SSA names and
                    vector constructors
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ktkachov at gcc dot gnu.org
  Target Milestone: ---

typedef float v8sf __attribute__ ((vector_size (32)));
extern int rt (void) __attribute__ ((returns_twice));
extern int get (void);
extern void use (float, float, float, float, float, int);

/* x and a0...a3 occur in abnormal PHIs.  BB SLP changes the CONSTRUCTOR
   into a CONSTRUCTOR of vectors of a0...a3 and of x.  A splat of x at the
   CONSTRUCTOR would be a use of x after its redefinition.  */

void
f (v8sf *out, v8sf v, float x)
{
  get ();
  float a0 = v[0], a1 = v[1], a2 = v[2], a3 = v[3];
  int k = get ();
  float b0 = a0, b1 = a1, b2 = a2, b3 = a3;
  float y0 = x, y1 = x, y2 = x, y3 = x;
  x++;
  *out = (v8sf) { b0, b1, b2, b3, y0, y1, y2, y3 };
  get ();
  rt ();
  use (x, a0, a1, a2, a3, k);
}

on x86_64 with -O2 -mavx ICEs:
Unable to coalesce ssa_names 3 and 40 which are marked as MUST COALESCE.
x_3(ab) and  x_40(ab)
during RTL pass: expand
<source>: In function 'f':
<source>:11:1: internal compiler error: SSA corruption
   11 | f (v8sf *out, v8sf v, float x)
      | ^
0x20a13d8 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x209a6cb internal_error(char const*, ...)
        ???:0
0xfb0dd4 coalesce_ssa_name(_var_map*)
        ???:0
0xf48ae1 rewrite_out_of_ssa(ssaexpand*)
        ???:0

Reply via email to