https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77259
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Thu Sep 1 11:36:50 2016 New Revision: 239924 URL: https://gcc.gnu.org/viewcvs?rev=239924&root=gcc&view=rev Log: Backported from mainline 2016-08-17 Jakub Jelinek <ja...@redhat.com> PR middle-end/77259 * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children): If turning a call into __builtin_unreachable-like noreturn call, adjust gimple_call_set_fntype. * tree-cfgcleanup.c (fixup_noreturn_call): Remove lhs also if gimple_call_fntype has void return type. * g++.dg/ipa/devirt-52.C: New test. Added: branches/gcc-6-branch/gcc/testsuite/g++.dg/ipa/devirt-52.C Modified: branches/gcc-6-branch/gcc/ChangeLog branches/gcc-6-branch/gcc/testsuite/ChangeLog branches/gcc-6-branch/gcc/tree-cfgcleanup.c branches/gcc-6-branch/gcc/tree-ssa-pre.c