https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77674
Bug ID: 77674 Summary: ICE in binds_to_current_def_p with -fkeep-inline-functions Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: bernds at gcc dot gnu.org Target Milestone: --- Testcase: typedef struct { } __fsid_t; typedef unsigned long int pthread_t; extern "C" { extern __inline __attribute__ ((__gnu_inline__)) int pthread_equal (pthread_t __thread1, pthread_t __thread2) throw () { } } typedef pthread_t __gthread_t; static __typeof (pthread_equal) __gthrw_pthread_equal __attribute__ ((__weakref__ ("pthread_equal"))); static inline int __gthread_equal (__gthread_t __t1, __gthread_t __t2) { return __gthrw_pthread_equal (__t1, __t2); } Command line (with a normal x86_64-linux compiler): ./cc1plus red4.ii -fpreprocessed -O2 -fkeep-inline-functions -quiet And the crash: _ZL21__gthrw_pthread_equalmm/1 (int __gthrw_pthread_equal(pthread_t, pthread_t)) @0x7f30053f8170 Type: function definition analyzed alias transparent_alias weakref Visibility: weak References: pthread_equal/0 (alias) Referring: Availability: available First run: 0 Function flags: process Called by: _ZL15__gthread_equalmm/2 (1.00 per call) Calls: red4.ii: In function ‘int pthread_equal(pthread_t, pthread_t)’: red4.ii:13:1: internal compiler error: in binds_to_current_def_p, at symtab.c:2232 } ^ 0xa5e668 symtab_node::binds_to_current_def_p(symtab_node*) ../../git/gcc/symtab.c:2232 0xa67d59 set_const_flag_1 ../../git/gcc/cgraph.c:2500 0xa67c6c set_const_flag_1 ../../git/gcc/cgraph.c:2531 0xa67fdf cgraph_node::set_const_flag(bool, bool) ../../git/gcc/cgraph.c:2562 0x15d05e1 execute ../../git/gcc/ipa-pure-const.c:1831 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions.