public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* optimization/5263: Poor optimization for expression with more than three operands
@ 2002-01-03  3:36 Kai.Tietz
  0 siblings, 0 replies; only message in thread
From: Kai.Tietz @ 2002-01-03  3:36 UTC (permalink / raw)
  To: gcc-gnats

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1335 bytes --]


>Number:         5263
>Category:       optimization
>Synopsis:       Poor optimization for expression with more than three operands
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 03 03:36:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     KT
>Release:        gcc-3.0.3
>Organization:
>Environment:
cygwin-intel-i686
>Description:
I noticed, that simple code like:
int f(int a,int b) { return a&b~a&~b; }
will converted to´something like that:

        pushl   %ebp
        movl    %esp, %ebp
        movl    8(%ebp), %edx
        movl    12(%ebp), %ec
        popl    %ebp
        movl    %edx, %eax
        notl    %edx
        andl    %ecx, %eax
        notl    %ecx
        andl    %edx, %eax
        andl    %ecx, %eax
        ret

But the result should be something like:

        pushl   %ebp
        movl    %esp, %ebp
        xorl    %eax, %eax
        popl    %ebp
        ret

>How-To-Repeat:
Just let gcc with any optimization option tranlate some code like this:
int f(int a,int b)
{
 return a&b&~a&~b;
}
>Fix:
Maybe it could be used, in simplify-rtx.c, the same method like for PLUS and MINUS for IOR, AND and XOR ?
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-01-03 11:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-03  3:36 optimization/5263: Poor optimization for expression with more than three operands Kai.Tietz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).