This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix gnat.dg/aliasing2.adb regression


On Mon, Nov 29, 2010 at 9:24 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> OK, I acted boldly and tested the complete change. :-)
>> Bootstrapped/regtested and LTO-bootstrapped (for C/Ada) on
>> x86_64-suse-linux, OK for mainline?
>
> There was a new C++ failure among the existing ones:
>
> eric@atlantis:~/build/gcc/native32> gcc/xgcc -Bgcc -S vla9.C
> vla9.C: In function 'void f(double*, int)':
> vla9.C:13:44: internal compiler error: canonical types differ for identical
> types double [(((unsigned int)(((int)ny) + -0x000000001)) + 1)] and double
> [(((unsigned int)(((int)ny) + -0x000000001)) + 1)]
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.

Hm.  So it seems that the C++ frontend relies on
TYPE_STRUCTURAL_EQUALITY here (probably rightfully so at
least for templates and [] when looking at its comp_array_types).

Bah, looks like the patch is wrong then, unless we start unifying
non-INTEGER_CST range types by for example using
operand_equal_p for TYPE_MIN/MAX_VALUE in type_hash_eq.

But I guess that's nothing for stage3.

So your original patch is ok.

Thanks for trying,
Richard.

> #ifdef ENABLE_CHECKING
> ? ? ?if (USE_CANONICAL_TYPES)
> ? ? ? ?{
> ? ? ? ? ?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.*/
> ? ? ? ? ? ?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. */
> ? ? ? ? ? ?internal_error
> ? ? ? ? ? ? ?("same canonical type node for different types %T and %T",
> ? ? ? ? ? ? ? t1, t2);
>
> ? ? ? ? ?return result;
> ? ? ? ?}
>
> --
> Eric Botcazou
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]