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]

[PATCH, rs6000] Fix "volatile vector" types


Hello,

this is a small bugfix to AltiVec handling that was implemented in
the out-of-tree GCC builds for Cell, but was not yet contributed
to the mainline version.

When applying the altivec attribute to define a vector type, the
code in rs6000_handle_altivec_attribute today takes care to move
a "const" type qualifier to the resulting vector type, but does not
the same for other qualifiers, notably "volatile".

Note that constructing generic vector types (or SPU vectors) will
respect the volatile qualifier as well.

The patch below adds this to the rs6000 back end.

Tested on powerpc64-linux.

OK for mainline and 4.3?

Bye,
Ulrich


Index: gcc/config/rs6000/rs6000.c
===================================================================
*** gcc/config/rs6000/rs6000.c	(revision 138706)
--- gcc/config/rs6000/rs6000.c	(working copy)
*************** rs6000_handle_altivec_attribute (tree *n
*** 20273,20280 ****
      default: break;
      }
  
!   if (result && result != type && TYPE_READONLY (type))
!     result = build_qualified_type (result, TYPE_QUAL_CONST);
  
    *no_add_attrs = true;  /* No need to hang on to the attribute.  */
  
--- 20273,20282 ----
      default: break;
      }
  
!   /* Propagate qualifiers attached to the element type
!      onto the vector type.  */
!   if (result && result != type && TYPE_QUALS (type))
!     result = build_qualified_type (result, TYPE_QUALS (type));
  
    *no_add_attrs = true;  /* No need to hang on to the attribute.  */
  
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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