Commit ed9d5a4a by Uros Bizjak

re PR c/39779 (ICE shifting byte to the right with constant > 7FFFFFFF)

	PR rtl-optimization/39779
	* expr.c (convert_modes): Return when mode == oldmode after
	CONST_INTs are processed.

testsuite/ChangeLog:

	PR rtl-optimization/39779
	* gcc.dg/pr39979.c: New test.

From-SVN: r151573
parent 3d887721
...@@ -761,9 +761,6 @@ convert_modes (enum machine_mode mode, enum machine_mode oldmode, rtx x, int uns ...@@ -761,9 +761,6 @@ convert_modes (enum machine_mode mode, enum machine_mode oldmode, rtx x, int uns
if (GET_MODE (x) != VOIDmode) if (GET_MODE (x) != VOIDmode)
oldmode = GET_MODE (x); oldmode = GET_MODE (x);
if (mode == oldmode)
return x;
/* There is one case that we must handle specially: If we are converting /* There is one case that we must handle specially: If we are converting
a CONST_INT into a mode whose size is twice HOST_BITS_PER_WIDE_INT and a CONST_INT into a mode whose size is twice HOST_BITS_PER_WIDE_INT and
we are to interpret the constant as unsigned, gen_lowpart will do we are to interpret the constant as unsigned, gen_lowpart will do
...@@ -829,6 +826,9 @@ convert_modes (enum machine_mode mode, enum machine_mode oldmode, rtx x, int uns ...@@ -829,6 +826,9 @@ convert_modes (enum machine_mode mode, enum machine_mode oldmode, rtx x, int uns
return gen_lowpart (mode, x); return gen_lowpart (mode, x);
} }
if (mode == oldmode)
return x;
/* Converting from integer constant into mode is always equivalent to an /* Converting from integer constant into mode is always equivalent to an
subreg operation. */ subreg operation. */
if (VECTOR_MODE_P (mode) && GET_MODE (x) == VOIDmode) if (VECTOR_MODE_P (mode) && GET_MODE (x) == VOIDmode)
......
2009-09-09 Uros Bizjak <ubizjak@gmail.com>
PR rtl-optimization/39779
* gcc.dg/pr39979.c: New test.
2009-09-09 Richard Guenther <rguenther@suse.de> 2009-09-09 Richard Guenther <rguenther@suse.de>
PR tree-optimization/41101 PR tree-optimization/41101
......
/* { dg-do compile } */
/* { dg-options "-w" } */
int test (char v1)
{
v1 >>= 0xdebecced;
return v1;
}
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