public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/102622] New: Wrong code with -O3 for skylake-avx512 and icelake-server
@ 2021-10-05 19:37 vsevolod.livinskij at frtk dot ru
  2021-10-05 22:21 ` [Bug tree-optimization/102622] [12 Regression] " pinskia at gcc dot gnu.org
                   ` (29 more replies)
  0 siblings, 30 replies; 31+ messages in thread
From: vsevolod.livinskij at frtk dot ru @ 2021-10-05 19:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102622
           Summary: Wrong code with -O3 for skylake-avx512 and
                    icelake-server
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vsevolod.livinskij at frtk dot ru
  Target Milestone: ---

Reproducer:
// func.cpp
#include <algorithm>

extern int var_20, var_22;
extern short arr_32[];
extern char arr_45[];

void test(int a, unsigned b, long long *c) {
  for (short d = 0; d < 13; d++) {
    for (int e = 0; e < a; e += 3)
      var_20 = 0;
    if (std::max(b, unsigned((short)b))) {
      arr_32[d] = 0;
      var_22 = *c;
    }
    for (unsigned f = 0; f < 69; f += 4)
      arr_45[f] = 0;
  }
}

driver.cpp
#include <stdio.h>

unsigned long long int a = 10693271954245845448ULL;
unsigned int b = 1144022456U;
long long int c = 42;
int var_20 = 0;
long long int var_22 = 0;
unsigned short arr_32 [13];
unsigned char arr_45 [69];

void test(int a, unsigned int b, long long int* c);

int main() {
    test(a, b, &c);
    printf("%llu\n", var_22);
}

Error:
>$ g++ -O3 -march=skylake-avx512 func.cpp driver.cpp && sde -skx -- ./a.out 
0
>$ g++ -O2 -march=skylake-avx512 func.cpp driver.cpp && sde -skx -- ./a.out 
42

GCC version:
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/testing/gcc/bin/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /testing/gcc/gcc_src/configure --enable-multilib
--prefix=/testing/gcc/bin --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20211004 (154fd0896ef22fcf5235e35e2b795394dddd7a33) (GCC)

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2021-11-09 19:03 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05 19:37 [Bug tree-optimization/102622] New: Wrong code with -O3 for skylake-avx512 and icelake-server vsevolod.livinskij at frtk dot ru
2021-10-05 22:21 ` [Bug tree-optimization/102622] [12 Regression] " pinskia at gcc dot gnu.org
2021-10-05 22:36 ` pinskia at gcc dot gnu.org
2021-10-05 23:31 ` pinskia at gcc dot gnu.org
2021-10-06  7:23 ` [Bug tree-optimization/102622] [12 Regression] Wrong code with -O3 for skylake-avx512 and icelake-server by r12-3903 aldyh at gcc dot gnu.org
2021-10-06  8:42 ` rguenth at gcc dot gnu.org
2021-10-06 12:55 ` hjl.tools at gmail dot com
2021-10-06 13:04 ` hjl.tools at gmail dot com
2021-10-06 13:10 ` aldyh at gcc dot gnu.org
2021-10-06 13:12 ` aldyh at gcc dot gnu.org
2021-10-06 13:26 ` hjl.tools at gmail dot com
2021-10-06 14:19 ` aldyh at redhat dot com
2021-10-06 14:21 ` hjl.tools at gmail dot com
2021-10-07 16:07 ` aldyh at gcc dot gnu.org
2021-10-07 21:29 ` pinskia at gcc dot gnu.org
2021-10-07 21:31 ` pinskia at gcc dot gnu.org
2021-10-08  6:04 ` pinskia at gcc dot gnu.org
2021-10-09 22:25 ` pinskia at gcc dot gnu.org
2021-10-10  1:05 ` [Bug tree-optimization/102622] [9/10/12 Regression] Wrong code with -O1 and above due to phiopt and signed one bit integer types pinskia at gcc dot gnu.org
2021-10-10  1:54 ` pinskia at gcc dot gnu.org
2021-10-10  5:49 ` pinskia at gcc dot gnu.org
2021-10-10  9:04 ` cvs-commit at gcc dot gnu.org
2021-10-10  9:06 ` [Bug tree-optimization/102622] [9/10 " pinskia at gcc dot gnu.org
2021-10-10  9:18 ` pinskia at gcc dot gnu.org
2021-10-10 23:21 ` pinskia at gcc dot gnu.org
2021-10-11  9:22 ` cvs-commit at gcc dot gnu.org
2021-10-11  9:24 ` [Bug tree-optimization/102622] [9 " pinskia at gcc dot gnu.org
2021-10-11 21:07 ` cvs-commit at gcc dot gnu.org
2021-10-11 21:08 ` pinskia at gcc dot gnu.org
2021-10-11 21:19 ` cvs-commit at gcc dot gnu.org
2021-11-09 19:03 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).