[Bug tree-optimization/13563] if-conversion not agressive enough
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jan 11 23:09:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=13563
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |msebor at gcc dot gnu.org
Known to fail| |3.3, 4.5.3, 4.8.3, 4.9.3,
| |5.3.0, 6.3.0, 7.0
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
No progress in GCC 7.0:
$ cat t.c && gcc -O2 -S -Wall -Wextra -Wpedantic -Wshadow
-fdump-tree-optimized=/dev/stdout -o/dev/stdout t.c
void foo (int);
void bar (int a)
{
if (a)
foo (1);
else
foo (0);
}
void baz (int a)
{
foo (!!a);
}
.file "t.c"
;; Function bar (bar, funcdef_no=0, decl_uid=1797, cgraph_uid=0,
symbol_order=0)
bar (int a)
{
<bb 2> [100.00%]:
if (a_2(D) != 0)
goto <bb 3>; [46.00%]
else
goto <bb 4>; [54.00%]
<bb 3> [46.00%]:
foo (1); [tail call]
goto <bb 5>; [100.00%]
<bb 4> [54.00%]:
foo (0); [tail call]
<bb 5> [100.00%]:
return;
}
.text
.p2align 4,,15
.globl bar
.type bar, @function
bar:
.LFB0:
.cfi_startproc
testl %edi, %edi
jne .L4
xorl %edi, %edi
jmp foo
.p2align 4,,10
.p2align 3
.L4:
movl $1, %edi
jmp foo
.cfi_endproc
.LFE0:
.size bar, .-bar
;; Function baz (baz, funcdef_no=1, decl_uid=1800, cgraph_uid=1,
symbol_order=1)
baz (int a)
{
_Bool _1;
int _2;
<bb 2> [100.00%]:
_1 = a_3(D) != 0;
_2 = (int) _1;
foo (_2); [tail call]
return;
}
.p2align 4,,15
.globl baz
.type baz, @function
baz:
.LFB1:
.cfi_startproc
testl %edi, %edi
setne %dil
movzbl %dil, %edi
jmp foo
.cfi_endproc
.LFE1:
.size baz, .-baz
.ident "GCC: (GNU) 7.0.0 20170110 (experimental)"
.section .note.GNU-stack,"",@progbits
More information about the Gcc-bugs
mailing list