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

Andrew_Pinski@PlayStation.Sony.Com Andrew_Pinski@PlayStation.Sony.Com
Thu Jan 4 21:00:00 GMT 2007


Mike Stump <mrs@apple.com> wrote on 01/04/2007 11:23:26 AM:

> When the next compiler is released, we plan on asking users (or, they 
> might find out via word of mouth or google) if running the canonical 
> verifier fixes their problem, if it does, they have an instant work 
> around for any bug in this area, and we can quickly know that the 
> area to fix is type canonicalization.

Except two things,
One: you cannot turn off the warning without turning off all warnings.
Two: when you turn off all the warnings, you still get gabarbe to the 
screen.

Also this is an internal verifier and not one that is verifier of the C++ 
code.

It seems better to ICE rather than just warn as we trying to catch 
problems early
on, rather than going crazy when people start really testing the compiler.

One more thing, we have lots of verifiers inside GCC which we turn on/off 
while
development.

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.

Thanks,
Andrew Pinski



More information about the Gcc-patches mailing list