i686 bootstrap problem

Richard Henderson rth@redhat.com
Thu Apr 12 20:05:00 GMT 2001


There are two problems here.  The second would not have been noticed
without the first, which is embarrasingly inexcusable.

(1) regmove.c doesn't see the prototype for can_throw_internal
    (and warns about it, which is the inexcusable part), which
    means it thinks it returns "int" instead of "bool".

(2) _Bool is not always taking part in the normal type promotions.

Fixing either is sufficient to return to bootstrapville, though
both should be addressed.  I've checked in

        * Makefile.in (regmove.o): Depend on except.h.
        * remove.c: Include it.

as obvious while I investigate (2).  I _think_ the following
is correct, but I'm not altogether sure; I'm still building
and testing.


r~


	* c-common.h (C_PROMOTING_INTEGER_TYPE_P): Add boolean.
	* c-typeck.c (default_conversion): Remove now dead boolean check.

Index: c-common.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.h,v
retrieving revision 1.66
diff -c -p -d -r1.66 c-common.h
*** c-common.h	2001/04/12 18:23:08	1.66
--- c-common.h	2001/04/13 02:51:17
*************** extern void c_common_lang_init			PARAMS 
*** 532,543 ****
     ANSI C states explicitly the list of types that promote;
     in particular, short promotes to int even if they have the same width.  */
  #define C_PROMOTING_INTEGER_TYPE_P(t)				\
!   (TREE_CODE ((t)) == INTEGER_TYPE				\
     && (TYPE_MAIN_VARIANT (t) == char_type_node			\
         || TYPE_MAIN_VARIANT (t) == signed_char_type_node	\
         || TYPE_MAIN_VARIANT (t) == unsigned_char_type_node	\
         || TYPE_MAIN_VARIANT (t) == short_integer_type_node	\
!        || TYPE_MAIN_VARIANT (t) == short_unsigned_type_node))
  
  extern int self_promoting_args_p		PARAMS ((tree));
  extern tree simple_type_promotes_to		PARAMS ((tree));
--- 532,544 ----
     ANSI C states explicitly the list of types that promote;
     in particular, short promotes to int even if they have the same width.  */
  #define C_PROMOTING_INTEGER_TYPE_P(t)				\
!  ((TREE_CODE (t) == INTEGER_TYPE				\
     && (TYPE_MAIN_VARIANT (t) == char_type_node			\
         || TYPE_MAIN_VARIANT (t) == signed_char_type_node	\
         || TYPE_MAIN_VARIANT (t) == unsigned_char_type_node	\
         || TYPE_MAIN_VARIANT (t) == short_integer_type_node	\
!        || TYPE_MAIN_VARIANT (t) == short_unsigned_type_node))	\
!   || TREE_CODE (t) == BOOLEAN_TYPE)
  
  extern int self_promoting_args_p		PARAMS ((tree));
  extern tree simple_type_promotes_to		PARAMS ((tree));
Index: c-typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-typeck.c,v
retrieving revision 1.116
diff -c -p -d -r1.116 c-typeck.c
*** c-typeck.c	2001/04/10 22:40:47	1.116
--- c-typeck.c	2001/04/13 02:51:17
*************** default_conversion (exp)
*** 973,981 ****
        return convert (integer_type_node, exp);
      }
  
-   if (code == BOOLEAN_TYPE)
-     return convert (integer_type_node, exp);
- 
    if (flag_traditional && !flag_allow_single_precision
        && TYPE_MAIN_VARIANT (type) == float_type_node)
      return convert (double_type_node, exp);
--- 973,978 ----



More information about the Gcc-patches mailing list