From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 94252 invoked by alias); 31 Aug 2015 14:43:43 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 94076 invoked by uid 48); 31 Aug 2015 14:43:39 -0000 From: "glisse at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/67413] New: Complex NOP expanded to several operations Date: Mon, 31 Aug 2015 14:43:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: glisse at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-08/txt/msg02138.txt.bz2 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)