This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/66520] bad code generated code for branches with single &
- From: "fkastrati at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 14 Jun 2015 11:26:06 +0000
- Subject: [Bug c++/66520] bad code generated code for branches with single &
- Auto-submitted: auto-generated
- References: <bug-66520-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66520
--- Comment #7 from Fisnik <fkastrati at gmail dot com> ---
(In reply to Eric Botcazou from comment #5)
> > Compiler should not generate the same code, and should listen to the
> > developer, when she/he connects predicates with single `&'. I already wrote
> > that I did benchmarks, and also mentioned a paper from a top computer
> > science conference (which I see you didn't even bother to read it) which has
> > all the evidence required.
>
> You're still missing the point! If the non-branchy form is the fastest,
> then the compiler should generate it also with the short-circuit form &&.
>
> > And I also mentioned it that Intel's compiler is catching this very well.
>
> Nope, the Intel compiler is inconsistent here (unlike GCC and Clang).
As I said, I would leave that to the developer. If I connect predicates with &,
the compiler should generate the non-branchy code. So this issue is
definatively an optimization bug.