From: segher Date: Thu, 23 Aug 2018 12:40:14 +0000 (+0000) Subject: Fix recent bug in canonicalize_comparison (PR87026) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a80c47f0d8ca07531d458563a5b3f43f2728223a;p=thirdparty%2Fgcc.git Fix recent bug in canonicalize_comparison (PR87026) The new code testing which way a comparison is best expressed creates a pseudoregister (by hand) and creates some insns with that. Such insns will no longer recog() when pseudo-registers are no longer aloowed (after reload). But we have an ifcvt pass after reload (ce3). This patch simply returns if we cannot create pseudos. PR rtl-optimization/87026 * expmed.c (canonicalize_comparison): If we can no longer create pseudoregisters, don't. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263810 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7b7c79bbb7df..8cf5ab143804 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-08-23 Segher Boessenkool + + PR rtl-optimization/87026 + * expmed.c (canonicalize_comparison): If we can no longer create + pseudoregisters, don't. + 2018-08-23 Richard Earnshaw PR target/86951 diff --git a/gcc/expmed.c b/gcc/expmed.c index e2819309e4bb..0922029de809 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -6243,6 +6243,10 @@ canonicalize_comparison (machine_mode mode, enum rtx_code *code, rtx *imm) if (overflow) return; + /* The following creates a pseudo; if we cannot do that, bail out. */ + if (!can_create_pseudo_p ()) + return; + rtx reg = gen_rtx_REG (mode, LAST_VIRTUAL_REGISTER + 1); rtx new_imm = immed_wide_int_const (imm_modif, mode);