public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58095] New: SIMD code requiring auxiliary array for best optimization
@ 2013-08-06 16:03 siavashserver at gmail dot com
  2013-08-06 16:15 ` [Bug tree-optimization/58095] " paolo.carlini at oracle dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: siavashserver at gmail dot com @ 2013-08-06 16:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58095
           Summary: SIMD code requiring auxiliary array for best
                    optimization
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: siavashserver at gmail dot com

Created attachment 30621
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30621&action=edit
Source code and its generated asm code.

Hello. I have noticed a strange behavior when I'm trying to write SIMD code
using provided SSE intrinsics. It looks like GCC is not able to
generate/optimize same code like function (bar) for function (foo).


I was wondering how can I achieve same generated code for the function (foo)
without going into trouble of defining and using an auxiliary array like
function (bar).


I've tried using __restrict__ keyword for input data (foo2), but GCC still
generates same code like function (foo). ICC and Clang also generate same code
and fail to optimize.

Something strange I've noticed is that GCC 4.4.7 generates desired code for
function (foo), but fails to do for function (foo2) and (bar). Newer versions
generate exactly same code for function (foo) and (foo2), and desired code for
function (bar).

Output attached is generated from GCC 4.8.1 using -O2 optimization level. I've
used online GCC compiler from: http://gcc.godbolt.org/


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-08-28 18:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-06 16:03 [Bug c++/58095] New: SIMD code requiring auxiliary array for best optimization siavashserver at gmail dot com
2013-08-06 16:15 ` [Bug tree-optimization/58095] " paolo.carlini at oracle dot com
2013-08-06 16:54 ` pinskia at gcc dot gnu.org
2013-08-06 17:46 ` siavashserver at gmail dot com
2013-08-07  5:13 ` siavashserver at gmail dot com
2013-08-07  6:31 ` siavashserver at gmail dot com
2021-08-28 18:48 ` pinskia at gcc dot gnu.org

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).