https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79984
Bug ID: 79984 Summary: [6/7 Regression] ICE with -Wnonnull-compare Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mpolacek at gcc dot gnu.org Target Milestone: --- While working on PR79962 I found another ICE: enum { r = 1 }; __attribute__ ((nonnull (r))) int f (int *p) { return *p; } $ ./cc1plus -quiet -Wnonnull-compare ice.cc ice.cc: In function ‘int f(int*)’: ice.cc:7:1: internal compiler error: tree check: expected integer_cst, have const_decl in decompose, at tree.h:5256 } ^ 0x137035e tree_check_failed(tree_node const*, char const*, int, char const*, ...) /home/marek/src/gcc/gcc/tree.c:9819 0x78e322 tree_check(tree_node const*, char const*, int, char const*, tree_code) /home/marek/src/gcc/gcc/tree.h:3320 0x78e656 wi::int_traits<tree_node const*>::decompose(long*, unsigned int, tree_node const*) /home/marek/src/gcc/gcc/tree.h:5256 0xc849e9 wide_int_ref_storage<false>::wide_int_ref_storage<tree_node const*>(tree_node const* const&, unsigned int) /home/marek/src/gcc/gcc/wide-int.h:976 0xc82ec4 generic_wide_int<wide_int_ref_storage<false> >::generic_wide_int<tree_node const*>(tree_node const* const&, unsigned int) /home/marek/src/gcc/gcc/wide-int.h:753 0x138531d bool wi::eq_p<tree_node const*, int>(tree_node const* const&, int const&) /home/marek/src/gcc/gcc/wide-int.h:1747 0x13679a9 tree_int_cst_sgn(tree_node const*) /home/marek/src/gcc/gcc/tree.c:7365 0x1368797 compare_tree_int(tree_node const*, unsigned long) /home/marek/src/gcc/gcc/tree.c:7574 0x13822b5 nonnull_arg_p(tree_node const*) /home/marek/src/gcc/gcc/tree.c:14349 0x19d3f97 do_warn_nonnull_compare /home/marek/src/gcc/gcc/gimple-ssa-nonnull-compare.c:42 0x19d433a execute /home/marek/src/gcc/gcc/gimple-ssa-nonnull-compare.c:142 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.