[PATCH] PR18371

Steven Bosscher stevenb@suse.de
Sat Dec 18 01:25:00 GMT 2004


Hi,

This is a silly mistake where a buffer apparently needs
four elements, but an array with only three elements is
used.

This probably worked because of stack alignment?  We can
only guess...  :-)

I took the liberty to add two newlines because it makes
it easier for the human brain to see the two separate
conditional there.

Bootstrapped and tested on x86_64-suse-linux-gnu.  OK?

Gr.
Steven

	* config/i386/i386.c (ix86_split_to_parts): Use an array with
	four elements for decoding a CONST_DOUBLE on 64 bits targets.

Index: i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.756
diff -u -r1.756 i386.c
--- i386.c	17 Dec 2004 21:40:37 -0000	1.756
+++ i386.c	18 Dec 2004 01:22:04 -0000
@@ -9835,10 +9835,11 @@
 	  else if (GET_CODE (operand) == CONST_DOUBLE)
 	    {
 	      REAL_VALUE_TYPE r;
-	      long l[3];
+	      long l[4];
 
 	      REAL_VALUE_FROM_CONST_DOUBLE (r, operand);
 	      real_to_target (l, &r, mode);
+
 	      /* Do not use shift by 32 to avoid warning on 32bit systems.  */
 	      if (HOST_BITS_PER_WIDE_INT >= 64)
 	        parts[0]
@@ -9848,6 +9849,7 @@
 		       DImode);
 	      else
 	        parts[0] = immed_double_const (l[0], l[1], DImode);
+
 	      if (upper_mode == SImode)
 	        parts[1] = gen_int_mode (l[2], SImode);
 	      else if (HOST_BITS_PER_WIDE_INT >= 64)



More information about the Gcc-patches mailing list