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

--- Comment #1 from Marcin Ĺšlusarz <marcin.slusarz at intel dot com> ---
Heh, there are really stupid bugs in both files. Thankfully they don't change
the outcome.

Updated code:
$ cat main.c 
#include <stdio.h>
#include <string.h>

void test(char *dest);

int main()
{
        char buf[64];
        memset(buf, 0x2, 64);
        test(buf);
        for (int i = 0; i < 32; ++i)
                printf("%d ", buf[i]);
        printf("\n");
        return 0;
}
$ cat zeroupper.c 
#include <immintrin.h>

void test(char *dest)
{
        __m256i ymm1 = _mm256_set1_epi8((char)0x1);
        _mm256_storeu_si256((__m256i *)(dest + 32), ymm1);
        _mm256_zeroupper();
        __m256i ymm2 = _mm256_set1_epi8((char)0x1);
        _mm256_storeu_si256((__m256i *)dest, ymm2);
}

Still the output is:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Reply via email to