Bug 110219 - [14 Regression] ICE: tree check: expected integer_cst, have real_cst in to_wide, at tree.h:6314 with _Complex float to int
Summary: [14 Regression] ICE: tree check: expected integer_cst, have real_cst in to_wi...
Status: RESOLVED DUPLICATE of bug 110266
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 14.0
: P3 normal
Target Milestone: 14.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2023-06-12 10:09 UTC by Zdenek Sojka
Modified: 2023-06-16 23:33 UTC (History)
0 users

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build:
Known to work: 13.1.1
Known to fail: 14.0
Last reconfirmed: 2023-06-12 00:00:00


Attachments
reduced testcase (70 bytes, text/plain)
2023-06-12 10:09 UTC, Zdenek Sojka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2023-06-12 10:09:35 UTC
Created attachment 55307 [details]
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Os -fno-tree-ccp -fno-tree-forwprop -fno-tree-fre testcase.c 
during GIMPLE pass: evrp
testcase.c: In function 'foo':
testcase.c:8:1: internal compiler error: tree check: expected integer_cst, have real_cst in to_wide, at tree.h:6314
    8 | }
      | ^
0x851b7a tree_check_failed(tree_node const*, char const*, int, char const*, ...)
        /repo/gcc-trunk/gcc/tree.cc:8899
0xd15336 tree_check(tree_node const*, char const*, int, char const*, tree_code)
        /repo/gcc-trunk/gcc/tree.h:3826
0xd15336 wi::to_wide(tree_node const*)
        /repo/gcc-trunk/gcc/tree.h:6314
0xd159c2 wi::to_wide(tree_node const*)
        /repo/gcc-trunk/gcc/tree.h:3570
0xd159c2 adjust_realpart_expr
        /repo/gcc-trunk/gcc/gimple-range-fold.cc:538
0xd159c2 gimple_range_adjustment
        /repo/gcc-trunk/gcc/gimple-range-fold.cc:563
0xd159c2 fold_using_range::range_of_range_op(vrange&, gimple_range_op_handler&, fur_source&)
        /repo/gcc-trunk/gcc/gimple-range-fold.cc:741
0x23c54b6 fold_using_range::fold_stmt(vrange&, gimple*, fur_source&, tree_node*)
        /repo/gcc-trunk/gcc/gimple-range-fold.cc:594
0x23c597c fold_range(vrange&, gimple*, range_query*)
        /repo/gcc-trunk/gcc/gimple-range-fold.cc:318
0x23be761 ranger_cache::get_global_range(vrange&, tree_node*, bool&)
        /repo/gcc-trunk/gcc/gimple-range-cache.cc:1010
0x23b5bcc gimple_ranger::range_of_stmt(vrange&, gimple*, tree_node*)
        /repo/gcc-trunk/gcc/gimple-range.cc:311
0x1737079 range_query::value_of_stmt(gimple*, tree_node*)
        /repo/gcc-trunk/gcc/value-query.cc:134
0x15febbf substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
        /repo/gcc-trunk/gcc/tree-ssa-propagate.cc:792
0x238035e dom_walker::walk(basic_block_def*)
        /repo/gcc-trunk/gcc/domwalk.cc:311
0x15fdd05 substitute_and_fold_engine::substitute_and_fold(basic_block_def*)
        /repo/gcc-trunk/gcc/tree-ssa-propagate.cc:971
0x1702139 execute_ranger_vrp(function*, bool, bool)
        /repo/gcc-trunk/gcc/tree-vrp.cc:998
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-1694-20230611112131-g20643513b8d-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++ --enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra --disable-bootstrap --with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld --with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch --prefix=/repo/gcc-trunk//binary-trunk-r14-1694-20230611112131-g20643513b8d-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20230611 (experimental) (GCC)
Comment 1 Andrew Pinski 2023-06-12 18:12:20 UTC
Confirmed.
Comment 2 Zdenek Sojka 2023-06-16 10:17:35 UTC
This seems to have been fixed between r14-1822 (BAD) and r14-1881 (GOOD).
Comment 3 Andrew Pinski 2023-06-16 23:32:51 UTC
Dup of bug 110266.

*** This bug has been marked as a duplicate of bug 110266 ***
Comment 4 Andrew Pinski 2023-06-16 23:33:47 UTC
(In reply to Andrew Pinski from comment #3)
> Dup of bug 110266.
> 
> *** This bug has been marked as a duplicate of bug 110266 ***

I should say that bug has a better testcase than one which you need to disable optimizations which is why I closed this one as a dup of that one even though this one was filed before and that one already recorded the fix for it too.