[Bug target/84377] gcc-7.3.0 miscompiles truncf128@@GLIBC_2.26 in libm.so

2023-06-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84377

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|UNCONFIRMED |RESOLVED

--- Comment #6 from Andrew Pinski  ---
Dup of bug 81763 in the end.

*** This bug has been marked as a duplicate of bug 81763 ***

[Bug target/84377] gcc-7.3.0 miscompiles truncf128@@GLIBC_2.26 in libm.so

2023-06-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84377

--- Comment #5 from Andrew Pinski  ---
The gimple level is the same:
```
  _5 = 281474976710655 >> j0_20;
  _6 = ~_5;
  _7 = (long long unsigned int) _6;
  _8 = _7 & _35;
  qw_u.parts64.msw = _8;
  qw_u.parts64.lsw = 0;
```

The place where it changes first between GCC 7.3 and 7.4 is IRA.

[Bug target/84377] gcc-7.3.0 miscompiles truncf128@@GLIBC_2.26 in libm.so

2023-06-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84377

--- Comment #4 from Andrew Pinski  ---
GCC 7.3.0:
```
.loc 1 42 0 discriminator 2
movl$65535, %edi
movl$-1, %esi
movl$0, 48(%esp)
shrdl   %edi, %esi
testb   $32, %cl
sarx%ecx, %edi, %edi
movl$0, 52(%esp)
cmovne  %edi, %esi
andn%eax, %esi, %esi
andn%edx, %esi, %edi
movl%esi, 56(%esp)
movl%edi, 60(%esp)
vmovdqa 48(%esp), %xmm3
vmovaps %xmm3, (%esp)
```

GCC 7.4.0:
```
.loc 1 42 0 discriminator 2
movl$65535, %edi
movl$-1, %esi
movl$0, 48(%esp)
shrdl   %edi, %esi
sarx%ecx, %edi, %edi
movl%edi, %ebx
movl$0, 52(%esp)
sarl$31, %ebx
testb   $32, %cl
cmovne  %edi, %esi
cmovne  %ebx, %edi
andn%eax, %esi, %esi
andn%edx, %edi, %edi
movl%esi, 56(%esp)
movl%edi, 60(%esp)
vmovdqa 48(%esp), %xmm3
vmovaps %xmm3, (%esp)
```

[Bug target/84377] gcc-7.3.0 miscompiles truncf128@@GLIBC_2.26 in libm.so

2023-06-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84377

Andrew Pinski  changed:

   What|Removed |Added

  Known to work||7.4.0, 7.5.0, 8.1.0
  Known to fail||7.3.0

--- Comment #3 from Andrew Pinski  ---
So I can reproduce it with GCC 7.3.0 with:
```
-xc -march=skylake -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a
-mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma
-mno-fma4 -mno-xop -mbmi -msgx -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1
-mlzcnt -mrtm -mhle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr
-mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf
-mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves -mno-avx512dq -mno-avx512bw
-mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps
-mno-avx5124vnniw -mno-clwb -mno-mwaitx -mno-clzero -mno-pku -mno-rdpid -m32
-O2 -std=gnu11 -fgnu89-inline -fmerge-all-constants -fno-strict-aliasing
-frounding-math -fstack-protector-all -mpreferred-stack-boundary=4  -fPIC
```
But it passes with GCC 7.4.0.

[Bug target/84377] gcc-7.3.0 miscompiles truncf128@@GLIBC_2.26 in libm.so

2018-02-14 Thread dilfridge at gentoo dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84377

--- Comment #2 from Andreas K. Huettel  ---

> 
> but it doesn't fail for me, does it for you?  

Yes it fails here.

(~amd64 chroot) pinacolada ~/test # gcc -m32 -O2 -std=gnu11 -fgnu89-inline
-fno-strict-aliasing -frounding-math -fstack-protector-all -march=native -fPIC
pr84377-test.c pr84377.i -o pr84377-test
(~amd64 chroot) pinacolada ~/test # ./pr84377-test 
Abgebrochen
(~amd64 chroot) pinacolada ~/test # 

(=Aborted)

> What does -march=native expand
> for you (add -v and show the options passed to cc1)?

(~amd64 chroot) pinacolada ~/test # LANG=C gcc -v -m32 -O2 -std=gnu11
-fgnu89-inline -fno-strict-aliasing -frounding-math -fstack-protector-all
-march=native -fPIC pr84377-test.c pr84377.i -o pr84377-test
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/7.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-7.3.0/work/gcc-7.3.0/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/7.3.0
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/7.3.0
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/7.3.0/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/7.3.0/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/g++-v7
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/7.3.0/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--enable-checking=release --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo 7.3.0 p1.0' --disable-esp --enable-libstdcxx-time
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64
--disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj
--enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts
--disable-libmpx --enable-vtable-verify --enable-libvtv --enable-lto
--without-isl --enable-libsanitizer --enable-default-pie --enable-default-ssp
Thread model: posix
gcc version 7.3.0 (Gentoo 7.3.0 p1.0) 
COLLECT_GCC_OPTIONS='-v' '-m32' '-O2' '-std=gnu11' '-fgnu89-inline'
'-fno-strict-aliasing' '-frounding-math' '-fstack-protector-all'
'-march=native' '-fPIC' '-o' 'pr84377-test'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/7.3.0/cc1 -quiet -v -imultilib 32
pr84377-test.c -march=skylake -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3
-mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm
-mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -msgx -mbmi2 -mno-tbm -mavx -mavx2
-msse4.2 -msse4.1 -mlzcnt -mrtm -mhle -mrdrnd -mf16c -mfsgsbase -mrdseed
-mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er
-mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves
-mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi
-mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mno-mwaitx -mno-clzero -mno-pku
-mno-rdpid --param l1-cache-size=32 --param l1-cache-line-size=64 --param
l2-cache-size=8192 -mtune=skylake -quiet -dumpbase pr84377-test.c -m32 -auxbase
pr84377-test -O2 -std=gnu11 -version -fgnu89-inline -fno-strict-aliasing
-frounding-math -fstack-protector-all -fPIC -o /tmp/ccxL6T9P.s
GNU C11 (Gentoo 7.3.0 p1.0) version 7.3.0 (x86_64-pc-linux-gnu)
compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 3.1.6,
MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include
 /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include-fixed
 /usr/include
End of search list.
GNU C11 (Gentoo 7.3.0 p1.0) version 7.3.0 (x86_64-pc-linux-gnu)
compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 3.1.6,
MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: d1cccfcc83f321cbb1113d0d0df65594
COLLECT_GCC_OPTIONS='-v' '-m32' '-O2' '-std=gnu11' '-fgnu89-inline'
'-fno-strict-aliasing' '-frounding-math' '-fstack-protector-all'
'-march=native' '-fPIC' '-o' 'pr84377-test'
 /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/as
-v --32 -o /tmp/cclwtFas.o /tmp/ccxL6T9P.s
GNU assembler version 2.29.1 (x86_64-pc-linux-gnu) using BFD version (Gentoo
2.29.1 p3) 2.29.1
COLLECT_GCC_OPTIONS='-v' '-m32' '-O2' '-std=gnu11' '-fgnu89-inline'
'-fno-strict-aliasing' '-frounding-math' '-fstack-protector-all'
'-march=native' '-fPIC' '-o' 'pr84377-test'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/7.3.0/cc1 -fpreprocessed pr84377.i
-march=skylake