[Bug target/99829] MVE: ICE in lra_assign at -O3

2024-03-28 Thread thiago.bauermann at linaro dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99829

--- Comment #9 from Thiago Jung Bauermann  
---
Hello Vladimir,

Sorry for the delay in getting back to this.

(In reply to GCC Commits from comment #8)
> The master branch has been updated by Vladimir Makarov
> :
> 
> https://gcc.gnu.org/g:9c91f8a88b2db50c8faf70786d3cef27b39ac9fc
> 
> commit r14-9557-g9c91f8a88b2db50c8faf70786d3cef27b39ac9fc
> Author: Vladimir N. Makarov 
> Date:   Tue Mar 19 16:57:11 2024 -0400
> 
> [PR99829][LRA]: Fixing LRA ICE on arm

I can confirm that the commit fixes this bug. Thank you!

[Bug target/99829] MVE: ICE in lra_assign at -O3

2024-03-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99829

--- Comment #8 from GCC Commits  ---
The master branch has been updated by Vladimir Makarov :

https://gcc.gnu.org/g:9c91f8a88b2db50c8faf70786d3cef27b39ac9fc

commit r14-9557-g9c91f8a88b2db50c8faf70786d3cef27b39ac9fc
Author: Vladimir N. Makarov 
Date:   Tue Mar 19 16:57:11 2024 -0400

[PR99829][LRA]: Fixing LRA ICE on arm

  LRA removed insn setting equivalence to memory whose output was
reloaded. This resulted in writing an uninitiated value to the memory
which triggered assert in LRA code checking the final generated code.
This patch fixes the problem.  Comment in the patch contains more
details about the problem and its solution.

gcc/ChangeLog:

PR target/99829
* lra-constraints.cc (lra_constraints): Prevent removing insn
with reverse equivalence to memory if the memory was reloaded.

[Bug target/99829] MVE: ICE in lra_assign at -O3

2024-03-13 Thread vmakarov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99829

--- Comment #7 from Vladimir Makarov  ---
(In reply to Maxim Kuvyrkov from comment #5)
> 
> Where did you see the timeouts, btw?

Sorry, I glanced at c logs and interpreted it wrongly.  Please, discard my
previous comment.

I should been more accurate with reading the PR.  I've tried c compiler instead
of c++ one.  Therefore I did not reproduce the bug.  But the bug is really
present for c++ compiler.

I'll work on this PR and try to fix this on this or the next week.

[Bug target/99829] MVE: ICE in lra_assign at -O3

2024-03-12 Thread thiago.bauermann at linaro dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99829

--- Comment #6 from Thiago Jung Bauermann  
---
Created attachment 57683
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57683=edit
Preprocessed source file.

I was able to reproduce the ICE on my x86_64 laptop with the following
commands. There's no timeout problem involved.
I'm attaching the Preprocessed source file.

$ mkdir -p ~/.cache/builds/combined-tree-src
$ mkdir -p ~/.cache/builds/combined-tree-arm-eabi
$ cd ~/src/newlib-cygwin && find . -print | cpio -pdlm
~/.cache/builds/combined-tree-src
$ cd ~/src/binutils-gdb && find . -print | cpio -pdlmu
~/.cache/builds/combined-tree-src
$ cd ~/src/gcc && find . -print | cpio -pdlmu ~/.cache/builds/combined-tree-src
$ cd ~/.cache/builds/combined-tree-arm-eabi
$ ../combined-tree-src/configure \
SHELL=/bin/bash \
--with-gnu-as \
--with-gnu-ld \
--disable-libmudflap \
--disable-gdb \
--disable-gprof \
--disable-gprofng \
--enable-lto \
--enable-shared \
--without-included-gettext \
--enable-nls \
--with-system-zlib \
--disable-sjlj-exceptions \
--enable-gnu-unique-object \
--enable-linker-build-id \
--disable-libstdcxx-pch \
--enable-c99 \
--enable-clocale=gnu \
--enable-libstdcxx-debug \
--enable-long-long \
--with-cloog=no \
--with-ppl=no \
--with-isl=no \
--enable-threads=no \
--disable-multiarch \
--disable-multilib \
--with-mode=thumb \
--with-arch=armv8.1-m.main+mve.fp+fp.dp \
--with-float=hard \
--with-sysroot=/tmp/install/arm-eabi \
--with-headers=yes \
--with-native-system-header-dir=/include \
--with-newlib \
--enable-checking=yes \
--disable-bootstrap \
--enable-languages=c,c++,lto \
--prefix=/tmp/install \
--build=x86_64-pc-linux-gnu \
--host=x86_64-pc-linux-gnu \
--target=arm-eabi
$ make \
SHELL=/bin/bash \
-w \
-j 8 \
LDFLAGS_FOR_TARGET=" --specs=rdimon.specs" \
CFLAGS_FOR_BUILD="-pipe -g -O2" \
CXXFLAGS_FOR_BUILD="-pipe -g -O2" \
LDFLAGS_FOR_BUILD="-static-libgcc" \
MAKEINFOFLAGS=--force
$
/home/bauermann/.cache/builds/combined-tree-arm-eabi/gcc/testsuite/g++/../../xg++
\
   
-B/home/bauermann/.cache/builds/combined-tree-arm-eabi/gcc/testsuite/g++/../../
\
   
/home/bauermann/.cache/builds/combined-tree-src/gcc/testsuite/c-c++-common/torture/vshuf-v16qi.c
\
-fdiagnostics-plain-output \
-nostdinc++ \
   
-I/home/bauermann/.cache/builds/combined-tree-arm-eabi/arm-eabi/libstdc++-v3/include/arm-eabi
\
   
-I/home/bauermann/.cache/builds/combined-tree-arm-eabi/arm-eabi/libstdc++-v3/include
\
-I/home/bauermann/.cache/builds/combined-tree-src/libstdc++-v3/libsupc++ \
   
-I/home/bauermann/.cache/builds/combined-tree-src/libstdc++-v3/include/backward
\
   
-I/home/bauermann/.cache/builds/combined-tree-src/libstdc++-v3/testsuite/util \
-fmessage-length=0 \
-O3 \
-g \
-S \
-o vshuf-v16qi.s
during RTL pass: reload
In file included from
/home/bauermann/.cache/builds/combined-tree-src/gcc/testsuite/c-c++-common/torture/vshuf-v16qi.c:5:
/home/bauermann/.cache/builds/combined-tree-src/gcc/testsuite/c-c++-common/torture/vshuf-main.inc:
In function ‘int main()’:
/home/bauermann/.cache/builds/combined-tree-src/gcc/testsuite/c-c++-common/torture/vshuf-main.inc:26:1:
internal compiler error: in lra_assign, at lra-assigns.cc:1657
0x10b2b19 lra_assign(bool&)
../../combined-tree-src/gcc/lra-assigns.cc:1657
0x10acf3f lra(_IO_FILE*, int)
../../combined-tree-src/gcc/lra.cc:2493
0x10617ef do_reload
../../combined-tree-src/gcc/ira.cc:5973
0x10617ef execute
../../combined-tree-src/gcc/ira.cc:6161
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug target/99829] MVE: ICE in lra_assign at -O3

2024-03-12 Thread mkuvyrkov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99829

--- Comment #5 from Maxim Kuvyrkov  ---
Hi Vladimir,

The email you got from Linaro CI was about tests the ICE changing "names" due
to assert in lra-assigns.cc changing line numbers.  E.g.,
FAIL: c-c++-common/torture/vshuf-v16qi.c -O3 -g  (internal compiler error: in
lra_assign, at lra-assigns.cc:1651)
... becoming ...
FAIL: c-c++-common/torture/vshuf-v16qi.c -O3 -g  (internal compiler error: in
lra_assign, at lra-assigns.cc:1657)
These are not real regressions, and that report can be ignored.

This PR though, is about fixing the ICE triggered by this test.  We are seeing
the ICEs using these configure options:
https://ci.linaro.org/job/tcwg_gnu_embed_check_gcc--master-thumb_m55_hard_eabi-build/lastSuccessfulBuild/artifact/artifacts/notify/configure-make.txt/*view*/
.

Where did you see the timeouts, btw?

[Bug target/99829] MVE: ICE in lra_assign at -O3

2024-03-12 Thread vmakarov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99829

--- Comment #4 from Vladimir Makarov  ---
(In reply to Maxim Kuvyrkov from comment #3)
> Hi Vladimir,
> 
> Could you take a look at this, please?

I already got a message from automatic linaro tester yesterday about the new
test failures and looked at them.

I was not able to reproduce them but after I looked at the provided log files. 
I see that the tests failed because of timeout.

My recent patch resulted in LRA doing a bit more job and therefore the tests
(all with -O3) failed because of the timeout.

I'd recommend to increase the timeout threshold for the tester.

[Bug target/99829] MVE: ICE in lra_assign at -O3

2024-03-12 Thread mkuvyrkov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99829

Maxim Kuvyrkov  changed:

   What|Removed |Added

 CC||vmakarov at gcc dot gnu.org

--- Comment #3 from Maxim Kuvyrkov  ---
Hi Vladimir,

Could you take a look at this, please?

[Bug target/99829] MVE: ICE in lra_assign at -O3

2024-03-12 Thread thiago.bauermann at linaro dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99829

Thiago Jung Bauermann  changed:

   What|Removed |Added

 CC||thiago.bauermann at linaro dot 
org

--- Comment #2 from Thiago Jung Bauermann  
---
We are still seeing this ICE in the Linaro CI:

spawn -ignore SIGHUP /path/to/install/bin/arm-eabi-g++
/path/to/gcc.git/gcc/testsuite/c-c++-common/torture/vshuf-v16qi.c -mthumb
-march=armv8.1-m.main+mve.fp+fp.dp -mtune=cortex-m55 -mfloat-abi=hard
-mfpu=auto -fdiagnostics-plain-output -nostdinc++
-I/path/to/builds/x86_64-pc-linux-gnu/arm-eabi/gcc-gcc.git~master-stage2/arm-eabi/libstdc++-v3/include/arm-eabi
-I/path/to/builds/x86_64-pc-linux-gnu/arm-eabi/gcc-gcc.git~master-stage2/arm-eabi/libstdc++-v3/include
-I/path/to/gcc.git/libstdc++-v3/libsupc++
-I/path/to/gcc.git/libstdc++-v3/include/backward
-I/path/to/gcc.git/libstdc++-v3/testsuite/util -fmessage-length=0 -O3 -g -S -o
vshuf-v16qi.s
during RTL pass: reload
In file included from
/path/to/gcc.git/gcc/testsuite/c-c++-common/torture/vshuf-v16qi.c:5:
/path/to/gcc.git/gcc/testsuite/c-c++-common/torture/vshuf-main.inc: In function
'int main()':
/path/to/gcc.git/gcc/testsuite/c-c++-common/torture/vshuf-main.inc:26:1:
internal compiler error: in lra_assign, at lra-assigns.cc:1657
0x10c07d1 lra_assign(bool&)
../../../../../../gcc/gcc/lra-assigns.cc:1657
0x10ba784 lra(_IO_FILE*, int)
../../../../../../gcc/gcc/lra.cc:2493
0x106fa8f do_reload
../../../../../../gcc/gcc/ira.cc:5973
0x106fa8f execute
../../../../../../gcc/gcc/ira.cc:6161
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
compiler exited with status 1

This is with trunk from March 8, commit cebbaa2a8458 ("[PR113790][LRA]: Fixing
LRA ICE on riscv64")

The same problem also happens in other related tests:

FAIL: c-c++-common/torture/vshuf-v2di.c -O3 -g  (internal compiler error: in
lra_assign, at lra-assigns.cc:1657)
FAIL: c-c++-common/torture/vshuf-v4sf.c -O3 -g  (internal compiler error: in
lra_assign, at lra-assigns.cc:1657)
FAIL: c-c++-common/torture/vshuf-v4si.c -O3 -g  (internal compiler error: in
lra_assign, at lra-assigns.cc:1657)
FAIL: c-c++-common/torture/vshuf-v8hi.c -O3 -g  (internal compiler error: in
lra_assign, at lra-assigns.cc:1657)

GCC is configured with:

/path/to/gcc.git/configure \
SHELL=/bin/bash \
--with-mpc=/path/to/install \
--with-mpfr=/path/to/install \
--with-gmp=/path/to/install \
--with-gnu-as \
--with-gnu-ld \
--disable-libmudflap \
--enable-lto \
--enable-shared \
--without-included-gettext \
--enable-nls \
--with-system-zlib \
--disable-sjlj-exceptions \
--enable-gnu-unique-object \
--enable-linker-build-id \
--disable-libstdcxx-pch \
--enable-c99 \
--enable-clocale=gnu \
--enable-libstdcxx-debug \
--enable-long-long \
--with-cloog=no \
--with-ppl=no \
--with-isl=no \
--enable-threads=no \
--disable-multiarch \
--disable-multilib \
--with-mode=thumb \
--with-arch=armv8.1-m.main+mve.fp+fp.dp \
--with-float=hard \
--with-sysroot=/path/to/install/arm-eabi \
--with-headers=yes \
--with-native-system-header-dir=/include \
--with-newlib \
--enable-checking=yes \
--disable-bootstrap \
--enable-languages=c,c++,lto \
--prefix=/path/to/install \
--build=x86_64-pc-linux-gnu \
--host=x86_64-pc-linux-gnu \
--target=arm-eabi

[Bug target/99829] MVE: ICE in lra_assign at -O3

2021-04-13 Thread acoplan at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99829

--- Comment #1 from Alex Coplan  ---
This one:

int a, b, c;
int d() {
  long e[210] = {};
  long long f[9][1];
  long g = c = 0;
  for (; c < 9; c++)
f[c][0] = 9;
  if (f[4][0]) {
long h = (int)
a = h;
if (b)
  return (int)e;
  }
}

fails in the same way with -march=armv8.1-m.main+mve -mfloat-abi=hard -O
-ftree-vectorize -mpure-code -funroll-all-loops.