Commit dfc2e2ac by Richard Biener Committed by Richard Biener

re PR tree-optimization/54976 (FAIL: gcc.dg/torture/pr47975.c (internal compiler error))

2012-10-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/54976
	* tree-vect-stmts.c (get_vectype_for_scalar_type_and_size):
	Robustify against odd inner_mode inputs.

From-SVN: r192611
parent 57fc62cb
2012-10-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/54976
* tree-vect-stmts.c (get_vectype_for_scalar_type_and_size):
Robustify against odd inner_mode inputs.
2012-10-19 Zhenqiang Chen <zhenqiang.chen@linaro.org> 2012-10-19 Zhenqiang Chen <zhenqiang.chen@linaro.org>
PR target/54892 PR target/54892
...@@ -6082,16 +6082,21 @@ get_vectype_for_scalar_type_and_size (tree scalar_type, unsigned size) ...@@ -6082,16 +6082,21 @@ get_vectype_for_scalar_type_and_size (tree scalar_type, unsigned size)
When the component mode passes the above test simply use a type When the component mode passes the above test simply use a type
corresponding to that mode. The theory is that any use that corresponding to that mode. The theory is that any use that
would cause problems with this will disable vectorization anyway. */ would cause problems with this will disable vectorization anyway. */
if (!SCALAR_FLOAT_TYPE_P (scalar_type) else if (!SCALAR_FLOAT_TYPE_P (scalar_type)
&& !INTEGRAL_TYPE_P (scalar_type) && !INTEGRAL_TYPE_P (scalar_type)
&& !POINTER_TYPE_P (scalar_type)) && !POINTER_TYPE_P (scalar_type))
scalar_type = lang_hooks.types.type_for_mode (inner_mode, 1); scalar_type = lang_hooks.types.type_for_mode (inner_mode, 1);
/* We can't build a vector type of elements with alignment bigger than /* We can't build a vector type of elements with alignment bigger than
their size. */ their size. */
if (nbytes < TYPE_ALIGN_UNIT (scalar_type)) else if (nbytes < TYPE_ALIGN_UNIT (scalar_type))
scalar_type = lang_hooks.types.type_for_mode (inner_mode, 1); scalar_type = lang_hooks.types.type_for_mode (inner_mode, 1);
/* If we felt back to using the mode fail if there was
no scalar type for it. */
if (scalar_type == NULL_TREE)
return NULL_TREE;
/* If no size was supplied use the mode the target prefers. Otherwise /* If no size was supplied use the mode the target prefers. Otherwise
lookup a vector mode of the specified size. */ lookup a vector mode of the specified size. */
if (size == 0) if (size == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment