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

            Bug ID: 90310
           Summary: [7/8/9/10 Regression] wrong code with -Os
                    -fno-forward-propagate
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: armv7a-hardfloat-linux-gnueabi

Created attachment 46273
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46273&action=edit
reduced testcase

Might be related to PR89795.

Output:
$ armv7a-hardfloat-linux-gnueabi-gcc -Os -fno-forward-propagate testcase.c
-static
$ ./a.out 
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted

Correct value is 0xffff, wrong value is 0xffffffff.

Diff between gcc-6 (OK) and gcc-10 (BAD) is:

--- testcase.s.ok       2019-05-02 12:32:34.546130397 +0200
+++ testcase.s  2019-05-02 12:32:43.996130361 +0200
@@ -39,7 +40,7 @@
        bl      __popcountsi2
        ldr     r3, .L6+16
        str     r0, [r3]
-       uxth    r0, r4
+       mov     r0, r4  @ movhi
        pop     {r4, pc}
 .L7:
        .align  2


$ armv7a-hardfloat-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-armv7a-hardfloat/bin/armv7a-hardfloat-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-270639-checking-yes-rtl-df-extra-armv7a-hardfloat/bin/../libexec/gcc/armv7a-hardfloat-linux-gnueabi/10.0.0/lto-wrapper
Target: armv7a-hardfloat-linux-gnueabi
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 --with-float=hard --with-fpu=vfpv4
--with-arch=armv7-a --with-sysroot=/usr/armv7a-hardfloat-linux-gnueabi
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=armv7a-hardfloat-linux-gnueabi
--with-ld=/usr/bin/armv7a-hardfloat-linux-gnueabi-ld
--with-as=/usr/bin/armv7a-hardfloat-linux-gnueabi-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-270639-checking-yes-rtl-df-extra-armv7a-hardfloat
Thread model: posix
gcc version 10.0.0 20190429 (experimental) (GCC)

Reply via email to