summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-math-opts.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-07 09:24:40 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-07 09:24:40 +0000
commitb36be69d99e98e6ec45bd6959764bbf2633f2c3c (patch)
tree9cab032721dc229018addcfb2dfbd32b743e3538 /gcc/tree-ssa-math-opts.c
parenta2fe6cb095bbd0d5fe68a33b1faa9f6e417a2401 (diff)
downloadgcc-b36be69d99e98e6ec45bd6959764bbf2633f2c3c.tar.gz
2012-03-07 Richard Guenther <rguenther@suse.de>
* tree-ssa-math-opts.c (convert_mult_to_widen): Check actual precision against gimple constraints. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185026 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-math-opts.c')
-rw-r--r--gcc/tree-ssa-math-opts.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index a00541fbdf5..ab982f50482 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -2158,6 +2158,8 @@ convert_mult_to_widen (gimple stmt, gimple_stmt_iterator *gsi)
/* Ensure that the inputs to the handler are in the correct precison
for the opcode. This will be the full mode size. */
actual_precision = GET_MODE_PRECISION (actual_mode);
+ if (2 * actual_precision > TYPE_PRECISION (type))
+ return false;
if (actual_precision != TYPE_PRECISION (type1)
|| from_unsigned1 != TYPE_UNSIGNED (type1))
{