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

            Bug ID: 93494
           Summary: [8/9/10 Regression] wrong code or ICE with
                    __builtin_add_overflow
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, wrong-code
          Severity: normal
          Priority: P3
         Component: target
          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

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

Output (gcc-9, gcc-8):
$ armv7a-hardfloat-linux-gnueabi-gcc testcase.c -static
testcase.c: In function 'main':
testcase.c:7:53: internal compiler error: in gimplify_expr, at gimplify.c:13265
    7 |     __builtin_add_overflow (-(unsigned long long) (0, 0), (unsigned
char) 0,
      |                                                   ~~^~~~
0x6158bf gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /repo/gcc-9-branch/gcc/gimplify.c:13265
0xc5f040 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /repo/gcc-9-branch/gcc/gimplify.c:12607
0xc6126d gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /repo/gcc-9-branch/gcc/gimplify.c:13226
0xc6a444 gimplify_expr
        /repo/gcc-9-branch/gcc/gimplify.c:13512
0xc5da42 gimplify_modify_expr
        /repo/gcc-9-branch/gcc/gimplify.c:5792
0xc5eded gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /repo/gcc-9-branch/gcc/gimplify.c:12504
0xc62446 gimplify_stmt(tree_node**, gimple**)
        /repo/gcc-9-branch/gcc/gimplify.c:6718
0xc649af gimplify_and_add(tree_node*, gimple**)
        /repo/gcc-9-branch/gcc/gimplify.c:466
0xc649af internal_get_tmp_var
        /repo/gcc-9-branch/gcc/gimplify.c:622
0xc5f80c get_initialized_tmp_var(tree_node*, gimple**, gimple**, bool)
        /repo/gcc-9-branch/gcc/gimplify.c:653
0xc5f80c gimplify_save_expr
        /repo/gcc-9-branch/gcc/gimplify.c:5977
0xc5f80c gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /repo/gcc-9-branch/gcc/gimplify.c:12804
0xc6558a gimplify_compound_lval
        /repo/gcc-9-branch/gcc/gimplify.c:2986
0xc5e630 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /repo/gcc-9-branch/gcc/gimplify.c:12456
0xc5cbd7 gimplify_modify_expr
        /repo/gcc-9-branch/gcc/gimplify.c:5670
0xc5eded gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /repo/gcc-9-branch/gcc/gimplify.c:12504
0xc62446 gimplify_stmt(tree_node**, gimple**)
        /repo/gcc-9-branch/gcc/gimplify.c:6718
0xc62da9 gimplify_compound_expr
        /repo/gcc-9-branch/gcc/gimplify.c:5929
0xc5c6cb gimplify_modify_expr_rhs
        /repo/gcc-9-branch/gcc/gimplify.c:5265
0xc5cb1a gimplify_modify_expr
        /repo/gcc-9-branch/gcc/gimplify.c:5625
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Output (gcc-7):
$ armv7a-hardfloat-linux-gnueabi-gcc testcase.c -static
$ ./a.out


$ 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-r10-6322-g6693911f069-checking-yes-rtl-df-extra-armv7a-hardfloat/bin/../libexec/gcc/armv7a-hardfloat-linux-gnueabi/10.0.1/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-r10-6322-g6693911f069-checking-yes-rtl-df-extra-armv7a-hardfloat
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.0.1 20200129 (experimental) (GCC)

Reply via email to