This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix for simplify_relational_operation related fix
- To: Jan Hubicka <jh at suse dot cz>
- Subject: [PATCH] Fix for simplify_relational_operation related fix
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Tue, 1 Aug 2000 14:56:39 +0200
- Cc: gcc-patches at gcc dot gnu dot org, rth at cygnus dot com
- References: <20000729000440.I13228@atrey.karlin.mff.cuni.cz>
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
Hi!
On Sat, Jul 29, 2000 at 12:04:40AM +0200, Jan Hubicka wrote:
>
> Passes bootstrap, testsuite and specint2000 on i386.
Are you sure? It breaks execute/960608-1.c at -O3 on i386 (for both -march=i386 and
-march=i686).
You can get things like (ne (const_int -50) (const_int 206)) with op0_mode
QImode etc.
>
> Fri Jul 28 20:58:15 CEST 2000 Jan Hubicka <jh@suse.cz>
>
> * simplify-rtx.c (simplify_relational_operation): Verify that mode ==
> VOIDmode implies both operands to be VOIDmode.
> (simplify_ternary_operation): Compute properly the mode of comparison.
> * combine.c (combine_simplify_rtx): Likewise.
Here is a fix (ok to commit provided it bootstraps and passes testsuite)?
2000-08-01 Jakub Jelinek <jakub@redhat.com>
* combine.c (combine_simplify_rtx): Use op0_mode and only
try other modes if op0_mode is VOIDmode.
--- gcc/combine.c.jj Mon Jul 31 20:02:09 2000
+++ gcc/combine.c Tue Aug 1 14:31:43 2000
@@ -3640,7 +3640,9 @@ combine_simplify_rtx (x, op0_mode, last,
break;
case '<':
{
- enum machine_mode cmp_mode = GET_MODE (XEXP (x, 0));
+ enum machine_mode cmp_mode =
+ op0_mode == VOIDmode ? GET_MODE (XEXP (x, 0)) : op0_mode;
+
if (cmp_mode == VOIDmode)
cmp_mode = GET_MODE (XEXP (x, 1));
temp = simplify_relational_operation (code, cmp_mode,
Jakub