This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/50131] Optimize x = -1 with "or" for -O
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 20 Aug 2011 19:44:49 +0000
- Subject: [Bug target/50131] Optimize x = -1 with "or" for -O
- Auto-submitted: auto-generated
- References: <bug-50131-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50131
--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> 2011-08-20 19:44:49 UTC ---
(In reply to comment #2)
> Is or $-1, reg on all CPUs equally expensive to mov $-1, reg though (as or
> generally needs the previous reg content while mov does not; I know some CPUs
> special case xor reg, reg, but I doubt or $-1, reg is special cased)?
We should add a new x86 optimization flag and turn it on
only if it helps for the processor to be optimized.