[patch] Fix the failures created by fix for PR 27144

Zdenek Dvorak rakdver@atrey.karlin.mff.cuni.cz
Tue May 2 19:55:00 GMT 2006


Hello,

unsigned_type_for assumes size_type_node is unsigned, which is not the
case with ada and fortran frontend; for more details, see
http://gcc.gnu.org/ml/gcc/2006-05/msg00024.html.

Until I am sure what the proper fix is, and as a temporary solution to make
ada bootstrap again, I will install the following patch that ensures
that the result of unsigned_type_for is unsigned and the result of
signed_type_for signed.

Bootstrapped & regtested on x86_64 and ia64.

Zdenek

	* tree.c (unsigned_type_for, signed_type_for): Make sure a type
	of the correct signedness is returned.

Index: tree.c
===================================================================
*** tree.c	(revision 113460)
--- tree.c	(working copy)
*************** tree
*** 6990,6996 ****
  unsigned_type_for (tree type)
  {
    if (POINTER_TYPE_P (type))
!     return size_type_node;
    return lang_hooks.types.unsigned_type (type);
  }
  
--- 6990,6996 ----
  unsigned_type_for (tree type)
  {
    if (POINTER_TYPE_P (type))
!     return lang_hooks.types.unsigned_type (size_type_node);
    return lang_hooks.types.unsigned_type (type);
  }
  
*************** unsigned_type_for (tree type)
*** 6999,7004 ****
--- 6999,7006 ----
  tree
  signed_type_for (tree type)
  {
+   if (POINTER_TYPE_P (type))
+     return lang_hooks.types.signed_type (size_type_node);
    return lang_hooks.types.signed_type (type);
  }
  



More information about the Gcc-patches mailing list