[patch] fix char* restrict

Zack Weinberg zack@codesourcery.com
Sat Mar 9 00:06:00 GMT 2002


On Wed, Mar 06, 2002 at 12:08:59PM -0800, Dan Nicolaescu wrote:
> 
> It seems that restricted char*s don't work. 
...

Would you try this patch instead?  It's completely untested, but it
attempts to fix the problem in the right place.

zw

===================================================================
Index: c-common.c
--- c-common.c	2002/03/07 11:37:00	1.296
+++ c-common.c	2002/03/09 08:06:37
@@ -2350,7 +2350,8 @@ c_common_get_alias_set (t)
      anything.  Note that all references need do this.  */
   if (TREE_CODE_CLASS (TREE_CODE (t)) == 'r'
       && TREE_CODE (TREE_TYPE (t)) == INTEGER_TYPE
-      && TYPE_PRECISION (TREE_TYPE (t)) == TYPE_PRECISION (char_type_node))
+      && TYPE_PRECISION (TREE_TYPE (t)) == TYPE_PRECISION (char_type_node)
+      && ! TYPE_RESTRICT (TREE_TYPE (t)))
     return 0;
 
   /* That's all the expressions we handle specially.  */



More information about the Gcc-patches mailing list