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]

Minor fix to constant handling in expr.c


Tested on alphaev56-dec-osf4.0c.

Sat Nov  3 10:37:56 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* expr.c (expand_expr, case ADDDR_EXPR): If at top level, don't call
	force_const_mem.

*** expr.c	2001/11/02 22:17:11	1.370
--- expr.c	2001/11/03 15:16:43
*************** expand_expr (exp, target, tmode, modifie
*** 8672,8675 ****
--- 8672,8683 ----
        else if (TREE_CODE (TREE_OPERAND (exp, 0)) == ERROR_MARK)
  	return const0_rtx;
+       /* If we are taking the address of a constant and are at the
+ 	 top level, we have to use output_constant_def since we can't
+ 	 call force_const_mem at top level.  */
+       else if (cfun == 0
+ 	       && (TREE_CODE (TREE_OPERAND (exp, 0)) == CONSTRUCTOR
+ 		   || (TREE_CODE_CLASS (TREE_CODE (TREE_OPERAND (exp, 0)))
+ 		       == 'c')))
+ 	op0 = XEXP (output_constant_def (TREE_OPERAND (exp, 0), 0), 0);
        else
  	{


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