johannes    02/08/14 14:44:08

  Modified:    gcc      tree.c
  Log:
  Fixes for vector debug-info bugs 2997607 and 2947813.
  
  Revision  Changes    Path
  1.44      +14 -10    gcc3/gcc/tree.c
  
  Index: tree.c
  ===================================================================
  RCS file: /cvs/Darwin/gcc3/gcc/tree.c,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- tree.c    2002/08/07 03:13:10     1.43
  +++ tree.c    2002/08/14 21:44:08     1.44
  @@ -4664,7 +4664,7 @@
   #endif /* ENABLE_TREE_CHECKING */
   
   /* For a new vector type node T, build the information necessary for
  -   debuggint output.  */
  +   debugging output.  */
   
   static void
   finish_vector_type (t)
  @@ -4674,7 +4674,12 @@
   
     {
       tree index = build_int_2 (TYPE_VECTOR_SUBPARTS (t) - 1, 0);
  -    tree array = build_array_type (TREE_TYPE (t),
  +    /* APPLE LOCAL AltiVec */
  +    /* Use unsigned_char_type rather than int_QI_type, etc.
  +       so debug info is common with nonvector unsigned char */
  +    tree array = build_array_type (
  +         type_for_mode (TYPE_MODE (TREE_TYPE (t)),
  +                        TREE_UNSIGNED (TREE_TYPE (t))),
                                   build_index_type (index));
       tree rt = make_node (RECORD_TYPE);
   
  @@ -4833,7 +4838,7 @@
   
     /* APPLE LOCAL begin AltiVec */
     unsigned_VPIXEL_type_node 
  -    = make_vector (V4HImode, unsigned_intHI_type_node, 1);
  +    = make_vector (V8HImode, unsigned_intHI_type_node, 1);
     /* The 'vector bool...' and 'vector unsigned...' types are the
        same as far as the back-end is concerned, but are distinct
        for purposes of C/C++ type resolution.  */  
  @@ -4863,10 +4868,7 @@
   
   static tree
   make_vector (mode, innertype, unsignedp)
  -     /* APPLE LOCAL AltiVec */
  -     /* Mark mode as ATTRIBUTE_UNUSED. With Altivec, mode is always
  -     set to V4SImode, irrespective of input param mode.  */
  -     enum machine_mode mode ATTRIBUTE_UNUSED;
  +     enum machine_mode mode;
        tree innertype;
        int unsignedp;
   {
  @@ -4874,11 +4876,13 @@
   
     t = make_node (VECTOR_TYPE);
     TREE_TYPE (t) = innertype;
  -  /* APPLE LOCAL AltiVec */
  -  TYPE_MODE (t) = V4SImode;
     TREE_UNSIGNED (TREE_TYPE (t)) = unsignedp;
  +  TYPE_MODE (t) = mode;
     finish_vector_type (t);
  -
  +  /* APPLE LOCAL AltiVec */
  +  /* Overwrite the real mode with V4SImode for all vectors.  This is */
  +  /* placed below finish_vector_type so the debug array size is right.  */
  +  TYPE_MODE (t) = V4SImode;
     return t;
   }
   
  
  
  


Reply via email to