public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/110744] New: [14 regression] cc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72
@ 2023-07-19 16:37 seurer at gcc dot gnu.org
  2023-07-19 22:56 ` [Bug other/110744] " juzhe.zhong at rivai dot ai
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: seurer at gcc dot gnu.org @ 2023-07-19 16:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110744
           Summary: [14 regression] cc.dg/tree-ssa/pr84512.c fails after
                    r14-2267-gb8806f6ffbe72
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

g:b8806f6ffbe72ed8fb7aba3b3a9196ec4d13e614, r14-2267-gb8806f6ffbe72e

make  -k check-gcc RUNTESTFLAGS="tree-ssa.exp=gcc.dg/tree-ssa/pr84512.c"
FAIL: gcc.dg/tree-ssa/pr84512.c scan-tree-dump optimized "return 285;"
# of expected passes            1
# of unexpected failures        1

commit b8806f6ffbe72ed8fb7aba3b3a9196ec4d13e614 (HEAD)
Author: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
Date:   Mon Jul 3 17:10:26 2023 +0800

    Middle-end: Change order of LEN_MASK_LOAD/LEN_MASK_STORE arguments


Hmmm.  There is PR84935 which looks to be the same sort of thing but this just
started occurring for me on powerpc64 with r14-2267-gb8806f6ffbe72.

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

* [Bug other/110744] [14 regression] cc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72
  2023-07-19 16:37 [Bug other/110744] New: [14 regression] cc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72 seurer at gcc dot gnu.org
@ 2023-07-19 22:56 ` juzhe.zhong at rivai dot ai
  2023-07-20  2:11 ` pan2.li at intel dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: juzhe.zhong at rivai dot ai @ 2023-07-19 22:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from JuzheZhong <juzhe.zhong at rivai dot ai> ---
I am really sorry for causing the inconvience.
Working on it.

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

* [Bug other/110744] [14 regression] cc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72
  2023-07-19 16:37 [Bug other/110744] New: [14 regression] cc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72 seurer at gcc dot gnu.org
  2023-07-19 22:56 ` [Bug other/110744] " juzhe.zhong at rivai dot ai
@ 2023-07-20  2:11 ` pan2.li at intel dot com
  2023-07-20  4:04 ` juzhe.zhong at rivai dot ai
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pan2.li at intel dot com @ 2023-07-20  2:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Li Pan <pan2.li at intel dot com> ---
Hi there,

Just try to reproduce this bug with powerPC cross compiler (sorry we don't have
a real powerPC) with the below options. Unfortunately, I failed to reproduce
this bug as above mentioned.

Could you please help to take a look if there is something missing or
incorrect?

1. Build cross compiler

../configure \
  --target=powerpc-unknown-elf \
  --prefix=${INSTALL_DIR} \
  --disable-shared \
  --enable-threads \
  --enable-tls \
  --enable-languages=c,c++ \
  --with-system-zlib \
  --with-newlib \
  --disable-libmudflap \
  --disable-libssp \
  --disable-libquadmath \
  --disable-libgomp \
  --enable-nls \
  --disable-tm-clone-registry \
  --enable-multilib \
  --src=`pwd`/../ \
  --enable-werror \

make -j $(nproc) all-gcc && make install-gcc

2. Compile the source file.

>> ./bin/powerpc-unknown-elf-gcc -mcpu=power10 -O3 -fdump-tree-optimized -c -S ../gcc/gcc/testsuite/gcc.dg/tree-ssa/pr84512.c -o -
        .file   "pr84512.c"
        .machine power10
        .section        ".text"
        .align 2
        .align 4
        .globl foo
        .type   foo, @function
foo:
.LFB0:
        li 3,285
        blr
.LFE0:
        .size   foo, .-foo
        .section        .eh_frame,"aw",@progbits
.Lframe1:
        .4byte  .LECIE1-.LSCIE1
.LSCIE1:
        .4byte  0
        .byte   0x3
        .string ""
        .byte   0x1
        .byte   0x7c
        .byte   0x41
        .byte   0xc
        .byte   0x1
        .byte   0
        .align 2
.LECIE1:
.LSFDE1:
        .4byte  .LEFDE1-.LASFDE1
.LASFDE1:
        .4byte  .LASFDE1-.Lframe1
        .4byte  .LFB0
        .4byte  .LFE0-.LFB0
        .align 2
.LEFDE1:
        .ident  "GCC: (GNU) 14.0.0 20230720 (experimental)"

>> cat pr84512.c.257t.optimized

;; Function foo (foo, funcdef_no=0, decl_uid=3445, cgraph_uid=1,
symbol_order=0)

