This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

mips print_operand corrupts stack with CONST_DOUBLE


I ran into stack corruption while bootstrapping on mips-linux.  This
patch fixes it.  It's based on Jan's 2002-10-08 fix to print-rtl.c.
Makes me think we may need a typedef for string buffers meant to hold
ascii representations of real values or so...

Until we get that...  Ok to install?

Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* config/mips/mips.c (print_operand): Increase buffer size for
	real numbers.

Index: gcc/config/mips/mips.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/mips/mips.c,v
retrieving revision 1.235
diff -u -p -r1.235 mips.c
--- gcc/config/mips/mips.c 4 Oct 2002 13:50:40 -0000 1.235
+++ gcc/config/mips/mips.c 14 Oct 2002 19:17:50 -0000
@@ -5911,7 +5911,7 @@ print_operand (file, op, letter)
 	   && GET_MODE_CLASS (GET_MODE (op)) == MODE_FLOAT)
     {
       REAL_VALUE_TYPE d;
-      char s[30];
+      char s[60];
 
       REAL_VALUE_FROM_CONST_DOUBLE (d, op);
       REAL_VALUE_TO_DECIMAL (d, s, -1);
-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]