http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54207
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |jakub at gcc dot gnu.org
|gnu.org |
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-12-04
11:08:04 UTC ---
Created attachment 28874
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28874
gcc48-pr54207.patch
The testcase is invalid, you can't add typedefs with system reserved names
before including standard headers, nor redefine keywords to something else.
That said, in this patch is a testcase which IMHO is valid and still ICEs even
with current trunk.
The thing is that perform_implicit_conversion will not do anything if the type
is same_type_p, but different (B vs. bool in this testcase, _Bool vs. bool in
the original testcase). In both cases the other type is also a BOOLEAN_TYPE,
but distinct from the original one. Doing == boolean_true_node or ==
boolean_false_node comparison doesn't work in that case, they aren't pointer
equal (as they have distinct type), yet they operand_equal_p true. So, either
we use operand_equal_p as this patch does (the patch guards it with INTEGER_CST
check to avoid calling operand_equal_p unnecessarily, but that can be certainly
dropped and done unconditionally if Jason prefers that), or we could for
INTEGER_CSTs fold_convert them to boolean_type_node, then the pointer equality
comparison would work.