int foo ()
{
  <bb 2> [local count: 97603129]:
  return 285;

}

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

* [Bug other/110744] [14 regression] cc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72
  2023-07-19 16:37 [Bug other/110744] New: [14 regression] cc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72 seurer at gcc dot gnu.org
  2023-07-19 22:56 ` [Bug other/110744] " juzhe.zhong at rivai dot ai
  2023-07-20  2:11 ` pan2.li at intel dot com
@ 2023-07-20  4:04 ` juzhe.zhong at rivai dot ai
  2023-07-20  4:16 ` linkw at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: juzhe.zhong at rivai dot ai @ 2023-07-20  4:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from JuzheZhong <juzhe.zhong at rivai dot ai> ---
Kewen from IBM will soon send a patch to fix it.
Sorry for causing this issue.

Thanks.

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

* [Bug other/110744] [14 regression] cc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72
  2023-07-19 16:37 [Bug other/110744] New: [14 regression] cc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72 seurer at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-07-20  4:04 ` juzhe.zhong at rivai dot ai
@ 2023-07-20  4:16 ` linkw at gcc dot gnu.org
  2023-07-20  4:20 ` [Bug other/110744] [14 regression] gcc.dg/tree-ssa/pr84512.c " linkw at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: linkw at gcc dot gnu.org @ 2023-07-20  4:16 UTC (permalink / raw)
  To: gcc-bugs

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

Kewen Lin <linkw at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2023-07-20

--- Comment #4 from Kewen Lin <linkw at gcc dot gnu.org> ---
Assigning to myself as discussing with Juzhe.

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

* [Bug other/110744] [14 regression] gcc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72
  2023-07-19 16:37 [Bug other/110744] New: [14 regression] cc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72 seurer at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-07-20  4:16 ` linkw at gcc dot gnu.org
@ 2023-07-20  4:20 ` linkw at gcc dot gnu.org
  2023-07-20  4:22 ` linkw at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: linkw at gcc dot gnu.org @ 2023-07-20  4:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Kewen Lin <linkw at gcc dot gnu.org> ---
