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]

Re: fix c/17384


On Mon, Oct 18, 2004 at 10:36:59AM +0200, Richard Guenther wrote:
> > > typedef float v4sf __attribute__((mode(V4SF)));
> > 
> > For mainline?
> 
> Yes, for mainline as of yesterday.
> 
> > Have you considered following the directions and using vector_size?
> 
> But then it won't compile with 3.3 anymore (but I didn't try).  I
> guess you maybe broke support for __attribute__((mode()))) with your
> patch?

Yes.  I've applied the following.  It can be removed when we
removed the deprecation warning.  It'll then be a hard error.


r~


        * c-common.c (handle_mode_attribute): Allow scalar->vector
        type changes yet.

Index: c-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.c,v
retrieving revision 1.578
diff -u -p -r1.578 c-common.c
--- c-common.c	16 Oct 2004 22:58:45 -0000	1.578
+++ c-common.c	18 Oct 2004 21:59:17 -0000
@@ -4386,7 +4386,9 @@ handle_mode_attribute (tree *node, tree 
 	  TYPE_PRECISION (type) = TYPE_PRECISION (typefm);
 	  typefm = type;
 	}
-      else if (TREE_CODE (type) != TREE_CODE (typefm))
+      else if (VECTOR_MODE_P (mode)
+	       ? TREE_CODE (type) != TREE_CODE (TREE_TYPE (typefm))
+	       : TREE_CODE (type) != TREE_CODE (typefm))
 	{
 	  error ("mode %qs applied to inappropriate type", p);
 	  return NULL_TREE;


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