This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: fix -fcompare-debug regression in free_lang_data
On Oct 16, 2009, Richard Guenther <richard.guenther@gmail.com> wrote:
> On Fri, Oct 16, 2009 at 9:42 AM, Alexandre Oliva <aoliva@redhat.com> wrote:
>> The free_lang_data pass, called when not emitting debug info, introduces
>> new alias sets for select data types that hadn't had been assigned an
>> alias set yet. ÂThis gets alias set numbers out of sync. ÂI don't know
>> of any codegen differences that follow from this, but -fcompare-debug
>> fails because of the different alias set numbers in MEMs.
>>
>> This patch arranges for free_lang_data() to not depend on whether or not
>> we're emitting debug information, removing an extraneous reference to
>> flag_gtoggle while at that. Âflag_gtoggle is only to be used when
>> processing command-line options, and it takes effect by changing the
>> debug âverbosityâ level. ÂI can't think of any legitimate reason to
>> check its value elsewhere.
>>
>> Ok to install?
> Can you try to instead simply use flag_no_strict_aliasing
> || lang_hooks.get_alias_set () instead of get_alias_set()?
No, that's not enough. We already call lang_hooks.get_alias_set().
But language-specific get_alias_set() may (and do) call get_alias_set()
for types such as unsigned versions of built-in signed types, and
unqualified versions of pointer types.
IIRC, it's precisely the built-in unsigned types that cause this,
because we call get_alias_set() for the corresponding signed types, for
which we hadn't created an alias set yet.
One simple way around this problem would be to create alias sets for all
built-in types upfront, but there are probably other ways to fix this.
Regardless, testing for flag_gtoggle there doesn't make any sense. This
is not a flag to base decisions on.
Anyhow, given the above, what do you suggest?
--
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist Red Hat Brazil Compiler Engineer