This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/66248] subreg truncation not hoisted from loop
- From: "sje at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 15 Dec 2015 17:46:23 +0000
- Subject: [Bug rtl-optimization/66248] subreg truncation not hoisted from loop
- Auto-submitted: auto-generated
- References: <bug-66248-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66248
--- Comment #5 from Steve Ellcey <sje at gcc dot gnu.org> ---
If we did not truncate ret on each loop iteration then ret could get large
enough to overflow the maximum integer value before we truncate it at the end,
leading to undefined results. But if we truncate ret on each loop iteration
then ret will not overflow and the result is defined.