From feda5134d63e547b661120b02daa4516b098e0c1 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 5 Mar 2004 17:09:34 +0000 Subject: [PATCH] re PR inline-asm/6162 (i386 asm reloader ice in reload_cse_simplify_operands) PR inline-asm/6162 * reload.c (find_reloads): Only support one pair of commutative operands. From-SVN: r78976 --- gcc/ChangeLog | 6 ++++++ gcc/reload.c | 17 ++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 45a72b864047..aeade98f3978 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-03-05 Ian Lance Taylor + + PR inline-asm/6162 + * reload.c (find_reloads): Only support one pair of commutative + operands. + 2004-03-02 Richard Henderson PR middle-end/11767 diff --git a/gcc/reload.c b/gcc/reload.c index dc65f94dcdba..285ddf0b5b6e 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -1,6 +1,6 @@ /* Search an insn for pseudo regs that must be in hard regs and are not. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -2661,7 +2661,15 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) if (i == noperands - 1) abort (); - commutative = i; + /* We currently only support one commutative pair of + operands. Some existing asm code currently uses more + than one pair. Previously, that would usually work, + but sometimes it would crash the compiler. We + continue supporting that case as well as we can by + silently ignoring all but the first pair. In the + future we may handle it correctly. */ + if (commutative < 0) + commutative = i; } else if (ISDIGIT (c)) { @@ -3025,9 +3033,8 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) break; case '%': - /* The last operand should not be marked commutative. */ - if (i != noperands - 1) - commutative = i; + /* We only support one commutative marker, the first + one. We already set commutative above. */ break; case '?': -- 2.47.2