public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/108250] New: [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb
@ 2022-12-28 23:35 sam at gentoo dot org
  2022-12-28 23:55 ` [Bug c/108250] " sam at gentoo dot org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: sam at gentoo dot org @ 2022-12-28 23:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108250
           Summary: [12/13 regression] llvm-tblgen miscompiled on
                    powerpc-unknown-linux-gnu since
                    r12-5383-g22c242342e38eb
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sam at gentoo dot org
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---
              Host: powerpc-unknown-linux-gnu
            Target: powerpc-unknown-linux-gnu
             Build: powerpc-unknown-linux-gnu

Originally reported downstream in Gentoo at https://bugs.gentoo.org/880677. I
forwarded it to LLVM at https://github.com/llvm/llvm-project/issues/59698 too.

With GCC 12 and newer, llvm-tblgen (which is built as part of the LLVM build
process and used for part of the build) is miscompiled on
powerpc-unknown-linux-gnu. GCC 11 and older are fine.

It has two failure modes:
1. When producing a description for the PPC target in LLVM as:
```
bin/llvm-tblgen -I ~/llvm-project/llvm/lib/TargetPowerPC \
                -I ~/llvm-project/llvm/include/ \
                -I ~/llvm-project/llvm/lib/Target/PowerPC/ \
                ~/llvm-project/llvm/lib/Target/PowerPC/PPC.td \
                -o /dev/null \
                --gen-dag-isel \
                -d /dev/null \
                --time-phases \
                --write-if-changed
```
it'll regularly hang (not on all runs, but if you run it 10 times, it'll hang
for several of them).
2. For X86, it'll give invalid output which later causes the LLVM compilation
to fail.

For the purposes of tracking down which GCC commit caused it, we bisected by
checking for timeouts in a loop. The result was r12-5383-g22c242342e38eb.

Reverting 22c242342e38ebffa6bbf7e86e7a1e4abdf0d686 on top of releases/gcc-12
(at a3fbfc1027e9edcd14bb290b5702504d80d9e8fe) results in a built llvm-tblgen
which doesn't hang.

Please let me know what further information you require. Access to the
environment is also available (it's purely a testing machine for this kind of
bug, no personal data on it).

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

* [Bug c/108250] [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb
  2022-12-28 23:35 [Bug c/108250] New: [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb sam at gentoo dot org
@ 2022-12-28 23:55 ` sam at gentoo dot org
  2022-12-29  0:04 ` sam at gentoo dot org
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: sam at gentoo dot org @ 2022-12-28 23:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Sam James <sam at gentoo dot org> ---
GCC built at releases/gcc-12 at a3fbfc1027e9edcd14bb290b5702504d80d9e8fe with a
revert of 22c242342e38ebffa6bbf7e86e7a1e4abdf0d686 which produces a working
llvm-tblgen:
```
$ gcc-12 -V
Using built-in specs.
COLLECT_GCC=gcc-12
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/powerpc-unknown-linux-gnu/12/lto-wrapper
Target: powerpc-unknown-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-12.3.9999/work/gcc-12.3.9999/configure
--host=powerpc-unknown-linux-gnu --build=powerpc-unknown-linux-gnu
--prefix=/usr --bindir=/usr/powerpc-unknown-linux-gnu/gcc-bin/12
--includedir=/usr/lib/gcc/powerpc-unknown-linux-gnu/12/include
--datadir=/usr/share/gcc-data/powerpc-unknown-linux-gnu/12
--mandir=/usr/share/gcc-data/powerpc-unknown-linux-gnu/12/man
--infodir=/usr/share/gcc-data/powerpc-unknown-linux-gnu/12/info
--with-gxx-include-dir=/usr/lib/gcc/powerpc-unknown-linux-gnu/12/include/g++-v12
--with-python-dir=/share/gcc-data/powerpc-unknown-linux-gnu/12/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--disable-libunwind-exceptions --enable-checking=release
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 12.2.1, commit
a00a9de1ca2ed3d1740715a1a4824908350b21c0' --with-gcc-major-version-only
--disable-esp --enable-libstdcxx-time --disable-libstdcxx-pch --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--disable-multilib --disable-fixed-point --enable-targets=all --enable-libgomp
--disable-libssp --disable-libada --disable-cet --disable-systemtap
--disable-valgrind-annotations --disable-vtable-verify --disable-libvtv
--without-zstd --enable-lto --without-isl --enable-default-pie
--enable-default-ssp --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.2.1 20221227 (Gentoo 12.2.1, commit
a00a9de1ca2ed3d1740715a1a4824908350b21c0)
```

GCC built at releases/gcc-12 at a3fbfc1027e9edcd14bb290b5702504d80d9e8fe which
produces a broken llvm-tblgen:
```
$ gcc-12 -V
Using built-in specs.
COLLECT_GCC=gcc-12
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/powerpc-unknown-linux-gnu/12/lto-wrapper
Target: powerpc-unknown-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-12.3.9999/work/gcc-12.3.9999/configure
--host=powerpc-unknown-linux-gnu --build=powerpc-unknown-linux-gnu
--prefix=/usr --bindir=/usr/powerpc-unknown-linux-gnu/gcc-bin/12
--includedir=/usr/lib/gcc/powerpc-unknown-linux-gnu/12/include
--datadir=/usr/share/gcc-data/powerpc-unknown-linux-gnu/12
--mandir=/usr/share/gcc-data/powerpc-unknown-linux-gnu/12/man
--infodir=/usr/share/gcc-data/powerpc-unknown-linux-gnu/12/info
--with-gxx-include-dir=/usr/lib/gcc/powerpc-unknown-linux-gnu/12/include/g++-v12
--with-python-dir=/share/gcc-data/powerpc-unknown-linux-gnu/12/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--disable-libunwind-exceptions --enable-checking=release
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 12.2.1, commit
a3fbfc1027e9edcd14bb290b5702504d80d9e8fe' --with-gcc-major-version-only
--disable-esp --enable-libstdcxx-time --disable-libstdcxx-pch --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--disable-multilib --disable-fixed-point --enable-targets=all --enable-libgomp
--disable-libssp --disable-libada --disable-cet --disable-systemtap
--disable-valgrind-annotations --disable-vtable-verify --disable-libvtv
--without-zstd --enable-lto --without-isl --enable-default-pie
--enable-default-ssp --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.2.1 20221227 (Gentoo 12.2.1, commit
a3fbfc1027e9edcd14bb290b5702504d80d9e8fe)
```

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

* [Bug c/108250] [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb
  2022-12-28 23:35 [Bug c/108250] New: [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb sam at gentoo dot org
  2022-12-28 23:55 ` [Bug c/108250] " sam at gentoo dot org
@ 2022-12-29  0:04 ` sam at gentoo dot org
  2022-12-29  0:06 ` sam at gentoo dot org
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: sam at gentoo dot org @ 2022-12-29  0:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Sam James <sam at gentoo dot org> ---
LLVM build with working llvm-tblgen (with gcc revert as described above):
https://dev.gentoo.org/~sam/bugs/gcc/gcc-llvm-tblgen-ppc/bisect-maybe-broken-2022-12-28-no-hang-revert.tar.xz

LLVM build with broken llvm-tblgen (at releases/gcc-12 as described above):
https://dev.gentoo.org/~sam/bugs/gcc/gcc-llvm-tblgen-ppc/bisect-maybe-broken-2022-12-28-hangs.tar.xz

Within both tarballs, the bad binary is at bin/llvm-tblgen.

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

* [Bug c/108250] [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb
  2022-12-28 23:35 [Bug c/108250] New: [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb sam at gentoo dot org
  2022-12-28 23:55 ` [Bug c/108250] " sam at gentoo dot org
  2022-12-29  0:04 ` sam at gentoo dot org
@ 2022-12-29  0:06 ` sam at gentoo dot org
  2022-12-29  2:13 ` [Bug ipa/108250] " pinskia at gcc dot gnu.org
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: sam at gentoo dot org @ 2022-12-29  0:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Sam James <sam at gentoo dot org> ---
Flags used to build LLVM:
export FFLAGS='-O2 -mcpu=powerpc -mtune=powerpc -pipe'
export CXXFLAGS='-O2 -mcpu=powerpc -mtune=powerpc -pipe -ggdb
-D_GLIBCXX_ASSERTIONS=1'
export LDFLAGS='-Wl,-O1 -Wl,--as-needed'
export FCFLAGS='-O2 -mcpu=powerpc -mtune=powerpc -pipe'
export CFLAGS='-O2 -mcpu=powerpc -mtune=powerpc -pipe -ggdb'

LLVM was built at llvm-project.git commit
a4e3457fb752d675c58fb14a3d8ed03fe218b6b0
for the bisect.

_GLIBCXX_ASSERTIONS seemed to make the miscompilation more likely, anecdotally,
but
the original bug reported in Gentoo didn't have this set, and I reproduced the
hang
without it. But it seems more likely to happen when it's set.

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

* [Bug ipa/108250] [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb
  2022-12-28 23:35 [Bug c/108250] New: [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb sam at gentoo dot org
                   ` (2 preceding siblings ...)
  2022-12-29  0:06 ` sam at gentoo dot org
@ 2022-12-29  2:13 ` pinskia at gcc dot gnu.org
  2022-12-29  2:48 ` sam at gentoo dot org
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-12-29  2:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-12-29
             Status|UNCONFIRMED                 |WAITING

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Do you know which object file inside llvm-tblgen is being miscompiled?
You can do a binary search on object files and then provide the preprocessed
source for that one.

Also could you reproduce the miscompiling with reverting and with
-fdump-ipa-all ? I suspect you could ...

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

* [Bug ipa/108250] [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb
  2022-12-28 23:35 [Bug c/108250] New: [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb sam at gentoo dot org
                   ` (3 preceding siblings ...)
  2022-12-29  2:13 ` [Bug ipa/108250] " pinskia at gcc dot gnu.org
@ 2022-12-29  2:48 ` sam at gentoo dot org
  2022-12-29  3:14 ` sam at gentoo dot org
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: sam at gentoo dot org @ 2022-12-29  2:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Sam James <sam at gentoo dot org> ---
(In reply to Andrew Pinski from comment #4)
> Do you know which object file inside llvm-tblgen is being miscompiled?
> You can do a binary search on object files and then provide the preprocessed
> source for that one.

Will try find out.

> 
> Also could you reproduce the miscompiling with reverting and with
> -fdump-ipa-all ? I suspect you could ...

No, interestingly, it works (no hangs) if I use -fdump-ipa-all in the flags to
build LLVM. I double checked as I was a bit surprised.

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

* [Bug ipa/108250] [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb
  2022-12-28 23:35 [Bug c/108250] New: [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb sam at gentoo dot org
                   ` (4 preceding siblings ...)
  2022-12-29  2:48 ` sam at gentoo dot org
@ 2022-12-29  3:14 ` sam at gentoo dot org
  2022-12-29 16:54 ` arsen at aarsen dot me
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: sam at gentoo dot org @ 2022-12-29  3:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Sam James <sam at gentoo dot org> ---
For completeness, I should note, because some commits couldn't be built (only a
handful), git said (I've converted the commits) that it could be any of:
r12-5382-g616ca1024a79c6
r12-5383-g22c242342e38eb
r12-5381-g53c964ad996a1b
r12-5384-g3535be6c6f4409
r12-5380-g75ac95f6647367
r12-5385-g6f4ac4f81f89ca

I then verified it's r12-5383-g22c242342e38eb by going back to releases/gcc-12
and retrying a few times by applying/reverting it, but maybe there's something
useful in this list anyway.

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

* [Bug ipa/108250] [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb
  2022-12-28 23:35 [Bug c/108250] New: [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb sam at gentoo dot org
                   ` (5 preceding siblings ...)
  2022-12-29  3:14 ` sam at gentoo dot org
@ 2022-12-29 16:54 ` arsen at aarsen dot me
  2022-12-29 17:22 ` arsen at aarsen dot me
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: arsen at aarsen dot me @ 2022-12-29 16:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Arsen Arsenović <arsen at aarsen dot me> ---
Created attachment 54165
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54165&action=edit
hang-testing script

With the attached script, I singled out
utils/TableGen/CMakeFiles/llvm-tblgen.dir/CodeGenDAGPatterns.cpp.o.  For
context, bisect-maybe-broken-2022-12-28-hangs is a build directory that
contains files built with the "bad" gcc version (in this instance, GCC: (Gentoo
12.2.1, commit a3fbfc1027e9edcd14bb290b5702504d80d9e8fe) 12.2.1 20221227),
which causes tblgen to run for longer than one minute and then get timed out
(whereas it normally exits within five seconds).

I also find it quite odd that -fdump-ipa-all didn't cause the build to
reproduce before the revert.  I can definitely see a bunch of IPA-pass dump
files in the build directory

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

* [Bug ipa/108250] [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb
  2022-12-28 23:35 [Bug c/108250] New: [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb sam at gentoo dot org
                   ` (6 preceding siblings ...)
  2022-12-29 16:54 ` arsen at aarsen dot me
@ 2022-12-29 17:22 ` arsen at aarsen dot me
  2023-01-02  3:44 ` pinskia at gcc dot gnu.org
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: arsen at aarsen dot me @ 2022-12-29 17:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Arsen Arsenović <arsen at aarsen dot me> ---
Created attachment 54166
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54166&action=edit
xz'd preprocessed CodeGenDagPatterns.cpp

Cmdline: [220/231] /usr/bin/g++-12 -DGTEST_HAS_RTTI=0 -D_FILE_OFFSET_BITS=64
-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-I/root/llvm-project/bisect-maybe-broken/utils/TableGen
-I/root/llvm-project/llvm/utils/TableGen
-I/root/llvm-project/bisect-maybe-broken/include
-I/root/llvm-project/llvm/include -O2 -mcpu=powerpc -mtune=powerpc -pipe -ggdb
-D_GLIBCXX_ASSERTIONS=1 -fPIC -fno-semantic-interposition
-fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra
-Wno-unused-parameter -Wwrite-strings -Wcast-qual
-Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough
-Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move
-Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor
-Wsuggest-override -Wno-comment -Wno-misleading-indentation
-Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections
-fdata-sections -O2 -g -DNDEBUG  -fno-exceptions -fno-rtti -std=c++17
-save-temps=cwd -MD -MT
utils/TableGen/CMakeFiles/llvm-tblgen.dir/CodeGenDAGPatterns.cpp.o -MF
utils/TableGen/CMakeFiles/llvm-tblgen.dir/CodeGenDAGPatterns.cpp.o.d -o
utils/TableGen/CMakeFiles/llvm-tblgen.dir/CodeGenDAGPatterns.cpp.o -c
/root/llvm-project/llvm/utils/TableGen/CodeGenDAGPatterns.cpp

This is preprocessed by the version with a revert, so the produced assembly
does work, but I have doubts that this matters (copying in the compile from the
bad case and linking against these files still acts like the bad case).

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

* [Bug ipa/108250] [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb
  2022-12-28 23:35 [Bug c/108250] New: [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb sam at gentoo dot org
                   ` (7 preceding siblings ...)
  2022-12-29 17:22 ` arsen at aarsen dot me
@ 2023-01-02  3:44 ` pinskia at gcc dot gnu.org
  2023-01-02  3:46 ` pinskia at gcc dot gnu.org
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-02  3:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |UNCONFIRMED
     Ever confirmed|1                           |0

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

* [Bug ipa/108250] [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb
  2022-12-28 23:35 [Bug c/108250] New: [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb sam at gentoo dot org
                   ` (8 preceding siblings ...)
  2023-01-02  3:44 ` pinskia at gcc dot gnu.org
@ 2023-01-02  3:46 ` pinskia at gcc dot gnu.org
  2023-01-03  1:18 ` sam at gentoo dot org
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-02  3:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
There is one more thing to test -fno-lifetime-dse .

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

* [Bug ipa/108250] [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb
  2022-12-28 23:35 [Bug c/108250] New: [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb sam at gentoo dot org
                   ` (9 preceding siblings ...)
  2023-01-02  3:46 ` pinskia at gcc dot gnu.org
@ 2023-01-03  1:18 ` sam at gentoo dot org
  2023-01-09 14:09 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: sam at gentoo dot org @ 2023-01-03  1:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Sam James <sam at gentoo dot org> ---
Both Arsen and I gave it a go and it doesn't seem to make a difference either
way (it doesn't induce miscompilation with the revert, and it doesn't fix
miscompilation without the revert).

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

* [Bug ipa/108250] [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb
  2022-12-28 23:35 [Bug c/108250] New: [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb sam at gentoo dot org
                   ` (10 preceding siblings ...)
  2023-01-03  1:18 ` sam at gentoo dot org
@ 2023-01-09 14:09 ` rguenth at gcc dot gnu.org
  2023-01-13 16:59 ` segher at gcc dot gnu.org
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-09 14:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.3

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

* [Bug ipa/108250] [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb
  2022-12-28 23:35 [Bug c/108250] New: [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb sam at gentoo dot org
                   ` (11 preceding siblings ...)
  2023-01-09 14:09 ` rguenth at gcc dot gnu.org
@ 2023-01-13 16:59 ` segher at gcc dot gnu.org
  2023-03-27 12:27 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: segher at gcc dot gnu.org @ 2023-01-13 16:59 UTC (permalink / raw)
  To: gcc-bugs

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

Segher Boessenkool <segher at gcc dot gnu.org> changed:

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

--- Comment #11 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Please figure out what code is miscompiled?  And then get us a reproducer?
Without that, it is just "my program does not do what I want it to"...

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

* [Bug ipa/108250] [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb
  2022-12-28 23:35 [Bug c/108250] New: [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb sam at gentoo dot org
                   ` (12 preceding siblings ...)
  2023-01-13 16:59 ` segher at gcc dot gnu.org
@ 2023-03-27 12:27 ` rguenth at gcc dot gnu.org
  2023-05-08 12:26 ` [Bug ipa/108250] [12/13/14 " rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-03-27 12:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
     Ever confirmed|0                           |1
   Last reconfirmed|2022-12-29 00:00:00         |2023-03-27

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

* [Bug ipa/108250] [12/13/14 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb
  2022-12-28 23:35 [Bug c/108250] New: [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb sam at gentoo dot org
                   ` (13 preceding siblings ...)
  2023-03-27 12:27 ` rguenth at gcc dot gnu.org
@ 2023-05-08 12:26 ` rguenth at gcc dot gnu.org
  2023-05-14 12:06 ` arsen at gcc dot gnu.org
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-05-08 12:26 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|12.3                        |12.4

--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 12.3 is being released, retargeting bugs to GCC 12.4.

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

* [Bug ipa/108250] [12/13/14 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb
  2022-12-28 23:35 [Bug c/108250] New: [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb sam at gentoo dot org
                   ` (14 preceding siblings ...)
  2023-05-08 12:26 ` [Bug ipa/108250] [12/13/14 " rguenth at gcc dot gnu.org
@ 2023-05-14 12:06 ` arsen at gcc dot gnu.org
  2024-03-28  3:27 ` [Bug ipa/108250] [12/13 " sjames at gcc dot gnu.org
  2024-03-28  3:31 ` sjames at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: arsen at gcc dot gnu.org @ 2023-05-14 12:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
as an update, we've recently gotten valgrind working on a ppc32 machine, and we
get the following:

==2738== Conditional jump or move depends on uninitialised value(s)
==2738==    at 0x17E55C: __eq (tuple:1472)
==2738==    by 0x17E55C: operator==<bool, bool, bool, bool> (tuple:1504)
==2738==    by 0x17E55C: operator!=<bool, bool, bool, bool> (tuple:1553)
==2738==    by 0x17E55C:
llvm::TypeInfer::EnforceSmallerThan(llvm::TypeSetByHwMode&,
llvm::TypeSetByHwMode&, bool)::{lambda(llvm::MVT,
llvm::MVT)#4}::operator()(llvm::MVT, llvm::MVT) const [clone .constprop.0]
(CodeGenDAGPatterns.cpp:556)
==2738==    by 0x180E9F: __invoke_impl<bool,
llvm::TypeInfer::EnforceSmallerThan(llvm::TypeSetByHwMode&,
llvm::TypeSetByHwMode&, bool)::<lambda(llvm::MVT, llvm::MVT)>&, llvm::MVT&,
llvm::MVT&> (invoke.h:61)
==2738==    by 0x180E9F:
__invoke<llvm::TypeInfer::EnforceSmallerThan(llvm::TypeSetByHwMode&,
llvm::TypeSetByHwMode&, bool)::<lambda(llvm::MVT, llvm::MVT)>&, llvm::MVT&,
llvm::MVT&> (invoke.h:96)
==2738==    by 0x180E9F: __call<bool, llvm::MVT&, 0, 1> (functional:495)
==2738==    by 0x180E9F: operator()<llvm::MVT&> (functional:580)
==2738==    by 0x180E9F: bool
berase_if<std::_Bind<llvm::TypeInfer::EnforceSmallerThan(llvm::TypeSetByHwMode&,
llvm::TypeSetByHwMode&, bool)::{lambda(llvm::MVT, llvm::MVT)#4}
(std::_Placeholder<1>, llvm::MVT)> >(llvm::MachineValueTypeSet&,
std::_Bind<llvm::TypeInfer::EnforceSmallerThan(llvm::TypeSetByHwMode&,
llvm::TypeSetByHwMode&, bool)::{lambda(llvm::MVT, llvm::MVT)#4}
(std::_Placeholder<1>, llvm::MVT)>) (CodeGenDAGPatterns.cpp:59)
==2738==    by 0x199113:
llvm::TypeInfer::EnforceSmallerThan(llvm::TypeSetByHwMode&,
llvm::TypeSetByHwMode&, bool) [clone .part.0] (CodeGenDAGPatterns.cpp:573)
==2738==    by 0x1A4013: ApplyTypeConstraint (CodeGenDAGPatterns.cpp:1641)
==2738==    by 0x1A4013: ApplyTypeConstraints (CodeGenDAGPatterns.h:1269)
==2738==    by 0x1A4013:
llvm::TreePatternNode::ApplyTypeConstraints(llvm::TreePattern&, bool)
(CodeGenDAGPatterns.cpp:2564)
==2738==    by 0x1A4DFB:
llvm::TreePattern::InferAllTypes(llvm::StringMap<llvm::SmallVector<llvm::TreePatternNode*,
1u>, llvm::MallocAllocator> const*) (CodeGenDAGPatterns.cpp:3094)
==2738==    by 0x1AE02F: llvm::CodeGenDAGPatterns::ParsePatternFragments(bool)
(CodeGenDAGPatterns.cpp:3352)
==2738==    by 0x1AE893:
llvm::CodeGenDAGPatterns::CodeGenDAGPatterns(llvm::RecordKeeper&,
std::function<void (llvm::TreePattern*)>) (CodeGenDAGPatterns.cpp:3195)
==2738==    by 0x2CF00B: GlobalISelEmitter (GlobalISelEmitter.cpp:3809)
==2738==    by 0x2CF00B: llvm::EmitGlobalISel(llvm::RecordKeeper&,
llvm::raw_ostream&) (GlobalISelEmitter.cpp:6312)
==2738==    by 0x352E1F: (anonymous
namespace)::LLVMTableGenMain(llvm::raw_ostream&, llvm::RecordKeeper&)
(TableGen.cpp:251)
==2738==    by 0x3E8447: llvm::TableGenMain(char const*, bool
(*)(llvm::raw_ostream&, llvm::RecordKeeper&)) (Main.cpp:122)
==2738==    by 0x134BD7: main (TableGen.cpp:296)
==2738== 
==2738== Conditional jump or move depends on uninitialised value(s)
==2738==    at 0x17E55C: __eq (tuple:1472)
==2738==    by 0x17E55C: operator==<bool, bool, bool, bool> (tuple:1504)
==2738==    by 0x17E55C: operator!=<bool, bool, bool, bool> (tuple:1553)
==2738==    by 0x17E55C:
llvm::TypeInfer::EnforceSmallerThan(llvm::TypeSetByHwMode&,
llvm::TypeSetByHwMode&, bool)::{lambda(llvm::MVT,
llvm::MVT)#4}::operator()(llvm::MVT, llvm::MVT) const [clone .constprop.0]
(CodeGenDAGPatterns.cpp:556)
==2738==    by 0x1810FF: __invoke_impl<bool,
llvm::TypeInfer::EnforceSmallerThan(llvm::TypeSetByHwMode&,
llvm::TypeSetByHwMode&, bool)::<lambda(llvm::MVT, llvm::MVT)>&, llvm::MVT&,
llvm::MVT&> (invoke.h:61)
==2738==    by 0x1810FF:
__invoke<llvm::TypeInfer::EnforceSmallerThan(llvm::TypeSetByHwMode&,
llvm::TypeSetByHwMode&, bool)::<lambda(llvm::MVT, llvm::MVT)>&, llvm::MVT&,
llvm::MVT&> (invoke.h:96)
==2738==    by 0x1810FF: __call<bool, llvm::MVT&, 0, 1> (functional:495)
==2738==    by 0x1810FF: operator()<llvm::MVT&> (functional:580)
==2738==    by 0x1810FF: bool
berase_if<std::_Bind<llvm::TypeInfer::EnforceSmallerThan(llvm::TypeSetByHwMode&,
llvm::TypeSetByHwMode&, bool)::{lambda(llvm::MVT, llvm::MVT)#4} (llvm::MVT,
std::_Placeholder<1>)> >(llvm::MachineValueTypeSet&,
std::_Bind<llvm::TypeInfer::EnforceSmallerThan(llvm::TypeSetByHwMode&,
llvm::TypeSetByHwMode&, bool)::{lambda(llvm::MVT, llvm::MVT)#4} (llvm::MVT,
std::_Placeholder<1>)>) (CodeGenDAGPatterns.cpp:59)
==2738==    by 0x19919B:
llvm::TypeInfer::EnforceSmallerThan(llvm::TypeSetByHwMode&,
llvm::TypeSetByHwMode&, bool) [clone .part.0] (CodeGenDAGPatterns.cpp:580)
==2738==    by 0x1A4013: ApplyTypeConstraint (CodeGenDAGPatterns.cpp:1641)
==2738==    by 0x1A4013: ApplyTypeConstraints (CodeGenDAGPatterns.h:1269)
==2738==    by 0x1A4013:
llvm::TreePatternNode::ApplyTypeConstraints(llvm::TreePattern&, bool)
(CodeGenDAGPatterns.cpp:2564)
==2738==    by 0x1A4DFB:
llvm::TreePattern::InferAllTypes(llvm::StringMap<llvm::SmallVector<llvm::TreePatternNode*,
1u>, llvm::MallocAllocator> const*) (CodeGenDAGPatterns.cpp:3094)
==2738==    by 0x1AE02F: llvm::CodeGenDAGPatterns::ParsePatternFragments(bool)
(CodeGenDAGPatterns.cpp:3352)
==2738==    by 0x1AE893:
llvm::CodeGenDAGPatterns::CodeGenDAGPatterns(llvm::RecordKeeper&,
std::function<void (llvm::TreePattern*)>) (CodeGenDAGPatterns.cpp:3195)
==2738==    by 0x2CF00B: GlobalISelEmitter (GlobalISelEmitter.cpp:3809)
==2738==    by 0x2CF00B: llvm::EmitGlobalISel(llvm::RecordKeeper&,
llvm::raw_ostream&) (GlobalISelEmitter.cpp:6312)
==2738==    by 0x352E1F: (anonymous
namespace)::LLVMTableGenMain(llvm::raw_ostream&, llvm::RecordKeeper&)
(TableGen.cpp:251)
==2738==    by 0x3E8447: llvm::TableGenMain(char const*, bool
(*)(llvm::raw_ostream&, llvm::RecordKeeper&)) (Main.cpp:122)
==2738==    by 0x134BD7: main (TableGen.cpp:296)


(and a few similar diagnostics)

these do not happen on x86 and there seems to be no conditional compilation.

I'll try to finish up a reduction soon, but I've been swamped as of late.  I
have a reduction that deoptimized most code, leaving us with just a few
functions still being optimized, while still reproducing the bug, so that might
shed some light too.

presuming that some bit of GCC decided to remove a store that'd initialize
those values, any hint on how to see what?

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

* [Bug ipa/108250] [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb
  2022-12-28 23:35 [Bug c/108250] New: [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb sam at gentoo dot org
                   ` (15 preceding siblings ...)
  2023-05-14 12:06 ` arsen at gcc dot gnu.org
@ 2024-03-28  3:27 ` sjames at gcc dot gnu.org
  2024-03-28  3:31 ` sjames at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-03-28  3:27 UTC (permalink / raw)
  To: gcc-bugs

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

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[12/13/14 regression]       |[12/13 regression]
                   |llvm-tblgen miscompiled on  |llvm-tblgen miscompiled on
                   |powerpc-unknown-linux-gnu   |powerpc-unknown-linux-gnu
                   |since                       |since
                   |r12-5383-g22c242342e38eb    |r12-5383-g22c242342e38eb
           See Also|                            |https://bugs.gentoo.org/sho
                   |                            |w_bug.cgi?id=880677,
                   |                            |https://bugs.gentoo.org/sho
                   |                            |w_bug.cgi?id=875776

--- Comment #14 from Sam James <sjames at gcc dot gnu.org> ---
This seems "fixed" by r14-1909-g5a1ef1cfac0053. As a workaround, -fno-ipa-sra
-fno-ipa-modref -fno-ipa-icf works for GCC 12/13.

I don't really intend on spending more time on this though. I've got better at
debugging miscompilations since we filed this, but LLVM is still huge and not
easy for me to tackle.

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

* [Bug ipa/108250] [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb
  2022-12-28 23:35 [Bug c/108250] New: [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb sam at gentoo dot org
                   ` (16 preceding siblings ...)
  2024-03-28  3:27 ` [Bug ipa/108250] [12/13 " sjames at gcc dot gnu.org
@ 2024-03-28  3:31 ` sjames at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-03-28  3:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Sam James <sjames at gcc dot gnu.org> ---
(The workaround flags could be reduced but at this point I just wanted a quick
workaround.)

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

end of thread, other threads:[~2024-03-28  3:31 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-28 23:35 [Bug c/108250] New: [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb sam at gentoo dot org
2022-12-28 23:55 ` [Bug c/108250] " sam at gentoo dot org
2022-12-29  0:04 ` sam at gentoo dot org
2022-12-29  0:06 ` sam at gentoo dot org
2022-12-29  2:13 ` [Bug ipa/108250] " pinskia at gcc dot gnu.org
2022-12-29  2:48 ` sam at gentoo dot org
2022-12-29  3:14 ` sam at gentoo dot org
2022-12-29 16:54 ` arsen at aarsen dot me
2022-12-29 17:22 ` arsen at aarsen dot me
2023-01-02  3:44 ` pinskia at gcc dot gnu.org
2023-01-02  3:46 ` pinskia at gcc dot gnu.org
2023-01-03  1:18 ` sam at gentoo dot org
2023-01-09 14:09 ` rguenth at gcc dot gnu.org
2023-01-13 16:59 ` segher at gcc dot gnu.org
2023-03-27 12:27 ` rguenth at gcc dot gnu.org
2023-05-08 12:26 ` [Bug ipa/108250] [12/13/14 " rguenth at gcc dot gnu.org
2023-05-14 12:06 ` arsen at gcc dot gnu.org
2024-03-28  3:27 ` [Bug ipa/108250] [12/13 " sjames at gcc dot gnu.org
2024-03-28  3:31 ` sjames 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).