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]

rtx_unchanging_p vs c++ vtable fields


Recently, libstdc++ has been being miscompiled, which causes all c++
tests to fail on alphaev6-linux.  Not sure exactly what change exposed
the problem, but the bug is that in ctype<char>::ctype,

(insn 135 133 139 (set (mem/s/u/j:DI (reg/v/u/f:DI 69)
				     [0 <variable>._vptr$facet+0 S8 A64])
        (reg:DI 90)) -1 (nil)
    (nil))

the memory reference is marked unchanging.  In a constructor, this field
is not unchanging; it will in fact be assigned once for every base class.
Once constructed, the value is unchanging, but I didn't think we make any
attempt to use this knowledge.

I might guess that this should be conditional on lang_hooks.honor_read_only,
but I have no idea what that hook really does.  I merely base this guess on
the fact that that flag is only true for Ada.


r~



Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.394
diff -c -p -d -r1.394 expr.c
*** expr.c	2001/12/07 12:15:33	1.394
--- expr.c	2001/12/08 00:50:03
*************** expand_expr (exp, target, tmode, modifie
*** 6582,6588 ****
  	/* If we are writing to this object and its type is a record with
  	   readonly fields, we must mark it as readonly so it will
  	   conflict with readonly references to those fields.  */
! 	if (modifier == EXPAND_WRITE && readonly_fields_p (type))
  	  RTX_UNCHANGING_P (temp) = 1;
  
  	return temp;
--- 6582,6588 ----
  	/* If we are writing to this object and its type is a record with
  	   readonly fields, we must mark it as readonly so it will
  	   conflict with readonly references to those fields.  */
! 	if (0 && modifier == EXPAND_WRITE && readonly_fields_p (type))
  	  RTX_UNCHANGING_P (temp) = 1;
  
  	return temp;


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