This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: {tree-ssa] Fixes re multiple type nodes from IMA
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: Dale Johannesen <dalej at apple dot com>
- Cc: gcc-patches Patches <gcc-patches at gcc dot gnu dot org>, Andrew Pinski <pinskia at physics dot uc dot edu>
- Date: Wed, 10 Mar 2004 22:22:35 -0800
- Subject: Re: Patch: {tree-ssa] Fixes re multiple type nodes from IMA
- References: <62947E6B-72FE-11D8-8D44-000A95D7CD40@apple.com>
I feel like this is the wrong approach. Having a language independent
optimizations which
do not depend on language information is one of things which the
tree-ssa got right, well
the other thing is target independence.
I really think the front-end should not be lying to the middle-end
about types at all, all
the fix up to the types should happen in the front-end before getting
to the middle-end.
Also there huge problems right now in the C++ front-end because of the
way it handles types
and such so it can generate trees which look like this:
void copystruct1(teststruct) (param)
{
struct
{
double d;
char f1;
} * local.0;
struct
{
double d;
char f1;
} * param.1;
char T.2;
{
struct teststruct local;
param.f1 = 0;
local.0 = (struct
{
double d;
char f1;
} *)&local;
param.1 = (struct
{
double d;
char f1;
} *)¶m;
*local.0 = *param.1;
{
T.2 = local.f1;
if (T.2 != 0)
{
{
link_error ();
}
}
else
{
}
}
}
}
Which makes optimizations like SRA hard.
C++ should have fixed it up so it would look like this instead:
struct new_type
{
double d;
char f1;
};
void copystruct1(teststruct) (param)
{
new_type* local.0;
new_type * param.1;
char T.2;
{
struct new_type local;
param.f1 = 0;
local.0 = &local;
param.1 = ¶m;
*local.0 = *param.1;
{
T.2 = local.f1;
if (T.2 != 0)
{
{
link_error ();
}
}
else
{
}
}
}
}
Then there is no issue with inheritance. This should also happen with
the C front-end
when doing IMA and such also.
This example comes from PR 13954.
Thanks,
Andrew Pinski