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]

[tree-ssa] fix execute/20020412-1.c


Sigh.  Fallout from yesterday's variable-sized structure copy
gimplification fix.  This is not a real fix, as it'll break in
a nested function context.  But the only alternative is to
completely rearrange how va_arg works, which I don't intend to
do at present.


r~


        * gimplify.c (create_tmp_var): Disallow variable sized objects.
        (gimplify_modify_expr): Don't memcpy for VA_ARG_EXPR.

Index: gimplify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/gimplify.c,v
retrieving revision 1.1.2.151
diff -c -p -d -r1.1.2.151 gimplify.c
*** gimplify.c	5 May 2004 05:29:49 -0000	1.1.2.151
--- gimplify.c	5 May 2004 20:52:33 -0000
*************** create_tmp_var (tree type, const char *p
*** 350,355 ****
--- 350,359 ----
      abort ();
    if (!COMPLETE_TYPE_P (type))
      abort ();
+   /* Variable sized types require lots of machinery to create; the
+      optimizers shouldn't be doing anything of the sort.  */
+   if (TREE_CODE (TYPE_SIZE_UNIT (type)) != INTEGER_CST)
+     abort ();
  #endif
  
    tmp_var = create_tmp_var_raw (type, prefix);
*************** gimplify_modify_expr (tree *expr_p, tree
*** 2459,2465 ****
  
        /* If the value being copied is of variable width, expose the length
  	 if the copy by converting the whole thing to a memcpy.  */
!       if (TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (*to_p))) != INTEGER_CST)
  	{
  	  tree args, t, dest;
  
--- 2463,2473 ----
  
        /* If the value being copied is of variable width, expose the length
  	 if the copy by converting the whole thing to a memcpy.  */
!       /* ??? Except that we can't manage this with VA_ARG_EXPR.  Yes, this
! 	 does leave us with an edge condition that doesn't work.  The only
! 	 way out is to rearrange how VA_ARG_EXPR works.  */
!       if (TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (*to_p))) != INTEGER_CST
! 	  && TREE_CODE (*from_p) != VA_ARG_EXPR)
  	{
  	  tree args, t, dest;
  


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