From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 569DF38708E6; Fri, 15 May 2020 03:25:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 569DF38708E6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1589513154; bh=Nso4kGmMitNNsMSu0hEr+Bq5ClpdjTrjbVM1jYcQ8rA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=B9GFCtagtTq9zSMK+WjGgDUDYR1LNXxIB9sTHEr55vn3XCcKSw7NUq3vDnEd3lDwP ed1U00E1dGB4iuMrrUJ74bIBvub9OqoqSpATiAlvFhxcSngxHBPc7APX3Lk5J6nVWm SQjQ6QgMngXoNQqVryz73VSKrgM5xYknRF96ofas= From: "luoxhu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/88842] missing optimization CSE, reassociation Date: Fri, 15 May 2020 03:25:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: unknown X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: luoxhu at gcc dot gnu.org X-Bugzilla-Status: NEW 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: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 03:25:54 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D88842 luoxhu at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |luoxhu at gcc dot gnu.org --- Comment #3 from luoxhu at gcc dot gnu.org --- One more case of missed optimization CSE, reassoc: void foo(unsigned int a, unsigned int b, unsigned int c, unsigned int d, int *res1, int*res2, int *res3) { *res1 =3D a + b + c + d; *res2 =3D b + c; *res3 =3D a + d; } cat foo.s .file "foo.c" .machine power8 .abiversion 2 .section ".text" .align 2 .p2align 4,,15 .globl foo .type foo, @function foo: .LFB0: .cfi_startproc add 10,5,6 add 10,10,4 add 4,4,5 add 10,10,3 add 3,3,6 stw 10,0(7) stw 4,0(8) stw 3,0(9) blr=