From: Richard Sandiford Date: Tue, 5 Sep 2017 19:58:04 +0000 (+0000) Subject: Make bitsize_mode_for_mode return an opt_mode X-Git-Tag: upstream/12.2.0~37248 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6657c1f9bda5042bb5854a3f524b02bd22f82e44;p=platform%2Fupstream%2Fgcc.git Make bitsize_mode_for_mode return an opt_mode 2017-09-05 Richard Sandiford 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5eb76c2..93b57a1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2017-09-05 Richard Sandiford + * machmode.h (bitwise_mode_for_mode): Return opt_mode. + * stor-layout.c (bitwise_mode_for_mode): Likewise. + (bitwise_type_for_mode): Update accordingly. + +2017-09-05 Richard Sandiford + * stor-layout.h (mode_for_size_tree): Return an opt_mode. * stor-layout.c (mode_for_size_tree): Likewise. (mode_for_array): Update accordingly. diff --git a/gcc/machmode.h b/gcc/machmode.h index ca30924..46150bb 100644 --- a/gcc/machmode.h +++ b/gcc/machmode.h @@ -694,7 +694,7 @@ smallest_int_mode_for_size (unsigned int size) } extern opt_scalar_int_mode int_mode_for_mode (machine_mode); -extern machine_mode bitwise_mode_for_mode (machine_mode); +extern opt_machine_mode bitwise_mode_for_mode (machine_mode); extern opt_machine_mode mode_for_vector (scalar_mode, unsigned); extern opt_machine_mode mode_for_int_vector (unsigned int, unsigned int); 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);