[llvm-commits] [llvm-gcc-4.2] r57199 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Duncan Sands baldrick at free.fr
Tue Oct 7 00:59:05 PDT 2008


Hi Evan,

>  /// EmitFILTER_EXPR - Handle FILTER_EXPR.
>  Value *TreeToLLVM::EmitFILTER_EXPR(tree exp) {
>    CreateExceptionValues();
>    // Load exception selector.
> -  return Builder.CreateLoad(ExceptionSelectorValue, "eh_select");
> +  Value *V = Builder.CreateLoad(ExceptionSelectorValue, "eh_select");
> +  // Cast the address to the right pointer type.
> +  return BitCastToType(V, ConvertType(TREE_TYPE(exp)));
>  }

I don't think this is right.  Are you really seeing problems
with FILTER_EXPR?  The big difference between EXC_PTR_EXPR and
FILTER_EXPR is that EXC_PTR_EXPR is a pointer while FILTER_EXPR
is an integer.  We (and gcc generic code) treat EXC_PTR_EXPR
as a void*, while objc gives it a different pointer type.  That
can be fixed by just bitcasting pointer types.
However if FILTER_EXPR is declared somewhere as an integer with
a different width then that's more problematic (and the bitcast
you introduced will assert!).  Fortunately no-one besides the
core gcc eh code creates FILTER_EXPRs, not even objc, and the
places that do make them all use the same type.

In short, can you please revert the FILTER_EXPR parts of the
patch.

Thanks,

Duncan.



More information about the llvm-commits mailing list