(In reply to Li Pan from comment #2)
> Hi there,
> 
> Just try to reproduce this bug with powerPC cross compiler (sorry we don't
> have a real powerPC) with the below options. Unfortunately, I failed to
> reproduce this bug as above mentioned.

Cfarm (https://cfarm.tetaneutral.net/) recently gets one Power10 machine, you
can have a try there. :) But yeah, for this kind of compilation issue, cross
compiler is normally enough.

> 
> Could you please help to take a look if there is something missing or
> incorrect?
> 
> 1. Build cross compiler
> 
> ../configure \
>   --target=powerpc-unknown-elf \

I can reproduce it with --target=powerpc64le-unknown-linux-gnu.

powerpc is 32bit Power, unfortunately lxvl and stxvl (vector with length)
hardware instructions require 64bit GPR (for holding length in some of its high
bits), so partial vector is not enabled there.

>   --prefix=${INSTALL_DIR} \
>   --disable-shared \
>   --enable-threads \
>   --enable-tls \
>   --enable-languages=c,c++ \
>   --with-system-zlib \
>   --with-newlib \
>   --disable-libmudflap \
>   --disable-libssp \
>   --disable-libquadmath \
>   --disable-libgomp \
>   --enable-nls \
>   --disable-tm-clone-registry \
>   --enable-multilib \
>   --src=`pwd`/../ \
>   --enable-werror \
> 
> make -j $(nproc) all-gcc && make install-gcc
>

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

* [Bug other/110744] [14 regression] gcc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72
  2023-07-19 16:37 [Bug other/110744] New: [14 regression] cc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72 seurer at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-07-20  4:20 ` [Bug other/110744] [14 regression] gcc.dg/tree-ssa/pr84512.c " linkw at gcc dot gnu.org
@ 2023-07-20  4:22 ` linkw at gcc dot gnu.org
  2023-07-20  4:25 ` pan2.li at intel dot com
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: linkw at gcc dot gnu.org @ 2023-07-20  4:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Kewen Lin <linkw at gcc dot gnu.org> ---
The root cause is that the length and bias handling about LEN_STORE in sccvn
was missed to be updated, the below diff can fix the failure.

diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc
index 11061a374a2..c0b3ec420c5 100644
--- a/gcc/tree-ssa-sccvn.cc
+++ b/gcc/tree-ssa-sccvn.cc
@@ -3299,11 +3299,14 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void
*data_,
            return (void *)-1;
          break;
        case IFN_LEN_STORE:
-         len = gimple_call_arg (call, 2);
-         bias = gimple_call_arg (call, 4);
-         if (!tree_fits_uhwi_p (len) || !tree_fits_shwi_p (bias))
-           return (void *)-1;
-         break;
+         {
+           int len_index = internal_fn_len_index (fn);
+           len = gimple_call_arg (call, len_index);
+           bias = gimple_call_arg (call, len_index + 1);
+           if (!tree_fits_uhwi_p (len) || !tree_fits_shwi_p (bias))
+             return (void *) -1;
+           break;
+         }
        default:
          return (void *)-1;
        }

Fully testing it.

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

* [Bug other/110744] [14 regression] gcc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72
  2023-07-19 16:37 [Bug other/110744] New: [14 regression] cc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72 seurer at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-07-20  4:22 ` linkw at gcc dot gnu.org
@ 2023-07-20  4:25 ` pan2.li at intel dot com
  2023-07-20  9:57 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pan2.li at intel dot com @ 2023-07-20  4:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Li Pan <pan2.li at intel dot com> ---
Thanks a lot for the explanation, Kewen. 

Looks you are taking care of this already, anything is required from my-side
please feel free to let me know.

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

* [Bug other/110744] [14 regression] gcc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72
  2023-07-19 16:37 [Bug other/110744] New: [14 regression] cc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72 seurer at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-07-20  4:25 ` pan2.li at intel dot com
@ 2023-07-20  9:57 ` rguenth at gcc dot gnu.org
  2023-07-21  5:19 ` cvs-commit at gcc dot gnu.org
  2023-07-21  5:20 ` [Bug tree-optimization/110744] " linkw at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-20  9:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0

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

* [Bug other/110744] [14 regression] gcc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72
  2023-07-19 16:37 [Bug other/110744] New: [14 regression] cc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72 seurer at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2023-07-20  9:57 ` rguenth at gcc dot gnu.org
@ 2023-07-21  5:19 ` cvs-commit at gcc dot gnu.org
  2023-07-21  5:20 ` [Bug tree-optimization/110744] " linkw at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-07-21  5:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Kewen Lin <linkw@gcc.gnu.org>:

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

commit r14-2694-ga6654c08fde11890d621fa7831180d410054568a
Author: Kewen Lin <linkw@linux.ibm.com>
Date:   Fri Jul 21 00:18:19 2023 -0500

    sccvn: Correct the index of bias for IFN_LEN_STORE [PR110744]

    Commit r14-2267-gb8806f6ffbe72e adjusts the arguments order
    of LEN_STORE from {len,vector,bias} to {len,bias,vector},
    in order to make them consistent with LEN_MASK_STORE and
    MASK_STORE.  But it missed to update the related handlings
    in tree-ssa-sccvn.cc, it caused the failure shown in PR
    110744.  This patch is to fix the related handlings with
    the correct index.

            PR tree-optimization/110744

    gcc/ChangeLog:

            * tree-ssa-sccvn.cc (vn_reference_lookup_3): Correct the index of
bias
            operand for ifn IFN_LEN_STORE.

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

* [Bug tree-optimization/110744] [14 regression] gcc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72
  2023-07-19 16:37 [Bug other/110744] New: [14 regression] cc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72 seurer at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2023-07-21  5:19 ` cvs-commit at gcc dot gnu.org
@ 2023-07-21  5:20 ` linkw at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: linkw at gcc dot gnu.org @ 2023-07-21  5:20 UTC (permalink / raw)
  To: gcc-bugs

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

Kewen Lin <linkw at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|other                       |tree-optimization
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #9 from Kewen Lin <linkw at gcc dot gnu.org> ---
Should be fixed on trunk.

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

end of thread, other threads:[~2023-07-21  5:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-19 16:37 [Bug other/110744] New: [14 regression] cc.dg/tree-ssa/pr84512.c fails after r14-2267-gb8806f6ffbe72 seurer at gcc dot gnu.org
2023-07-19 22:56 ` [Bug other/110744] " juzhe.zhong at rivai dot ai
2023-07-20  2:11 ` pan2.li at intel dot com
2023-07-20  4:04 ` juzhe.zhong at rivai dot ai
2023-07-20  4:16 ` linkw at gcc dot gnu.org
2023-07-20  4:20 ` [Bug other/110744] [14 regression] gcc.dg/tree-ssa/pr84512.c " linkw at gcc dot gnu.org
2023-07-20  4:22 ` linkw at gcc dot gnu.org
2023-07-20  4:25 ` pan2.li at intel dot com
2023-07-20  9:57 ` rguenth at gcc dot gnu.org
2023-07-21  5:19 ` cvs-commit at gcc dot gnu.org
2023-07-21  5:20 ` [Bug tree-optimization/110744] " linkw 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).