https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96670
Bug ID: 96670 Summary: [11 Regression] ICE in tree_to_uhwi, at tree.c:7361 since r11-2709-g866626efd749ed3e Product: gcc Version: 10.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: msebor at gcc dot gnu.org Target Milestone: --- The following is causing ICE: $ cat memchr.c struct { int n; short a; } const sx = {}; void test_not_find() { int nb = (char *)&sx.a - (char *)&sx; char *p = (char *)&sx; __builtin_memchr(p, 5, nb); } $ gcc memchr.c -Os -fno-tree-ccp -c during GIMPLE pass: forwprop memchr.c: In function ‘test_not_find’: memchr.c:12:1: internal compiler error: in tree_to_uhwi, at tree.c:7361 12 | } | ^ 0x72c3b3 tree_to_uhwi(tree_node const*) /home/marxin/Programming/gcc/gcc/tree.c:7361 0x72c3b3 tree_to_uhwi(tree_node const*) /home/marxin/Programming/gcc/gcc/tree.c:7359 0xacad32 gimple_fold_builtin_memchr /home/marxin/Programming/gcc/gcc/gimple-fold.c:2678 0xad7f8b gimple_fold_builtin /home/marxin/Programming/gcc/gcc/gimple-fold.c:4018 0xad7f8b gimple_fold_call /home/marxin/Programming/gcc/gcc/gimple-fold.c:4531 0xad8d03 fold_stmt_1 /home/marxin/Programming/gcc/gcc/gimple-fold.c:5232 0xea600c execute /home/marxin/Programming/gcc/gcc/tree-ssa-forwprop.c:3103 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.