This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/56051] Wrong expression evaluation
- 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: Sun, 20 Jan 2013 16:46:04 +0000
- Subject: [Bug tree-optimization/56051] Wrong expression evaluation
- Auto-submitted: auto-generated
- References: <bug-56051-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56051
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |jakub at gcc dot gnu.org
|gnu.org |
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-01-20 16:46:04 UTC ---
Created attachment 29227
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29227
gcc48-pr56051.patch
Untested fix. As the testcase shows, also a widening conversion can be a
problem, if it extends from signed integral type to wider unsigned one, because
then for Y equal to bitsize of the narrower type - 1 we get more than one bit
set.
On the other side, the optimization doesn't hit when X isn't an ARRAY_REF, but
just an integral variable, because then arg0 and arg1 are swapped.
Guess for 4.9 we should handle those cases too.