This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/38756] 107t.ivopts introduces pointer truncation
- From: "bigotp at acm dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 21 Jun 2012 11:34:15 +0000
- Subject: [Bug middle-end/38756] 107t.ivopts introduces pointer truncation
- Auto-submitted: auto-generated
- References: <bug-38756-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38756
Peter A. Bigot <bigotp at acm dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bigotp at acm dot org
--- Comment #1 from Peter A. Bigot <bigotp at acm dot org> 2012-06-21 11:34:15 UTC ---
I confirm this in 4.7.0. It's due to rewrite_use_nonlinear_expr() not checking
whether TYPE_PRECISION(ctype) < TYPE_PRECISION(utype) before doing the pointer
adjustment in ctype and converting back to utype.
Something like this fixes it in my case:
if (TYPE_PRECISION (ctype) < TYPE_PRECISION (utype))
{
ctype = generic_type_for (utype);
step = fold_convert (ctype, unshare_expr (step));
}