> This is an extract of a trivial function returning a pointer, > where the value is (ptr) (HOST_WIDE_INT) -1. (Don't say > "don't do that": it's from gcc/calls.c!) If the value is compared against (ptr) (HOST_WIDE_INT) -1 , and the compiler does the extensions consistently, this should work regardless of whether it zero extends or sign extends.