summaryrefslogtreecommitdiff
path: root/gcc/brig
diff options
context:
space:
mode:
authorHenry Linjamäki <henry.linjamaki@parmance.com>2017-10-31 13:00:53 +0000
committerPekka Jääskeläinen <visit0r@gcc.gnu.org>2017-10-31 13:00:53 +0000
commitf6a35e8954606007940045101284fbd7c251ed76 (patch)
treec5ec6e13c840f64388b9eea87d2b136775512a86 /gcc/brig
parent12e9c8ce6cdd8b01d1eb937a45fa037ec49eb0d0 (diff)
downloadgcc-f6a35e8954606007940045101284fbd7c251ed76.tar.gz
[BRIGFE] Fix PR 82771.
From-SVN: r254265
Diffstat (limited to 'gcc/brig')
-rw-r--r--gcc/brig/ChangeLog4
-rw-r--r--gcc/brig/brig-lang.c10
2 files changed, 9 insertions, 5 deletions
diff --git a/gcc/brig/ChangeLog b/gcc/brig/ChangeLog
index 01778599406..dede3f405f5 100644
--- a/gcc/brig/ChangeLog
+++ b/gcc/brig/ChangeLog
@@ -1,3 +1,7 @@
+2017-10-31 Henry Linjamäki <henry.linjamaki@parmance.com>
+
+ * brig-lang.c (brig_langhook_type_for_mode): Fix PR 82771.
+
2017-10-23 Richard Sandiford <richard.sandiford@linaro.org>
* brig-lang.c (brig_langhook_type_for_mode): Use scalar_int_mode
diff --git a/gcc/brig/brig-lang.c b/gcc/brig/brig-lang.c
index cff605541d0..f34d9587632 100644
--- a/gcc/brig/brig-lang.c
+++ b/gcc/brig/brig-lang.c
@@ -280,9 +280,9 @@ brig_langhook_type_for_mode (machine_mode mode, int unsignedp)
scalar_int_mode imode;
scalar_float_mode fmode;
- if (is_int_mode (mode, &imode))
+ if (is_float_mode (mode, &fmode))
{
- switch (GET_MODE_BITSIZE (imode))
+ switch (GET_MODE_BITSIZE (fmode))
{
case 32:
return float_type_node;
@@ -291,15 +291,15 @@ brig_langhook_type_for_mode (machine_mode mode, int unsignedp)
default:
/* We have to check for long double in order to support
i386 excess precision. */
- if (imode == TYPE_MODE (long_double_type_node))
+ if (fmode == TYPE_MODE (long_double_type_node))
return long_double_type_node;
gcc_unreachable ();
return NULL_TREE;
}
}
- else if (is_float_mode (mode, &fmode))
- return brig_langhook_type_for_size (GET_MODE_BITSIZE (fmode), unsignedp);
+ else if (is_int_mode (mode, &imode))
+ return brig_langhook_type_for_size (GET_MODE_BITSIZE (imode), unsignedp);
else
{
/* E.g., build_common_builtin_nodes () asks for modes/builtins