Fix typo in remap_type_1

Eric Botcazou ebotcazou@adacore.com
Sat Sep 22 13:38:00 GMT 2007


There is a typo in the code that chains the variants after remapping

  t = TYPE_MAIN_VARIANT (type);
[...]
     {
       t = remap_type (t, id);
       TYPE_MAIN_VARIANT (new) = t;
       TYPE_NEXT_VARIANT (new) = TYPE_MAIN_VARIANT (t);
       TYPE_NEXT_VARIANT (t) = new;
     }

t is a main variant so TYPE_MAIN_VARIANT (t) == t.  The correct chaining is 
implemented in build_variant_type_copy:

  tree t, m = TYPE_MAIN_VARIANT (type);
[...]
  /* Add the new type to the chain of variants of TYPE.  */
  TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (m);
  TYPE_NEXT_VARIANT (m) = t;
  TYPE_MAIN_VARIANT (t) = m;


Bootstrapped/regtested on i586-suse-linux, applied on the mainline as obvious.


2007-09-22  Eric Botcazou  <ebotcazou@adacore.com>

	* tree-inline.c (remap_type_1): Correctly chain variants.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-diff
Size: 456 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070922/95c98321/attachment.bin>


More information about the Gcc-patches mailing list