aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-11-22 13:58:20 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-11-22 13:58:20 +0000
commitf95c5b8ec19ded003649fadb0d36491deb009000 (patch)
tree2bc596ed89706f91e1b7c5fb7ebd2b6e5cbfce51 /gcc
parent902c4e8f958707fcddf8e641edf8a586ee629319 (diff)
downloadgcc-f95c5b8ec19ded003649fadb0d36491deb009000.zip
gcc-f95c5b8ec19ded003649fadb0d36491deb009000.tar.gz
gcc-f95c5b8ec19ded003649fadb0d36491deb009000.tar.bz2
Fix calculation of ptr_mode for MODE_PARTIAL_INT Pmode
This patch fixes a regression caused by r251469, where I'd incorrectly converted a call to mode_for_size that sometimes needs MODE_PARTIAL_INTs. 2017-11-22 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * emit-rtl.c (init_derived_machine_modes): Make sure ptr_mode has the same mode class as Pmode. From-SVN: r255057
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/emit-rtl.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 24190a7..ed0dc47 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2017-11-22 Richard Sandiford <richard.sandiford@linaro.org>
+
+ * emit-rtl.c (init_derived_machine_modes): Make sure ptr_mode
+ has the same mode class as Pmode.
+
2017-11-22 Thomas Preud'homme <thomas.preudhomme@arm.com>
* config/arm/arm.c (cmse_nonsecure_call_clear_caller_saved): Get rid of
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index a076711..428e474 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -6003,7 +6003,8 @@ init_derived_machine_modes (void)
byte_mode = opt_byte_mode.require ();
word_mode = opt_word_mode.require ();
- ptr_mode = int_mode_for_size (POINTER_SIZE, 0).require ();
+ ptr_mode = as_a <scalar_int_mode>
+ (mode_for_size (POINTER_SIZE, GET_MODE_CLASS (Pmode), 0).require ());
}
/* Create some permanent unique rtl objects shared between all functions. */