public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/111270] New: gcc/config/i386/i386-options.cc:3039:8: warning: duplicated ‘if ’ condition [-Wduplicated-cond]
@ 2023-09-01 14:54 dcb314 at hotmail dot com
2023-09-01 15:05 ` [Bug target/111270] " dcb314 at hotmail dot com
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: dcb314 at hotmail dot com @ 2023-09-01 14:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111270
Bug ID: 111270
Summary: gcc/config/i386/i386-options.cc:3039:8: warning:
duplicated ‘if ’ condition [-Wduplicated-cond]
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: dcb314 at hotmail dot com
Target Milestone: ---
Source code is
if (ix86_tune_features [X86_TUNE_AVOID_256FMA_CHAINS])
SET_OPTION_IF_UNSET (opts, opts_set, param_avoid_fma_max_bits, 512);
else if (ix86_tune_features [X86_TUNE_AVOID_256FMA_CHAINS])
SET_OPTION_IF_UNSET (opts, opts_set, param_avoid_fma_max_bits, 256);
else if (ix86_tune_features [X86_TUNE_AVOID_128FMA_CHAINS])
SET_OPTION_IF_UNSET (opts, opts_set, param_avoid_fma_max_bits, 128);
Suggest code rework.
I got this by adding -Wduplicated-cond to a build.
If someone were brave enough to add this warning flag to -Wall, then
other developers could benefit from a well hidden but useful flag.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/111270] gcc/config/i386/i386-options.cc:3039:8: warning: duplicated ‘if ’ condition [-Wduplicated-cond]
2023-09-01 14:54 [Bug target/111270] New: gcc/config/i386/i386-options.cc:3039:8: warning: duplicated ‘if ’ condition [-Wduplicated-cond] dcb314 at hotmail dot com
@ 2023-09-01 15:05 ` dcb314 at hotmail dot com
2023-09-01 20:43 ` redi at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: dcb314 at hotmail dot com @ 2023-09-01 15:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111270
David Binderman <dcb314 at hotmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |redi at gcc dot gnu.org
--- Comment #1 from David Binderman <dcb314 at hotmail dot com> ---
git blame says:
^d4ba3b369 (Jonathan Wakely 2022-11-01 09:48:41 +0000 3037) if
(ix86_tune_features [X86_TUNE_AVOID_256FMA_CHAINS])
eef81eefcd (Jan Hubicka 2022-12-22 10:55:46 +0100 3038)
SET_OPTION_IF_UNSET (opts, opts_set, param_avoid_fma_max_bits, 512);
Adding Jonathan for their best advice.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/111270] gcc/config/i386/i386-options.cc:3039:8: warning: duplicated ‘if ’ condition [-Wduplicated-cond]
2023-09-01 14:54 [Bug target/111270] New: gcc/config/i386/i386-options.cc:3039:8: warning: duplicated ‘if ’ condition [-Wduplicated-cond] dcb314 at hotmail dot com
2023-09-01 15:05 ` [Bug target/111270] " dcb314 at hotmail dot com
@ 2023-09-01 20:43 ` redi at gcc dot gnu.org
2023-09-01 20:44 ` redi at gcc dot gnu.org
2023-09-01 21:02 ` dcb314 at hotmail dot com
3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2023-09-01 20:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111270
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This is nothing to do with me, g:d4ba3b369 doesn't touch that file at all, and
git blame doesn't show that commit for me. Do you have a shallow clone maybe,
and d4ba3b369 is simply the first commit in your history?
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/111270] gcc/config/i386/i386-options.cc:3039:8: warning: duplicated ‘if ’ condition [-Wduplicated-cond]
2023-09-01 14:54 [Bug target/111270] New: gcc/config/i386/i386-options.cc:3039:8: warning: duplicated ‘if ’ condition [-Wduplicated-cond] dcb314 at hotmail dot com
2023-09-01 15:05 ` [Bug target/111270] " dcb314 at hotmail dot com
2023-09-01 20:43 ` redi at gcc dot gnu.org
@ 2023-09-01 20:44 ` redi at gcc dot gnu.org
2023-09-01 21:02 ` dcb314 at hotmail dot com
3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2023-09-01 20:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111270
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The correct git blame output is:
105c2795b0d6 gcc/config/i386/i386-options.c (Jan Hubicka 2019-07-23
09:35:18 +0000 3037) if (ix86_tune_features [X86_TUNE_AVOID_256FMA_CHAINS])
eef81eefcdc2 gcc/config/i386/i386-options.cc (Jan Hubicka 2022-12-22
10:55:46 +0100 3038) SET_OPTION_IF_UNSET (opts, opts_set,
param_avoid_fma_max_bits, 512);
eef81eefcdc2 gcc/config/i386/i386-options.cc (Jan Hubicka 2022-12-22
10:55:46 +0100 3039) else if (ix86_tune_features
[X86_TUNE_AVOID_256FMA_CHAINS])
028d40925205 gcc/config/i386/i386-options.c (Martin Liska 2019-11-12
11:08:40 +0100 3040) SET_OPTION_IF_UNSET (opts, opts_set,
param_avoid_fma_max_bits, 256);
105c2795b0d6 gcc/config/i386/i386-options.c (Jan Hubicka 2019-07-23
09:35:18 +0000 3041) else if (ix86_tune_features
[X86_TUNE_AVOID_128FMA_CHAINS])
028d40925205 gcc/config/i386/i386-options.c (Martin Liska 2019-11-12
11:08:40 +0100 3042) SET_OPTION_IF_UNSET (opts, opts_set,
param_avoid_fma_max_bits, 128);
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/111270] gcc/config/i386/i386-options.cc:3039:8: warning: duplicated ‘if ’ condition [-Wduplicated-cond]
2023-09-01 14:54 [Bug target/111270] New: gcc/config/i386/i386-options.cc:3039:8: warning: duplicated ‘if ’ condition [-Wduplicated-cond] dcb314 at hotmail dot com
` (2 preceding siblings ...)
2023-09-01 20:44 ` redi at gcc dot gnu.org
@ 2023-09-01 21:02 ` dcb314 at hotmail dot com
3 siblings, 0 replies; 5+ messages in thread
From: dcb314 at hotmail dot com @ 2023-09-01 21:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111270
David Binderman <dcb314 at hotmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hubicka at gcc dot gnu.org
--- Comment #4 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to Jonathan Wakely from comment #3)
> The correct git blame output is:
>
> 105c2795b0d6 gcc/config/i386/i386-options.c (Jan Hubicka
> 2019-07-23 09:35:18 +0000 3037) if (ix86_tune_features
Thanks for that. This bug looks like one for Jan, then.
My apologies for the lack of git knowledge. Despite multiple
attempts, I've never really reached a good understanding of it's
more subtle aspects.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-09-01 21:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-01 14:54 [Bug target/111270] New: gcc/config/i386/i386-options.cc:3039:8: warning: duplicated ‘if ’ condition [-Wduplicated-cond] dcb314 at hotmail dot com
2023-09-01 15:05 ` [Bug target/111270] " dcb314 at hotmail dot com
2023-09-01 20:43 ` redi at gcc dot gnu.org
2023-09-01 20:44 ` redi at gcc dot gnu.org
2023-09-01 21:02 ` dcb314 at hotmail dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).