[Bug tree-optimization/88842] missing optimization CSE, reassociation

luoxhu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri May 15 03:25:54 GMT 2020


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

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 = a + b + c + d;
  *res2 = b + c;
  *res3 = 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


More information about the Gcc-bugs mailing list