[Bug middle-end/24053] [4.1 Regression] Ada bootstrap ICE in build_int_cst_wide, at tree.c:795

ebotcazou at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Sep 27 09:55:00 GMT 2005


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-09-27 09:55 -------
> This looks like a latent bug in the Ada front-end as the only change to the
> middle-end would be the change to use TYPE_MAIN_VARIANT.

No, it isn't, please investigate a minimum before writing such a statement. 
It's a latent consistency bug in the integer-share-limit stuff.

In build_int_cst_wide, we're asserting that the type of shared constants
attached to a type is precisely that type:

      t = TREE_VEC_ELT (TYPE_CACHED_VALUES (type), ix);
      if (t)
	{
	  /* Make sure no one is clobbering the shared constant.  */
	  gcc_assert (TREE_TYPE (t) == type);

But in set_sizetype we're boldly copying TYPE_CACHED_VALUES between types:

  /* We do want to use bitsizetype's cache, as we will be replacing that
     type.  */
  TYPE_CACHED_VALUES (t) = TYPE_CACHED_VALUES (bitsizetype);
  TYPE_CACHED_VALUES_P (t) = TYPE_CACHED_VALUES_P (bitsizetype);


Nathan, who is right here?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nathan at codesourcery dot
                   |                            |com
          Component|ada                         |middle-end


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24053



More information about the Gcc-bugs mailing list