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/38899] New: pessimizes function without SSE intrinsics


[ Forwarded from http://bugs.debian.org/512050 ]

brian m. carlson reports the following problem with gcc 4.3 and trunk:

Attached is a C file that is compiled with -O3.  mul and mul2 perform the
same operation; mul uses a loop, and mul2 uses SSE intrinsics.  mul2
results in three instructions, whereas mul results in many, many more.

Obviously, since the two functions do the exact same thing, they should
be optimized to be identical.  Instead, mul is pessimized.

Note that there are no alignment issues present since the arrays
declared in main are 16-byte aligned (since they are allocated on the
stack, which is 16-byte aligned on x86_64).

And:

I also just noted that gcc-4.1 and gcc-4.2 produce much less bad code:
they each use 8 movss and 4 mulss.  Nevertheless, they still do not
convert the code into three SSE instructions.


-- 
           Summary: pessimizes function without SSE intrinsics
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tbm at cyrius dot com
GCC target triplet: x86_64-unknown-linux-gnu


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


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