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]

[committed] Reinstate size > 0 check for MIPS small data


One of my 4.3 patches mistakenly dropped a small-data size > 0 check.
We have traditionally not put zero-sized objects in small data for any
-G option, and this is now part of the ABI.

Tested on mips64-linux-gnu and mipsisa64-elfoabi.  Applied.

Richard


gcc/
	* config/mips/mips.c (mips_in_small_data_p): Reinstate size > 0 check.

Index: gcc/config/mips/mips.c
===================================================================
--- gcc/config/mips/mips.c	2008-01-04 17:15:52.000000000 +0000
+++ gcc/config/mips/mips.c	2008-01-04 17:17:41.000000000 +0000
@@ -6677,8 +6677,10 @@ mips_in_small_data_p (const_tree decl)
 	return false;
     }
 
+  /* We have traditionally not treated zero-sized objects as small data,
+     so this is now effectively part of the ABI.  */
   size = int_size_in_bytes (TREE_TYPE (decl));
-  return size <= mips_small_data_threshold;
+  return size > 0 && size <= mips_small_data_threshold;
 }
 
 /* Implement TARGET_USE_ANCHORS_FOR_SYMBOL_P.  We don't want to use


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