public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f
@ 2021-10-16 12:43 zsojka at seznam dot cz
  2021-10-16 15:54 ` [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475 hjl.tools at gmail dot com
                   ` (24 more replies)
  0 siblings, 25 replies; 26+ messages in thread
From: zsojka at seznam dot cz @ 2021-10-16 12:43 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102798
           Summary: [9/10/11/12 Regression] wrong code with -O3
                    -fno-tree-pta -mavx512f
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

Created attachment 51616
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51616&action=edit
auto-reduced testcase (from OpenSSL sources)

$ x86_64-pc-linux-gnu-gcc -O3 -fno-tree-pta -mavx512f testcase.c
$ gdb ./a.out
...
(gdb) r
Starting program: /home/smatz/gcc-bug/58/a.out 

Program received signal SIGSEGV, Segmentation fault.
BUF_reverse (out=<optimized out>, out@entry=0x7fffffffda60 "", in=<optimized
out>, in@entry=0x0, size=size@entry=40) at testcase.c:11
11              *out-- = *in++;
(gdb) disas
Dump of assembler code for function BUF_reverse:
...
   0x0000000000401200 <+96>:    and    $0xffffffffffffffe0,%r9
   0x0000000000401204 <+100>:   add    %rcx,%r9
   0x0000000000401207 <+103>:   nopw   0x0(%rax,%rax,1)
=> 0x0000000000401210 <+112>:   vmovdqu (%rdx),%ymm2
   0x0000000000401214 <+116>:   add    $0x20,%rdx
   0x0000000000401218 <+120>:   sub    $0x20,%rdi
   0x000000000040121c <+124>:   vperm2i128 $0x1,%ymm2,%ymm2,%ymm0
...
(gdb) info reg
rax            0x28                40
rbx            0x4013d0            4199376
rcx            0x0                 0
rdx            0x0                 0
...

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r12-4456-20211016001627-g93d183a5fff-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-4456-20211016001627-g93d183a5fff-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20211016 (experimental) (GCC)

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

