This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/10817] gcc does not optimize result=0;if(t!=0)result=t; to result=t;
- From: "cvs-commit at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Nov 2003 13:56:49 -0000
- Subject: [Bug optimization/10817] gcc does not optimize result=0;if(t!=0)result=t; to result=t;
- References: <20030516141601.10817.pinskia@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10817
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2003-11-02 13:56 -------
Subject: Bug 10817
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: sayle@gcc.gnu.org 2003-11-02 13:56:42
Modified files:
gcc : ChangeLog ifcvt.c simplify-rtx.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/gcc.c-torture/compile: 20031102-1.c
Log message:
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.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.1652&r2=2.1653
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ifcvt.c.diff?cvsroot=gcc&r1=1.128&r2=1.129
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/simplify-rtx.c.diff?cvsroot=gcc&r1=1.164&r2=1.165
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3164&r2=1.3165
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/20031102-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1