aboutsummaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2018-08-23 14:40:14 +0200
committerSegher Boessenkool <segher@gcc.gnu.org>2018-08-23 14:40:14 +0200
commit84ea73e1bbcec5b85550ef8f3244fa7059914b47 (patch)
treec8d6615183efd32e4acc71672eb91501df528409 /gcc/expmed.c
parent21bf6b2a938864cac3f973755f8a581e4134092d (diff)
downloadgcc-84ea73e1bbcec5b85550ef8f3244fa7059914b47.zip
gcc-84ea73e1bbcec5b85550ef8f3244fa7059914b47.tar.gz
gcc-84ea73e1bbcec5b85550ef8f3244fa7059914b47.tar.bz2
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. From-SVN: r263810
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r--gcc/expmed.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index e281930..0922029 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);