public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/67413] New: Complex NOP expanded to several operations
@ 2015-08-31 14:43 glisse at gcc dot gnu.org
  2015-09-01  8:36 ` [Bug rtl-optimization/67413] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: glisse at gcc dot gnu.org @ 2015-08-31 14:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67413

            Bug ID: 67413
           Summary: Complex NOP expanded to several operations
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glisse at gcc dot gnu.org
  Target Milestone: ---

_Complex unsigned f(_Complex int i){return i;}

yields

        movl    %edi, %eax
        shrq    $32, %rdi
        salq    $32, %rdi
        orq     %rdi, %rax
        ret

I read somewhere that complex integers are a deprecated gcc extension, but gcc
only warns in pedantic mode, and it should not be too hard to improve the
generated code.

Note that tree optimizers currently also fail to optimize the corresponding
code:

long f(long x){
  long y = x >> 32;
  y <<= 32;
  int z = x;
  return z | y;
}

(using & CST instead of >> and << does not help)


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

end of thread, other threads:[~2021-12-15 22:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-31 14:43 [Bug rtl-optimization/67413] New: Complex NOP expanded to several operations glisse at gcc dot gnu.org
2015-09-01  8:36 ` [Bug rtl-optimization/67413] " rguenth at gcc dot gnu.org
2021-12-15 22:08 ` [Bug tree-optimization/67413] " pinskia at gcc dot gnu.org
2021-12-15 22:12 ` pinskia at gcc dot gnu.org
2021-12-15 22:14 ` 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).