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]

[PATCH] Fix PR 53395: tree-if-conv.c not producing MAX_EXPR


The problem here is that tree-if-conv.c produces COND_EXPR instead of
the MAX/MIN EXPRs.  When I added the expansion from COND_EXPR to
conditional moves, I assumes that the expressions which should have
been converted into MAX_EXPR/MIN_EXPR have already happened.

This fixes the problem by having tree-if-conv fold the expression so
the MIN_EXPR/MAX_EXPR appears in the IR rather than COND_EXPR and the
expansion happens correctly to the min/max rtl rather than just
through the conditional move ones.

OK?  Bootstrapped and tested on x86_64-linux-gnu with no regressions.

Thanks,
Andrew Pinski

ChangeLog:
* tree-if-conv.c (predicate_scalar_phi): Call fold_build3 instead of build3.
(predicate_mem_writes): Likewise.

Attachment: fixcondexprifcvt.diff.txt
Description: Text document


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