[PATCH, C++] Make Canonical ICE instead of just warn when mismatching

Doug Gregor doug.gregor@gmail.com
Thu Jan 4 22:26:00 GMT 2007


On 1/4/07, Andrew_Pinski@playstation.sony.com
> Maybe the code should be written as:
>
> #ifdef ENABLE_CHECKING
>               /* The two types are structurally equivalent, but their
>                  canonical types were different. This is a failure of the
>                  canonical type propagation code.*/
>               error ("canonical types differ for identical types %T and
> %T",
>                      t1, t2);
>               debug_tree (t1);
>               debug_tree (t2);
>               gcc_unreachable ();
> #else
>               warning(0,
>                       "canonical types differ for identical types %T and
> %T",
>                       t1, t2);
> #endif
>
> And then we don't have to worry about the weird debugging trees getting in
> the way.

That's not a bad solution... ICEing when we run into a problem and
ENABLE_CHECKING is defined means that we'll catch more bugs earlier,
which is probably a good thing, and release compilers
(--disable-checking) will still have the graceful degradation behavior
with the warning.

  Cheers,
  Doug



More information about the Gcc-patches mailing list