This is the mail archive of the 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]

prevent doubled diagnostics on symbol alias pairs


Compiling this code:

    /* au.c */
    extern int var __attribute__ ((alias ("undef")));

on e.g. x86-linux, the current mainline compiler emits the "aliased to
undefined" diagnostic twice:

 << au.c:1:12: error: 'var' aliased to undefined symbol 'undef'
    au.c:1:12: error: 'var' aliased to undefined symbol 'undef'

This is caused by the compiler going through finish_aliases_1
from several places for different or iterative purposes.

The attached patch is a suggestion to address this by teaching the
circuitry to remember which diags it has emitted for alias_pairs already.

Bootstrapped and regression tested on x86_64-suse-linux.

OK ?

Thanks in advance,

With Kind Regards,


2010-08-20  Olivier Hainque  <>

        * tree.h (alias_diag_flags): New enum.
        (alias_pair): Add an 'emitted_diags' field.
        * varasm.c (finish_aliases_1): Honor and update p->emitted_diags.
        (assemble_alias): Initialize emitted_diags of new pairs.

Attachment: aliasdiags.dif
Description: Text document

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