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]

Proper fix for nested CONSTRUCTOR


This is the proper fix for the bug that I previously changed
store_constructor for.

Tested on x86_64-linux.

2004-05-04  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* expr.c (store_constructor_field): Don't call store_constructor
	if bitsize is not a multiple of a byte.

*** expr.c	2 May 2004 22:54:03 -0000	1.643
--- expr.c	4 May 2004 19:46:43 -0000
*************** store_constructor_field (rtx target, uns
*** 4493,4497 ****
--- 4493,4500 ----
  {
    if (TREE_CODE (exp) == CONSTRUCTOR
+       /* We can only call store_constructor recursively if the size and
+ 	 bit position are on a byte boundary.  */
        && bitpos % BITS_PER_UNIT == 0
+       && (bitsize > 0 && bitsize % BITS_PER_UNIT == 0)
        /* If we have a nonzero bitpos for a register target, then we just
  	 let store_field do the bitfield handling.  This is unlikely to


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