re PR middle-end/59569 (r206148 causes internal compiler error: in vect_create_destination_var, at tree-vect-data-refs.c:4294)

2013-12-23  Bingfeng Mei  <bmei@broadcom.com>

	PR middle-end/59569
	* tree-vect-stmts.c (vectorizable_store): Skip permutation for
	consant operand, and add a few missing \n.

	* gcc.c-torture/compile/pr59569-1.c: New test.
	* gcc.c-torture/compile/pr59569-2.c: Ditto.

From-SVN: r206179
This commit is contained in:
Bingfeng Mei 2013-12-23 15:07:58 +00:00 committed by Bingfeng Mei
parent d3c1197403
commit f234d26028
5 changed files with 36 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2013-12-23 Bingfeng Mei <bmei@broadcom.com>
PR middle-end/59569
* tree-vect-stmts.c (vectorizable_store): Skip permutation for
consant/external operand, and add a few missing \n.
2013-12-23 H.J. Lu <hongjiu.lu@intel.com>
Tocar Ilya <ilya.tocar@intel.com>

View File

@ -1,3 +1,9 @@
2013-12-23 Bingfeng Mei <bmei@broadcom.com>
PR middle-end/59569
* gcc.c-torture/compile/pr59569-1.c: New test.
* gcc.c-torture/compile/pr59569-2.c: Ditto.
2013-12-23 Marek Polacek <polacek@redhat.com>
PR c++/59111

View File

@ -0,0 +1,9 @@
/* PR middle-end/59569 */
extern char c;
void
foo (int i, char **j)
{
while (i)
j[--i] = &c;
}

View File

@ -0,0 +1,6 @@
/* PR middle-end/59569 */
void foo (int *a, int b)
{
for (; b; b--)
a[b] = 1;
}

View File

@ -5005,7 +5005,7 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"multiple types with negative step.");
"multiple types with negative step.\n");
return false;
}
@ -5018,14 +5018,16 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"negative step but alignment required.");
"negative step but alignment required.\n");
return false;
}
if (!perm_mask_for_reverse (vectype))
if (dt != vect_constant_def
&& dt != vect_external_def
&& !perm_mask_for_reverse (vectype))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"negative step and reversing not supported.");
"negative step and reversing not supported.\n");
return false;
}
}
@ -5353,7 +5355,9 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
set_ptr_info_alignment (get_ptr_info (dataref_ptr), align,
misalign);
if (negative)
if (negative
&& dt != vect_constant_def
&& dt != vect_external_def)
{
tree perm_mask = perm_mask_for_reverse (vectype);
tree perm_dest