This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/49903] [avr] Redundant comparisons in binary-search switch/case expansion
- From: "gjl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 29 Jul 2011 16:11:30 +0000
- Subject: [Bug target/49903] [avr] Redundant comparisons in binary-search switch/case expansion
- Auto-submitted: auto-generated
- References: <bug-49903-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49903
--- Comment #2 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-07-29 16:11:12 UTC ---
(In reply to comment #1)
> Johann,
> Would some type of peephole optimization help out on this?
RTL peephole won't work because they operate just inside basic blocks.
Don't know the retionale behind that limitation, appears that it's just for
technical and implementational reasons. RTL peep need not to be confused by
BBs, just code_labels etc. would bother.
Text peepholes match but it might be tedious and error prone to work out
instructions lengths or the correct instructions if jump offsets don't match.
Maybe a way is in avr_reorg, but it would be quite tedious to work out all
QI/HI/SI signed and unsigned combinations. And it must ensure that no other
transformation takes place. There's bunch of special treatment in md and c and
cc0 handling. E.g. I don't quite understand why jumps clobber cc0; btw not
clobbering cc0 will not fix this PR.