On Tue, Dec 19, 2017 at 03:13:13PM -0500, Jason Merrill wrote: > On 12/17/2017 09:07 PM, David Malcolm wrote: > > On Mon, 2017-12-11 at 18:37 -0500, Jason Merrill wrote: > > > On 11/10/2017 04:45 PM, David Malcolm wrote: > > > > gcc/c-family/ChangeLog: > > > > * c-warn.c (sizeof_pointer_memaccess_warning): Strip any > > > > location > > > > wrappers from src and dest. > > > > > > Here the existing calls to tree_strip_nop_conversions ought to > > > handle > > > the wrappers. > > > > They don't; when EXP is a VIEW_CONVERT_EXPR wrapper around a VAR_DECL... > > > > 11887 static inline bool > > 11888 tree_nop_conversion (const_tree exp) > > 11889 { > > 11890 tree outer_type, inner_type; > > 11891 > > 11892 if (!CONVERT_EXPR_P (exp) > > 11893 && TREE_CODE (exp) != NON_LVALUE_EXPR) > > 11894 return false; > > > > ...tree_nop_conversion bails out at this "return false;", and hence > > tree_strip_nop_conversions simply returns the wrapper that was passed > > in. > > Right. So let's change tree_nop_conversion to return true.
I'd fear that would break too much stuff, VIEW_CONVERT_EXPR is not a normal conversion, but reinterpretation of the bits. Or do you mean it should strip just the special VIEW_CONVERT_EXPR that has type identical to the operand's type? Jakub