https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115991

--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Sergei Trofimovich from comment #11)
> Looking at indunction variable candidates:
> 
> <Invariant Expressions>:
> inv_expr 1:     (signed int) offset_5 + 12
> inv_expr 2:     (signed int) offset_5 + 16
> inv_expr 3:     (signed int) offset_5 - (signed int) (unsigned long) ((u32
> *) &hdr + 4)
> inv_expr 4:     (signed int) offset_5 - (signed int) (unsigned long) &hdr
> inv_expr 5:     (signed int) offset_5 - (signed int) (u32 *) &hdr
> 
> I think we select `inv_expr 5:     (signed int) offset_5 - (signed int) (u32
> *) &hdr` on `x86_64`. Is it a valid expression? Or should it be `(signed
> int) offset_5 - (signed int) (unsigned long) (u32 *) &hdr`?

It's valid, a truncation is fine.

Reply via email to