https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37780
--- Comment #6 from ktkachov at gcc dot gnu.org --- Author: ktkachov Date: Mon Jun 6 16:06:05 2016 New Revision: 237141 URL: https://gcc.gnu.org/viewcvs?rev=237141&root=gcc&view=rev Log: [3/3][RTL ifcvt] PR middle-end/37780: Conditional expression with __builtin_clz() should be optimized out PR middle-end/37780 * ifcvt.c (noce_try_ifelse_collapse): New function. Declare prototype. (noce_process_if_block): Call noce_try_ifelse_collapse. * simplify-rtx.c (simplify_cond_clz_ctz): New function. (simplify_ternary_operation): Use the above to simplify conditional CLZ/CTZ expressions. * gcc.c-torture/execute/pr37780.c: New test. * gcc.target/aarch64/pr37780_1.c: Likewise. * gcc.target/arm/pr37780_1.c: Likewise. Added: trunk/gcc/testsuite/gcc.c-torture/execute/pr37780.c trunk/gcc/testsuite/gcc.target/aarch64/pr37780_1.c trunk/gcc/testsuite/gcc.target/arm/pr37780_1.c Modified: trunk/gcc/ChangeLog trunk/gcc/ifcvt.c trunk/gcc/simplify-rtx.c trunk/gcc/testsuite/ChangeLog