Commit 0b64ca40 by Richard Biener Committed by Richard Biener

re PR rtl-optimization/71984 (wrong code with -O -mavx512cd)

2016-07-26  Richard Biener  <rguenther@suse.de>

	PR rtl-optimization/71984
	* simplify-rtx.c (simplify_subreg): Use GET_MODE_SIZE and prepare
	for VOIDmode.

	* gcc.dg/torture/pr71984.c: New testcase.

From-SVN: r238757
parent ab2b55c1
2016-07-26 Richard Biener <rguenther@suse.de> 2016-07-26 Richard Biener <rguenther@suse.de>
PR rtl-optimization/71984
* simplify-rtx.c (simplify_subreg): Use GET_MODE_SIZE and prepare
for VOIDmode.
2016-07-26 Richard Biener <rguenther@suse.de>
PR middle-end/72517 PR middle-end/72517
* expmed.c (extract_bit_field_1): Constrain the vector mode * expmed.c (extract_bit_field_1): Constrain the vector mode
with element size matching the extraction mode size when with element size matching the extraction mode size when
......
...@@ -6116,7 +6116,10 @@ simplify_subreg (machine_mode outermode, rtx op, ...@@ -6116,7 +6116,10 @@ simplify_subreg (machine_mode outermode, rtx op,
unsigned int part_size, final_offset; unsigned int part_size, final_offset;
rtx part, res; rtx part, res;
part_size = GET_MODE_UNIT_SIZE (GET_MODE (XEXP (op, 0))); enum machine_mode part_mode = GET_MODE (XEXP (op, 0));
if (part_mode == VOIDmode)
part_mode = GET_MODE_INNER (GET_MODE (op));
part_size = GET_MODE_SIZE (part_mode);
if (byte < part_size) if (byte < part_size)
{ {
part = XEXP (op, 0); part = XEXP (op, 0);
...@@ -6131,7 +6134,7 @@ simplify_subreg (machine_mode outermode, rtx op, ...@@ -6131,7 +6134,7 @@ simplify_subreg (machine_mode outermode, rtx op,
if (final_offset + GET_MODE_SIZE (outermode) > part_size) if (final_offset + GET_MODE_SIZE (outermode) > part_size)
return NULL_RTX; return NULL_RTX;
enum machine_mode part_mode = GET_MODE (part); part_mode = GET_MODE (part);
if (part_mode == VOIDmode) if (part_mode == VOIDmode)
part_mode = GET_MODE_INNER (GET_MODE (op)); part_mode = GET_MODE_INNER (GET_MODE (op));
res = simplify_subreg (outermode, part, part_mode, final_offset); res = simplify_subreg (outermode, part, part_mode, final_offset);
......
2016-07-26 Richard Biener <rguenther@suse.de>
PR rtl-optimization/71984
* gcc.dg/torture/pr71984.c: New testcase.
2016-07-26 Robert Suchanek <robert.suchanek@imgtec.com> 2016-07-26 Robert Suchanek <robert.suchanek@imgtec.com>
* g++.dg/vect/vect.exp: Add and set new global EFFECTIVE_TARGETS. Call * g++.dg/vect/vect.exp: Add and set new global EFFECTIVE_TARGETS. Call
......
/* { dg-do run { target lp64 } } */
/* { dg-additional-options "-w -Wno-psabi" } */
typedef unsigned char v64u8 __attribute__((vector_size(64)));
typedef unsigned long v64u64 __attribute__((vector_size(64)));
typedef unsigned char u8;
static u8 __attribute__ ((noinline, noclone))
foo (v64u64 v64u64_0)
{
return ((v64u8)(v64u64){0, v64u64_0[0]})[13];
}
int
main ()
{
u8 x = foo((v64u64){0x0706050403020100UL});
if (x != 5)
__builtin_abort ();
return 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