* [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
@ 2021-10-16 15:54 ` hjl.tools at gmail dot com
  2021-10-16 16:31 ` hjl.tools at gmail dot com
                   ` (23 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: hjl.tools at gmail dot com @ 2021-10-16 15:54 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> 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

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

* [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
  2021-10-16 15:54 ` [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475 hjl.tools at gmail dot com
@ 2021-10-16 16:31 ` hjl.tools at gmail dot com
  2021-10-16 18:10 ` hjl.tools at gmail dot com
                   ` (22 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: hjl.tools at gmail dot com @ 2021-10-16 16:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
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

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

* [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
  2021-10-16 15:54 ` [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475 hjl.tools at gmail dot com
  2021-10-16 16:31 ` hjl.tools at gmail dot com
@ 2021-10-16 18:10 ` hjl.tools at gmail dot com
  2021-10-16 18:16 ` hjl.tools at gmail dot com
                   ` (21 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: hjl.tools at gmail dot com @ 2021-10-16 18:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
192t.thread3 has

  if (in_16(D) != 0B)
    goto <bb 3>; [70.00%]
  else
    goto <bb 31>; [30.00%]

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

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

* [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2021-10-16 18:10 ` hjl.tools at gmail dot com
@ 2021-10-16 18:16 ` hjl.tools at gmail dot com
  2021-10-16 18:42 ` pinskia at gcc dot gnu.org
                   ` (20 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: hjl.tools at gmail dot com @ 2021-10-16 18:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
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.

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

* [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2021-10-16 18:16 ` hjl.tools at gmail dot com
@ 2021-10-16 18:42 ` pinskia at gcc dot gnu.org
  2021-10-16 18:43 ` pinskia at gcc dot gnu.org
                   ` (19 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-10-16 18:42 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |alias

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---

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.

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

* [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2021-10-16 18:42 ` pinskia at gcc dot gnu.org
@ 2021-10-16 18:43 ` pinskia at gcc dot gnu.org
  2021-10-16 18:46 ` [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta " pinskia at gcc dot gnu.org
                   ` (18 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-10-16 18:43 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |9.5

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

* [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2021-10-16 18:43 ` pinskia at gcc dot gnu.org
@ 2021-10-16 18:46 ` pinskia at gcc dot gnu.org
  2021-10-16 19:08 ` hjl.tools at gmail dot com
                   ` (17 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-10-16 18:46 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[9/10/11/12 Regression]     |[9/10/11/12 Regression]
                   |wrong code with -O3         |wrong code with -O3
                   |-fno-tree-pta -mavx512f by  |-fno-tree-pta by r9-2475
                   |r9-2475                     |

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Here is a testcase which fails without -mavx512


typedef __SIZE_TYPE__ size_t;

__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
    {
      unsigned char *q;
      char c;
      q = out + size - 1;
      for (i = 0; i < size ; i++)
            {
              *out++ = 1;
            }
    }
}

int
main (void)
{
  unsigned char buf[40];
  unsigned char buf1[40];
  for (unsigned i = 0; i < sizeof (buf); i++)
    buf[i] = i;
  BUF_reverse (buf, 0, sizeof (buf));
  for (unsigned i = 0; i < sizeof (buf); i++)
    if (buf[i] != 1)
      __builtin_abort ();

  return 0;
}

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

* [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2021-10-16 18:46 ` [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta " pinskia at gcc dot gnu.org
@ 2021-10-16 19:08 ` hjl.tools at gmail dot com
  2021-10-17  0:53 ` hjl.tools at gmail dot com
                   ` (16 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: hjl.tools at gmail dot com @ 2021-10-16 19:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> ---
A pointer is known to non-null only if we know where the pointer is
pointing to.  Since the null field is initialized to 0, we need to
check both null and anything.  This works on the test case:

diff --git a/gcc/value-query.cc b/gcc/value-query.cc
index ab133aab114..1e8e3b96ea7 100644
--- a/gcc/value-query.cc
+++ b/gcc/value-query.cc
@@ -302,7 +302,7 @@ get_ssa_name_ptr_info_nonnull (const_tree name)
      When PTA analysis is improved, pt.anything, pt.nonlocal
      and pt.escaped may also has to be considered before
      deciding that pointer cannot point to NULL.  */
-  return !pi->pt.null;
+  return !pi->pt.null && !pi->pt.anything;
 }

 // Update the global range for NAME into the SSA_RANGE_NAME_INFO and

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

* [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (7 preceding siblings ...)
  2021-10-16 19:08 ` hjl.tools at gmail dot com
@ 2021-10-17  0:53 ` hjl.tools at gmail dot com
  2021-10-17  2:49 ` hjl.tools at gmail dot com
                   ` (15 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: hjl.tools at gmail dot com @ 2021-10-17  0:53 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aldyh at gcc dot gnu.org

--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> ---
Looks like a VRP bug.  For:

 <bb 2> [local count: 168730857]:
  if (in_16(D) != 0B) 
    goto <bb 3>; [70.00%]
  else
    goto <bb 6>; [30.00%]

  <bb 3> [local count: 118111600]:
  _1 = size_17(D) + 18446744073709551615;
  out_26 = out_18(D) + _1; 
  goto <bb 5>; [100.00%]

VRP reports:

in_16(D) : BACK visiting block 3 for in_16(D)
  2->3 has cache, const unsigned char * VARYING, update.
FWD visiting block 3 for in_16(D)  starting range : UNDEFINED
   edge 2->3 :const unsigned char * [1B, +INF]
      Updating range to const unsigned char * [1B, +INF]
      Updating blocks :
DONE visiting blocks for in_16(D)

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

* [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (8 preceding siblings ...)
  2021-10-17  0:53 ` hjl.tools at gmail dot com
@ 2021-10-17  2:49 ` hjl.tools at gmail dot com
  2021-10-17 13:33 ` hjl.tools at gmail dot com
                   ` (14 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: hjl.tools at gmail dot com @ 2021-10-17  2:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> ---
Vectorizer has

 if (DR_PTR_INFO (dr)
      && TREE_CODE (addr_base) == SSA_NAME
      && !SSA_NAME_PTR_INFO (addr_base))
    vect_duplicate_ssa_name_ptr_info (addr_base, dr_info);

This fixes the crash. 

diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 1e13148190c..fca5aebfbdb 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -4785,7 +4785,8 @@ vect_create_addr_base_for_vector_ref (vec_info *vinfo,
stmt_vec_info stmt_info,

   if (DR_PTR_INFO (dr)
       && TREE_CODE (addr_base) == SSA_NAME
-      && !SSA_NAME_PTR_INFO (addr_base))
+      && !SSA_NAME_PTR_INFO (addr_base)
+      && TREE_CODE (SSA_NAME_VAR (addr_base)) != PARM_DECL)
     vect_duplicate_ssa_name_ptr_info (addr_base, dr_info);

   if (dump_enabled_p ())

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

* [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (9 preceding siblings ...)
  2021-10-17  2:49 ` hjl.tools at gmail dot com
@ 2021-10-17 13:33 ` hjl.tools at gmail dot com
  2021-10-17 18:29 ` hjl.tools at gmail dot com
                   ` (13 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: hjl.tools at gmail dot com @ 2021-10-17 13:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 51618
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51618&action=edit
A patch

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

* [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (10 preceding siblings ...)
  2021-10-17 13:33 ` hjl.tools at gmail dot com
@ 2021-10-17 18:29 ` hjl.tools at gmail dot com
  2021-10-18  6:39 ` rguenth at gcc dot gnu.org
                   ` (12 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: hjl.tools at gmail dot com @ 2021-10-17 18:29 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #51618|0                           |1
        is obsolete|                            |

--- Comment #10 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 51619
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51619&action=edit
An updated patch

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

* [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (11 preceding siblings ...)
  2021-10-17 18:29 ` hjl.tools at gmail dot com
@ 2021-10-18  6:39 ` rguenth at gcc dot gnu.org
  2021-10-18  7:03 ` rguenth at gcc dot gnu.org
                   ` (11 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-10-18  6:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

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

* [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (12 preceding siblings ...)
  2021-10-18  6:39 ` rguenth at gcc dot gnu.org
@ 2021-10-18  7:03 ` rguenth at gcc dot gnu.org
  2021-10-18  8:26 ` cvs-commit at gcc dot gnu.org
                   ` (10 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-10-18  7:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
The issue is that the vectorizer should only duplicate pointer-info to SSA
names it created itself, not to _any_ existing ones.

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

* [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (13 preceding siblings ...)
  2021-10-18  7:03 ` rguenth at gcc dot gnu.org
@ 2021-10-18  8:26 ` cvs-commit at gcc dot gnu.org
  2021-10-18  8:27 ` [Bug tree-optimization/102798] [9/10/11 " rguenth at gcc dot gnu.org
                   ` (9 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-18  8:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:a5b1b2a186d94b31a522395e9d02c9cec1b928cb

commit r12-4466-ga5b1b2a186d94b31a522395e9d02c9cec1b928cb
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Oct 18 09:10:43 2021 +0200

    tree-optimization/102798 - avoid copying PTA info to old SSA names

    The vectorizer duplicates pointer-info to created pointer bases
    but it has to avoid changing points-to info on existing SSA names
    because there's now flow-sensitive info in there (pt->pt_null as
    set from VRP).

    2021-10-18  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/102798
            * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref):
            Only copy points-to info to newly generated SSA names.

            * gcc.dg/pr102798.c: New testcase.

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

* [Bug tree-optimization/102798] [9/10/11 Regression] wrong code with -O3 -fno-tree-pta by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (14 preceding siblings ...)
  2021-10-18  8:26 ` cvs-commit at gcc dot gnu.org
@ 2021-10-18  8:27 ` rguenth at gcc dot gnu.org
  2021-11-08 13:32 ` cvs-commit at gcc dot gnu.org
                   ` (8 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-10-18  8:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[9/10/11/12 Regression]     |[9/10/11 Regression] wrong
                   |wrong code with -O3         |code with -O3 -fno-tree-pta
                   |-fno-tree-pta by r9-2475    |by r9-2475
      Known to fail|12.0                        |
      Known to work|                            |12.0
           Priority|P3                          |P2

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

* [Bug tree-optimization/102798] [9/10/11 Regression] wrong code with -O3 -fno-tree-pta by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (15 preceding siblings ...)
  2021-10-18  8:27 ` [Bug tree-optimization/102798] [9/10/11 " rguenth at gcc dot gnu.org
@ 2021-11-08 13:32 ` cvs-commit at gcc dot gnu.org
  2022-02-17 10:48 ` [Bug tree-optimization/102798] [9/10 " cvs-commit at gcc dot gnu.org
                   ` (7 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-08 13:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:1631d6d2910e03e4517079d6e6ad0ae1aeb24dfa

commit r11-9229-g1631d6d2910e03e4517079d6e6ad0ae1aeb24dfa
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Oct 18 09:10:43 2021 +0200

    tree-optimization/102798 - avoid copying PTA info to old SSA names

    The vectorizer duplicates pointer-info to created pointer bases
    but it has to avoid changing points-to info on existing SSA names
    because there's now flow-sensitive info in there (pt->pt_null as
    set from VRP).

    2021-10-18  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/102798
            * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref):
            Only copy points-to info to newly generated SSA names.

            * gcc.dg/pr102798.c: New testcase.

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

* [Bug tree-optimization/102798] [9/10 Regression] wrong code with -O3 -fno-tree-pta by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (16 preceding siblings ...)
  2021-11-08 13:32 ` cvs-commit at gcc dot gnu.org
@ 2022-02-17 10:48 ` cvs-commit at gcc dot gnu.org
  2022-02-17 11:57 ` [Bug tree-optimization/102798] [9 " cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-17 10:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:6a6ed1bd9d0b20d0ec0ca6d7ab1e0cefe57db687

commit r10-10463-g6a6ed1bd9d0b20d0ec0ca6d7ab1e0cefe57db687
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Oct 18 09:10:43 2021 +0200

    tree-optimization/102798 - avoid copying PTA info to old SSA names

    The vectorizer duplicates pointer-info to created pointer bases
    but it has to avoid changing points-to info on existing SSA names
    because there's now flow-sensitive info in there (pt->pt_null as
    set from VRP).

    2021-10-18  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/102798
            * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref):
            Only copy points-to info to newly generated SSA names.

            * gcc.dg/pr102798.c: New testcase.

    (cherry picked from commit 1631d6d2910e03e4517079d6e6ad0ae1aeb24dfa)

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

* [Bug tree-optimization/102798] [9 Regression] wrong code with -O3 -fno-tree-pta by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (17 preceding siblings ...)
  2022-02-17 10:48 ` [Bug tree-optimization/102798] [9/10 " cvs-commit at gcc dot gnu.org
@ 2022-02-17 11:57 ` cvs-commit at gcc dot gnu.org
  2022-02-17 11:58 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-17 11:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:523f5950c70d65714bedf9d5fe164d9e6d69dd87

commit r9-9956-g523f5950c70d65714bedf9d5fe164d9e6d69dd87
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Oct 18 09:10:43 2021 +0200

    tree-optimization/102798 - avoid copying PTA info to old SSA names

    The vectorizer duplicates pointer-info to created pointer bases
    but it has to avoid changing points-to info on existing SSA names
    because there's now flow-sensitive info in there (pt->pt_null as
    set from VRP).

    2021-10-18  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/102798
            * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref):
            Only copy points-to info to newly generated SSA names.

            * gcc.dg/pr102798.c: New testcase.

    (cherry picked from commit 1631d6d2910e03e4517079d6e6ad0ae1aeb24dfa)

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

* [Bug tree-optimization/102798] [9 Regression] wrong code with -O3 -fno-tree-pta by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (18 preceding siblings ...)
  2022-02-17 11:57 ` [Bug tree-optimization/102798] [9 " cvs-commit at gcc dot gnu.org
@ 2022-02-17 11:58 ` rguenth at gcc dot gnu.org
  2022-02-18  7:10 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-02-17 11:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #16 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

* [Bug tree-optimization/102798] [9 Regression] wrong code with -O3 -fno-tree-pta by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (19 preceding siblings ...)
  2022-02-17 11:58 ` rguenth at gcc dot gnu.org
@ 2022-02-18  7:10 ` rguenth at gcc dot gnu.org
  2022-02-18  7:11 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-02-18  7:10 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |seurer at gcc dot gnu.org

--- Comment #17 from Richard Biener <rguenth at gcc dot gnu.org> ---
*** Bug 104586 has been marked as a duplicate of this bug. ***

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

* [Bug tree-optimization/102798] [9 Regression] wrong code with -O3 -fno-tree-pta by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (20 preceding siblings ...)
  2022-02-18  7:10 ` rguenth at gcc dot gnu.org
@ 2022-02-18  7:11 ` rguenth at gcc dot gnu.org
  2022-02-18  7:13 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-02-18  7:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
             Status|RESOLVED                    |ASSIGNED
         Depends on|                            |96522

--- Comment #18 from Richard Biener <rguenth at gcc dot gnu.org> ---
On the gcc-9 branch depends on PR96522.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96522
[Bug 96522] [9 Regression] Incorrect with with -O -fno-tree-pta

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

* [Bug tree-optimization/102798] [9 Regression] wrong code with -O3 -fno-tree-pta by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (21 preceding siblings ...)
  2022-02-18  7:11 ` rguenth at gcc dot gnu.org
@ 2022-02-18  7:13 ` rguenth at gcc dot gnu.org
  2022-02-18  8:21 ` rguenth at gcc dot gnu.org
  2022-02-18  8:22 ` rguenth at gcc dot gnu.org
  24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-02-18  7:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |97043

--- Comment #19 from Richard Biener <rguenth at gcc dot gnu.org> ---
And PR97043.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97043
[Bug 97043] latent wrong-code with SLP vectorization

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

* [Bug tree-optimization/102798] [9 Regression] wrong code with -O3 -fno-tree-pta by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (22 preceding siblings ...)
  2022-02-18  7:13 ` rguenth at gcc dot gnu.org
@ 2022-02-18  8:21 ` rguenth at gcc dot gnu.org
  2022-02-18  8:22 ` rguenth at gcc dot gnu.org
  24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-02-18  8:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102798
Bug 102798 depends on bug 96522, which changed state.

Bug 96522 Summary: [9 Regression] Incorrect with with -O -fno-tree-pta
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96522

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

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

* [Bug tree-optimization/102798] [9 Regression] wrong code with -O3 -fno-tree-pta by r9-2475
  2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
                   ` (23 preceding siblings ...)
  2022-02-18  8:21 ` rguenth at gcc dot gnu.org
@ 2022-02-18  8:22 ` rguenth at gcc dot gnu.org
  24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-02-18  8:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #20 from Richard Biener <rguenth at gcc dot gnu.org> ---
Now really fixed.

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

end of thread, other threads:[~2022-02-18  8:22 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-16 12:43 [Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f zsojka at seznam dot cz
2021-10-16 15:54 ` [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f by r9-2475 hjl.tools at gmail dot com
2021-10-16 16:31 ` hjl.tools at gmail dot com
2021-10-16 18:10 ` hjl.tools at gmail dot com
2021-10-16 18:16 ` hjl.tools at gmail dot com
2021-10-16 18:42 ` pinskia at gcc dot gnu.org
2021-10-16 18:43 ` pinskia at gcc dot gnu.org
2021-10-16 18:46 ` [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta " pinskia at gcc dot gnu.org
2021-10-16 19:08 ` hjl.tools at gmail dot com
2021-10-17  0:53 ` hjl.tools at gmail dot com
2021-10-17  2:49 ` hjl.tools at gmail dot com
2021-10-17 13:33 ` hjl.tools at gmail dot com
2021-10-17 18:29 ` hjl.tools at gmail dot com
2021-10-18  6:39 ` rguenth at gcc dot gnu.org
2021-10-18  7:03 ` rguenth at gcc dot gnu.org
2021-10-18  8:26 ` cvs-commit at gcc dot gnu.org
2021-10-18  8:27 ` [Bug tree-optimization/102798] [9/10/11 " rguenth at gcc dot gnu.org
2021-11-08 13:32 ` cvs-commit at gcc dot gnu.org
2022-02-17 10:48 ` [Bug tree-optimization/102798] [9/10 " cvs-commit at gcc dot gnu.org
2022-02-17 11:57 ` [Bug tree-optimization/102798] [9 " cvs-commit at gcc dot gnu.org
2022-02-17 11:58 ` rguenth at gcc dot gnu.org
2022-02-18  7:10 ` rguenth at gcc dot gnu.org
2022-02-18  7:11 ` rguenth at gcc dot gnu.org
2022-02-18  7:13 ` rguenth at gcc dot gnu.org
2022-02-18  8:21 ` rguenth at gcc dot gnu.org
2022-02-18  8:22 ` rguenth 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).