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 target/43088] [avr] Suspect optimizer missed code in gcc 4.4.3..


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43088

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
                 CC|                            |gjl at gcc dot gnu.org
      Known to fail|                            |

--- Comment #5 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-06-10 19:59:47 UTC ---
Funnc artifact. It occurs only if all low-bits are set, i.e. wich constants
0x3f, 0x1f, 0xf, ... So persumably a middle and pass makes some strange
assumption.

(In reply to comment #1)
> This bug is confirmed. andhi3/andsi3 causing this problem. conditional checks
> in andhi3 and andsi3 need to compare with zero instead of 0xff [etc]. 
> i.e. in andhi3 we need to replace
> (mask & 0x00ff) != 0xff by (mask & 0x00ff) != 0.
> 
> Similarly other checks in andhi3 and andsi3 need to be replaced.

Can you explain?

ANDding on a 8-bit part can only be omitted if the mask is 0xff. Otherwise, the
AND has to be performed, even if the result is known to be always zero.


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