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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86_64-*-*, i?86-*-*
           Priority|P3                          |P2
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |wrong-code
   Last reconfirmed|                            |2020-01-15
                 CC|                            |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1
            Summary|[10 Regression] DSE removes |[8/9/10 Regression] DSE
                   |store incorrectly           |removes store incorrectly
   Target Milestone|---                         |8.4

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
You can probably massage it to make it a very old issue by using

typedef int v4si __attribute__((vector_size(16)));
typedef union { long double value; v4si vec; } data;
void bar(data *);
void foo(long double x)
{
  data m;
  m.vec = (v4si) { 0,0,0,0 };
  m.value = x;
  bar (&m);
}

even GCC 4.8 produces

foo:
.LFB0:
        .cfi_startproc
        subq    $24, %rsp
        .cfi_def_cfa_offset 32
        fldt    32(%rsp)
        movq    %rsp, %rdi
        fstpt   (%rsp)
        call    bar
        addq    $24, %rsp
        .cfi_def_cfa_offset 8
        ret

which looks wrong.  3.4.6 doesn't DSE here, nor does 4.0.4.  But if you
use recent GCC even RTL DSE removes the store if you use -fno-tree-dse.

So the regression is much older.

Possibly other targets are affected as well.

Reply via email to