[Bug tree-optimization/86891] New: [9 Regression] wrong code with -O -frerun-cse-after-loop -fno-tree-dominator-opts -fno-tree-fre

zsojka at seznam dot cz gcc-bugzilla@gcc.gnu.org
Wed Aug 8 16:46:00 GMT 2018


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

            Bug ID: 86891
           Summary: [9 Regression] wrong code with -O
                    -frerun-cse-after-loop -fno-tree-dominator-opts
                    -fno-tree-fre
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: aarch64-unknown-linux-gnu

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

Output:
$ aarch64-unknown-linux-gnu-gcc -O -frerun-cse-after-loop
-fno-tree-dominator-opts -fno-tree-fre testcase.c -static
$ ./a.out 
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted

$ aarch64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-aarch64/bin/aarch64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-263387-checking-yes-rtl-df-extra-aarch64/bin/../libexec/gcc/aarch64-unknown-linux-gnu/9.0.0/lto-wrapper
Target: aarch64-unknown-linux-gnu
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-sysroot=/usr/aarch64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=aarch64-unknown-linux-gnu
--with-ld=/usr/bin/aarch64-unknown-linux-gnu-ld
--with-as=/usr/bin/aarch64-unknown-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-263387-checking-yes-rtl-df-extra-aarch64
Thread model: posix
gcc version 9.0.0 20180808 (experimental) (GCC) 


The generated code:
main:
        stp     x29, x30, [sp, -32]!    //,,,
        mov     x29, sp //,
// testcase.c:11:   u32 d = 7;
        mov     w0, 7   // tmp106,
        str     w0, [sp, 28]    // tmp106, d
// testcase.c:12:   b = __builtin_sub_overflow_p ((u16) - d, (u128) ~ (u8) d,
a);
        adrp    x0, b   // tmp126,
        strb    wzr, [x0, #:lo12:b]     //, b
// testcase.c:16:         __builtin_abort();
        bl      abort           //


just simply calls abort()


More information about the Gcc-bugs mailing list