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: FDO usage: -Wcoverage-mismatch should not ignore -Wno-error


This would work if there is a way to set Werror=coverage-mismatch
without having to explicitly set the option classification as
DK_ERROR.   Does this mechanism exist?

Thanks,

David

On Tue, Apr 19, 2011 at 12:52 AM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Tue, Apr 19, 2011 at 9:13 AM, Xinliang David Li <davidxl@google.com> wrote:
>> -Wcoverage-mismatch is enabled by default, and the warning is promoted
>> to error by default. However in the current implementation -Wno-error
>> can not demote the error back to warning. The patch was ported from
>> one contributed by Neil.
>>
>> OK for trunk after regression testing?
>
> I am sure there is a better way to achieve this, like making
> Werror=coverage-mismatch
> the default. ?Joseph?
>
> Richard.
>
>>
>> 2011-04-18 ?Neil Vachharajani ?<nvachhar@gmail.com>
>>
>> ? ?* flags.c: ?New flag variable.
>> ? ?* opts.c (common_handle_options): Set flag_werror_set.
>> ? ?* opts-global.c (decode_options): Delay Werror decision
>> ? ?for Wcoverage-mismatch util after options are parsed.
>>
>> The following test case can be added, but the test harness does not
>> like the extra warnings -- how can they be pruned?
>>
>> Thanks,
>>
>> David
>>
>> /* { dg-options "-O2 -Wcoverage-mismatch -Wno-error" } */
>>
>> int __attribute__((noinline)) bar (void)
>> {
>> }
>>
>> #ifdef _PROFILE_USE
>> int foo (int i)
>> {
>> ?if (i)
>> ? ?bar ();
>> ?else
>> ? bar ();
>> ?return 0;
>> }
>> #else
>> int foo (int i)
>> {
>> ?if (i)
>> ? ?bar ();
>> ?return 0;
>> }
>> #endif
>>
>> int main(int argc, char **argv)
>> {
>> ?foo (argc);
>> ?return 0;
>> }
>>
>


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