This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Don't assume at least one operand of PLUS is a CONST_INT
- To: gcc-patches at gcc dot gnu dot org
- Subject: Don't assume at least one operand of PLUS is a CONST_INT
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 01 Dec 2000 00:56:54 -0200
- Organization: GCC Team, Red Hat
Another one I caught on sh-elf with strict checking enabled. Ok to
install?
Index: gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* final.c (output_addr_const) <PLUS>: Don't assume at least one
operand is a CONST_INT.
Index: gcc/final.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/final.c,v
retrieving revision 1.149
diff -u -p -r1.149 final.c
--- gcc/final.c 2000/11/23 06:37:23 1.149
+++ gcc/final.c 2000/12/01 02:55:37
@@ -3724,7 +3724,8 @@ output_addr_const (file, x)
else
{
output_addr_const (file, XEXP (x, 0));
- if (INTVAL (XEXP (x, 1)) >= 0)
+ if (GET_CODE (XEXP (x, 1)) != CONST_INT
+ || INTVAL (XEXP (x, 1)) >= 0)
fprintf (file, "+");
output_addr_const (file, XEXP (x, 1));
}
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me