re PR rtl-optimization/10817 (gcc does not optimize result=0;if(t!=0)result=t; to...
authorRoger Sayle <roger@eyesopen.com>
Sun, 2 Nov 2003 13:56:42 +0000 (13:56 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sun, 2 Nov 2003 13:56:42 +0000 (13:56 +0000)
commit31f0f571e61d1d7f8ff67a4f6a741173dfc4161c
tree3b7c1888d9ed7fad3b4bf1b5208f5a4d7e6b11cf
parent2077750a864920bb1f80a1b6998142d2b3c80dc8
re PR rtl-optimization/10817 (gcc does not optimize result=0;if(t!=0)result=t; to result=t;)

PR optimization/10817
* ifcvt.c (noce_emit_move_insn): Improve documentation comment.
(noce_try_move): New function to optimize an if-the-else into an
unconditional move, i.e. "if (a!=b) x=a; else x=b" into "x=a".
(noce_process_if_block): Attempt simplification with noce_try_move.

* simplify-rtx.c (simplify_ternary_operation): Some minor fixes
and improvements to the optimizations of IF_THEN_ELSE expressions.
(simplify_subreg): Silence signed/unsigned comparison warning.

* gcc.c-torture/compile/20031102-1.c: New test case.

From-SVN: r73200
gcc/ChangeLog
gcc/ifcvt.c
gcc/simplify-rtx.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20031102-1.c [new file with mode: 0644]