[Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475

2021-10-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102798

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |9.5

[Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475

2021-10-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102798

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||alias

--- Comment #4 from Andrew Pinski  ---

Before the vectorizer:
  unsigned charD.28 * out_18(D) = outD.3197;
  const unsigned charD.28 * in_16(D) = inD.3198;
  size_tD.3196 size_17(D) = sizeD.3199;

After:
  unsigned charD.28 * out_18(D) = outD.3197;
  # PT = anything 
  const unsigned charD.28 * in_16(D) = inD.3198;
  size_tD.3196 size_17(D) = sizeD.3199;



That seems to be causing the issue.

[Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475

2021-10-16 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102798

--- Comment #3 from H.J. Lu  ---
Visiting conditional with predicate: if (in_16(D) != 0B)

With known ranges
in_16(D): const unsigned char * [1B, +INF]

1B for lower bound is wrong.

[Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475

2021-10-16 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102798

--- Comment #2 from H.J. Lu  ---
192t.thread3 has

  if (in_16(D) != 0B)
goto ; [70.00%]
  else
goto ; [30.00%]

193t.dom3 removed "if (in_16(D) != 0B)".

[Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475

2021-10-16 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102798

--- Comment #1 from H.J. Lu  ---
Source has

__attribute__((__noipa__))
void BUF_reverse (unsigned char *out, const unsigned char *in, size_t size)
{
  size_t i;
  if (in)
{
  out += size - 1;
  for (i = 0; i < size; i++)
*out-- = *in++;
}
  else

We generate

BUF_reverse:
.LFB0:
.cfi_startproc
movq%rdi, %r8
movq%rsi, %rcx
movq%rdx, %rax
testq   %rdx, %rdx   <<< RDX has size, not in.
je  .L28

[Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475

2021-10-16 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102798

H.J. Lu  changed:

   What|Removed |Added

 Ever confirmed|0   |1
Summary|[9/10/11/12 Regression] |[9/10/11/12 Regression]
   |wrong code with -O3 |wrong code with -O3
   |-fno-tree-pta -mavx512f |-fno-tree-pta -mavx512f by
   ||r9-2475
 Status|UNCONFIRMED |NEW
 CC||rguenth at gcc dot gnu.org
   Last reconfirmed||2021-10-16
  Component|target  |tree-optimization