[llvm-commits] [llvm] r49006 - in /llvm/trunk/lib: CodeGen/DwarfWriter.cpp CodeGen/LLVMTargetMachine.cpp CodeGen/SelectionDAG/SelectionDAGISel.cpp Target/PowerPC/PPCAsmPrinter.cpp Target/PowerPC/PPCRegisterInfo.cpp Target/X86/X86AsmPrinter.cpp Ta
Daniel Berlin
dberlin at dberlin.org
Tue Apr 1 12:22:51 PDT 2008
On Tue, Apr 1, 2008 at 2:12 PM, Chris Lattner <clattner at apple.com> wrote:
>
> On Apr 1, 2008, at 10:49 AM, Dale Johannesen wrote:
>
> >
> > On Apr 1, 2008, at 10:40 AM, Chris Lattner wrote:
> >>>
> >>> Hmm. llvm-gcc does not, in fact, mark foo() as nounwind.
> >>
> >> In this case, that is because baz() could throw. Try:
> >>
> >> int foo() {
> >> try {
> >> bar();
> >> } catch(...) {
> >> return 17
> >> }
> >> return 42;
> >> }
> >
> > llvm-gcc still does not mark foo as nounwind.
>
> Regardless of whether it does or not, it would be correct for it to be
> marked nounwind. This detail is a missed optimization in llvm-gcc,
Yes, and one intended to be fixed soon (along with a real definition
of TREE_NOTHROW that specifies whether the called functions by this
function are guaranteed not to throw either, since this is currently
underspecified, as you've all discovered :P).
More information about the llvm-commits
mailing list