params.def (PARAM_VERIFY_CANONICAL_TYPES): Remove.

2007-07-11  Douglas Gregor  <doug.gregor@gmail.com>

       * params.def (PARAM_VERIFY_CANONICAL_TYPES): Remove.
       (PARAM_USE_CANONICAL_TYPES): New; decides whether to use canonical
       types or not.
       * params.h (VERIFY_CANONICAL_TYPES): Remove.
       (USE_CANONICAL_TYPES): New.
       * doc/invoke.texi (verify-canonical-types): Remove.
       (use-canonical-types): Add.

2007-07-11  Douglas Gregor  <doug.gregor@gmail.com>

       * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
       canonical types; otherwise, fall back to structural type
       comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
       internal compiler error if the canonical types are wrong.

From-SVN: r126550
This commit is contained in:
Douglas Gregor 2007-07-11 13:50:13 +00:00 committed by Doug Gregor
parent 039cb25833
commit 7313518b90
6 changed files with 55 additions and 46 deletions

View File

@ -1,3 +1,13 @@
2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
* params.def (PARAM_VERIFY_CANONICAL_TYPES): Remove.
(PARAM_USE_CANONICAL_TYPES): New; decides whether to use canonical
types or not.
* params.h (VERIFY_CANONICAL_TYPES): Remove.
(USE_CANONICAL_TYPES): New.
* doc/invoke.texi (verify-canonical-types): Remove.
(use-canonical-types): Add.
2007-07-11 Ulrich Weigand <uweigand@de.ibm.com>
* config/spu/spu.c (spu_optimization_options): Remove setting of

View File

@ -1,3 +1,10 @@
2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
* typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
canonical types; otherwise, fall back to structural type
comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
internal compiler error if the canonical types are wrong.
2007-07-11 Paolo Carlini <pcarlini@suse.de>
PR c++/32560

View File

@ -1108,8 +1108,6 @@ comptypes (tree t1, tree t2, int strict)
{
if (strict == COMPARE_STRICT)
{
bool result;
if (t1 == t2)
return true;
@ -1121,37 +1119,34 @@ comptypes (tree t1, tree t2, int strict)
perform a deep check. */
return structural_comptypes (t1, t2, strict);
if (VERIFY_CANONICAL_TYPES)
#ifdef ENABLE_CHECKING
if (USE_CANONICAL_TYPES)
{
result = structural_comptypes (t1, t2, strict);
bool result = structural_comptypes (t1, t2, strict);
if (result && TYPE_CANONICAL (t1) != TYPE_CANONICAL (t2))
{
/* The two types are structurally equivalent, but their
canonical types were different. This is a failure of the
canonical type propagation code.*/
warning(0,
"canonical types differ for identical types %T and %T",
t1, t2);
debug_tree (t1);
debug_tree (t2);
}
/* The two types are structurally equivalent, but their
canonical types were different. This is a failure of the
canonical type propagation code.*/
internal_error
("canonical types differ for identical types %T and %T",
t1, t2);
else if (!result && TYPE_CANONICAL (t1) == TYPE_CANONICAL (t2))
{
/* Two types are structurally different, but the canonical
types are the same. This means we were over-eager in
assigning canonical types. */
warning (0,
"same canonical type node for different types %T and %T",
t1, t2);
debug_tree (t1);
debug_tree (t2);
}
/* Two types are structurally different, but the canonical
types are the same. This means we were over-eager in
assigning canonical types. */
internal_error
("same canonical type node for different types %T and %T",
t1, t2);
return result;
}
else
#else
if (USE_CANONICAL_TYPES)
return TYPE_CANONICAL (t1) == TYPE_CANONICAL (t2);
#endif
else
return structural_comptypes (t1, t2, strict);
}
else if (strict == COMPARE_STRUCTURAL)
return structural_comptypes (t1, t2, COMPARE_STRICT);

View File

@ -6960,12 +6960,12 @@ The size of cache line in L1 cache, in bytes.
@item l1-cache-size
The number of cache lines in L1 cache.
@item verify-canonical-types
Whether the compiler should verify the ``canonical'' types used for
type equality comparisons within the C++ and Objective-C++ front
ends. Set to 1 (the default when GCC is configured with
--enable-checking) to enable verification, 0 to disable verification
(the default when GCC is configured with --disable-checking).
@item use-canonical-types
Whether the compiler should use the ``canonical'' type system. By
default, this should always be 1, which uses a more efficient internal
mechanism for comparing types in C++ and Objective-C++. However, if
bugs in the canonical type system are causing compilation failures,
set this value to 0 to disable canonical types.
@end table
@end table

View File

@ -673,19 +673,16 @@ DEFPARAM (PARAM_L1_CACHE_LINE_SIZE,
"The size of L1 cache line",
32, 0, 0)
#ifdef ENABLE_CHECKING
# define GCC_CANONICAL_TYPES_DEFAULT 1
#else
# define GCC_CANONICAL_TYPES_DEFAULT 0
#endif
/* Whether we should use canonical types rather than deep "structural"
type checking. Setting this value to 1 (the default) improves
compilation performance in the C++ and Objective-C++ front end;
this value should only be set to zero to work around bugs in the
canonical type system by disabling it. */
/* Whether we should verify that the canonical types in the system are
consistent with the "structural" typing. */
DEFPARAM (PARAM_VERIFY_CANONICAL_TYPES,
"verify-canonical-types",
"Whether to verify canonical types",
GCC_CANONICAL_TYPES_DEFAULT, 0, 1)
DEFPARAM (PARAM_USE_CANONICAL_TYPES,
"use-canonical-types",
"Whether to use canonical types",
1, 0, 1)
/*
Local variables:
mode:c

View File

@ -168,6 +168,6 @@ typedef enum compiler_param
PARAM_VALUE (PARAM_L1_CACHE_SIZE)
#define L1_CACHE_LINE_SIZE \
PARAM_VALUE (PARAM_L1_CACHE_LINE_SIZE)
#define VERIFY_CANONICAL_TYPES \
PARAM_VALUE (PARAM_VERIFY_CANONICAL_TYPES)
#define USE_CANONICAL_TYPES \
PARAM_VALUE (PARAM_USE_CANONICAL_TYPES)
#endif /* ! GCC_PARAMS_H */