This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/56250] Wrong constant folding on unsigned int
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 08 Feb 2013 11:24:02 +0000
- Subject: [Bug tree-optimization/56250] Wrong constant folding on unsigned int
- Auto-submitted: auto-generated
- References: <bug-56250-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56250
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-08 11:24:02 UTC ---
Created attachment 29394
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29394
gcc48-pr56250.patch
Untested fix.
I believe only division/modulus is problematic, not multiplication, and I think
-fwrapv signed types are fine too. For *_DIV_EXPR/*_MOD_EXPR, I think
wide_type is always NULL_TREE and ctype is always equal to type.