aboutsummaryrefslogtreecommitdiff
path: root/gcc/expmed.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2014-01-27 17:33:39 +0100
committerJeff Law <law@gcc.gnu.org>2014-01-27 09:33:39 -0700
commit904e5ccd59800428a4beb46ef7cb20313d1f4e05 (patch)
tree26d81ac85799658a9f470a135d72f105684f54b0 /gcc/expmed.h
parent48b08b187f27bfe437479ae68a54508cb59251b5 (diff)
downloadgcc-904e5ccd59800428a4beb46ef7cb20313d1f4e05.zip
gcc-904e5ccd59800428a4beb46ef7cb20313d1f4e05.tar.gz
gcc-904e5ccd59800428a4beb46ef7cb20313d1f4e05.tar.bz2
re PR bootstrap/59934 (Bootstrap fail since r206941: expmed.h:252:33: error: array subscript is above array bounds)
PR bootstrap/59934 * expmed.h (expmed_mode_index): Rework so that analysis and optimziers know when the MODE_PARTIAL_INT and MODE_VECTOR_INT cases can never be reached. From-SVN: r207137
Diffstat (limited to 'gcc/expmed.h')
-rw-r--r--gcc/expmed.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/expmed.h b/gcc/expmed.h
index 9681e41..4d01d1f 100644
--- a/gcc/expmed.h
+++ b/gcc/expmed.h
@@ -221,12 +221,21 @@ expmed_mode_index (enum machine_mode mode)
case MODE_INT:
return mode - MIN_MODE_INT;
case MODE_PARTIAL_INT:
- return mode - MIN_MODE_PARTIAL_INT + NUM_MODE_INT;
+ /* If there are no partial integer modes, help the compiler
+ to figure out this will never happen. See PR59934. */
+ if (MIN_MODE_PARTIAL_INT != VOIDmode)
+ return mode - MIN_MODE_PARTIAL_INT + NUM_MODE_INT;
+ break;
case MODE_VECTOR_INT:
- return mode - MIN_MODE_VECTOR_INT + NUM_MODE_IP_INT;
+ /* If there are no vector integer modes, help the compiler
+ to figure out this will never happen. See PR59934. */
+ if (MIN_MODE_VECTOR_INT != VOIDmode)
+ return mode - MIN_MODE_VECTOR_INT + NUM_MODE_IP_INT;
+ break;
default:
- gcc_unreachable ();
+ break;
}
+ gcc_unreachable ();
}
/* Return a pointer to a boolean contained in EOC indicating whether