This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/38756] 107t.ivopts introduces pointer truncation


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));
    }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]