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

--- Comment #21 from Richard Biener <rguenth at gcc dot gnu.org> ---
Needs more defensiveness.  Also the safe_from_p change might not be safe
in case we ever TER sth like

 _1 = BIT_FIELD_REF<vector, ...>;
 _2 = BIT_FIELD_REF<vector, ...>;
 vector = { _2, _1 };

which we do...

typedef double v2df __attribute__((vector_size(16)));
v2df v;
void foo()
{
  v = (v2df){v[1], v[0]};
}

and expand to

(insn 7 6 8 (set (reg:DF 87)
        (mem/j/c:DF (plus:DI (reg/f:DI 86)
                (const_int 8 [0x8])) [1 v+8 S8 A64])) "t4.c":5:5 -1
     (nil))

(insn 8 7 9 (set (mem/c:DF (reg/f:DI 85) [1 v+0 S8 A128])
        (reg:DF 87)) "t4.c":5:5 -1
     (nil))

...

(insn 11 10 12 (set (reg:DF 90)
        (mem/j/c:DF (reg/f:DI 89) [1 v+0 S8 A128])) "t4.c":5:5 -1
     (nil))

(insn 12 11 0 (set (mem/c:DF (reg/f:DI 88) [1 v+8 S8 A64])
        (reg:DF 90)) "t4.c":5:5 -1
     (nil))

after that change :/  So much for this nice trick.  The safe_from_p
change would be safe for SSA names we do not TER but for the testcases
we do TER.  There's no existing simple test in the C testsuite so I'll
add the above one.

Reply via email to