From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22145 invoked by alias); 15 May 2010 22:50:05 -0000 Received: (qmail 21998 invoked by uid 48); 15 May 2010 22:49:47 -0000 Date: Sat, 15 May 2010 22:50:00 -0000 Message-ID: <20100515224947.21997.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug lto/44150] [4.6 regression] g++.dg/lto/20081109 cp_lto_20081109_0.o-cp_lto_20081109_1.o In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jason at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-05/txt/msg01685.txt.bz2 ------- Comment #2 from jason at gcc dot gnu dot org 2010-05-15 22:49 ------- OK, here's what's going wrong: The LTO design is such that EH is only enabled if we encounter a function with an EH personality. With -fwhopr we process one translation unit at a time, so when we look at 20081109_1.C we only see foo(int). Before my patch foo(int) contained an ERT_MUST_NOT_THROW region, so we required the C++ personality function. After my patch, it contains an ERT_CLEANUP region instead, which doesn't require the C++ personality function So cgraph doesn't set DECL_FUNCTION_PERSONALITY, so lto1 doesn't think that foo needs EH, so it never sets flag_exceptions, so we don't get unwind information, so the throw can't unwind through foo. There seem to be two issues here: 1) lto1 incorrectly thinks foo doesn't need EH. 2) -fwhopr means that lto1 can make different decisions about EH for different translation units, so things blow up when linked together. With #2 fixed, #1 isn't as big a problem--but it could still be an issue if we aren't compiling the entire program, i.e. a shared library wants to throw from a callback. If anything we call can throw, we need unwind information and should turn on -fexceptions. -- jason at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|jason at gcc dot gnu dot org|unassigned at gcc dot gnu | |dot org Status|ASSIGNED |NEW Component|middle-end |lto http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44150