aboutsummaryrefslogtreecommitdiff
path: root/gcc/stor-layout.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-09-05 19:58:04 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-09-05 19:58:04 +0000
commit6657c1f9bda5042bb5854a3f524b02bd22f82e44 (patch)
treea6a555e04a44267277c331cae36cd551c3df7a4e /gcc/stor-layout.c
parent798014c58e9e54b068c30e8e2113d278a0bd6e07 (diff)
downloadgcc-6657c1f9bda5042bb5854a3f524b02bd22f82e44.zip
gcc-6657c1f9bda5042bb5854a3f524b02bd22f82e44.tar.gz
gcc-6657c1f9bda5042bb5854a3f524b02bd22f82e44.tar.bz2
Make bitsize_mode_for_mode return an opt_mode
2017-09-05 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * machmode.h (bitwise_mode_for_mode): Return opt_mode. * stor-layout.c (bitwise_mode_for_mode): Likewise. (bitwise_type_for_mode): Update accordingly. From-SVN: r251733
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r--gcc/stor-layout.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 8a3b0fe..3549f49 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -404,10 +404,10 @@ int_mode_for_mode (machine_mode mode)
}
}
-/* Find a mode that can be used for efficient bitwise operations on MODE.
- Return BLKmode if no such mode exists. */
+/* Find a mode that can be used for efficient bitwise operations on MODE,
+ if one exists. */
-machine_mode
+opt_machine_mode
bitwise_mode_for_mode (machine_mode mode)
{
/* Quick exit if we already have a suitable mode. */
@@ -445,7 +445,7 @@ bitwise_mode_for_mode (machine_mode mode)
}
/* Otherwise fall back on integers while honoring MAX_FIXED_MODE_SIZE. */
- return mode_for_size (bitsize, MODE_INT, true).else_blk ();
+ return mode_for_size (bitsize, MODE_INT, true);
}
/* Find a type that can be used for efficient bitwise operations on MODE.
@@ -454,8 +454,7 @@ bitwise_mode_for_mode (machine_mode mode)
tree
bitwise_type_for_mode (machine_mode mode)
{
- mode = bitwise_mode_for_mode (mode);
- if (mode == BLKmode)
+ if (!bitwise_mode_for_mode (mode).exists (&mode))
return NULL_TREE;
unsigned int inner_size = GET_MODE_UNIT_BITSIZE (mode);