tree lhs_type = lhs.type ();
gcc_checking_assert (types_compatible_p (op2.type(), type));
+ // If we are calculating a pointer, shortcut to what we really care about.
+ if (POINTER_TYPE_P (type))
+ {
+ // Conversion from other pointers or a constant (including 0/NULL)
+ // are straightforward.
+ if (POINTER_TYPE_P (lhs.type ())
+ || (lhs.singleton_p ()
+ && TYPE_PRECISION (lhs.type ()) >= TYPE_PRECISION (type)))
+ {
+ r = lhs;
+ range_cast (r, type);
+ }
+ else
+ {
+ // If the LHS is not a pointer nor a singleton, then it is
+ // either VARYING or non-zero.
+ if (!lhs.contains_p (build_zero_cst (lhs.type ())))
+ r.set_nonzero (type);
+ else
+ r.set_varying (type);
+ }
+ r.intersect (op2);
+ return true;
+ }
+
if (truncating_cast_p (op2, lhs))
{
if (lhs.varying_p ())
--- /dev/null
+/* PR tree-optimization/97750 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall -Wextra" } */
+
+char CopyPlane_src;
+long CopyPlane_copy_pitch;
+char *CopyFromUswc_src;
+int CopyFromUswc_height;
+void CopyPlane(char *dst) {
+ __builtin_memcpy(dst, &CopyPlane_src, CopyPlane_copy_pitch);
+}
+void CopyFromUswc(long src_pitch) {
+ char *dst;
+ for (; CopyFromUswc_height;) {
+ unsigned unaligned = (long)CopyFromUswc_src;
+ if (unaligned)
+ CopyPlane(&dst[unaligned]); /* { dg-warning "may be used uninitialized" } */
+ CopyFromUswc_src += src_pitch;
+ }
+}
+