mirror of git://gcc.gnu.org/git/gcc.git
re PR rtl-optimization/70429 (Wrong code with -O1.)
PR rtl-optimization/70429 * combine.c (simplify_shift_const_1): For ASHIFTRT don't optimize (cst1 >> count) >> cst2 into (cst1 >> cst2) >> count if mode != result_mode. * gcc.c-torture/execute/pr70429.c: New test. From-SVN: r234531
This commit is contained in:
parent
e0bffbbb59
commit
a362f023e5
|
|
@ -1,5 +1,10 @@
|
||||||
2016-03-29 Jakub Jelinek <jakub@redhat.com>
|
2016-03-29 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR rtl-optimization/70429
|
||||||
|
* combine.c (simplify_shift_const_1): For ASHIFTRT don't optimize
|
||||||
|
(cst1 >> count) >> cst2 into (cst1 >> cst2) >> count if
|
||||||
|
mode != result_mode.
|
||||||
|
|
||||||
PR c++/70353
|
PR c++/70353
|
||||||
* tree-inline.c (remap_decls): Don't add_local_decl if
|
* tree-inline.c (remap_decls): Don't add_local_decl if
|
||||||
cfun is null.
|
cfun is null.
|
||||||
|
|
|
||||||
|
|
@ -10533,6 +10533,11 @@ simplify_shift_const_1 (enum rtx_code code, machine_mode result_mode,
|
||||||
>> orig_count, result_mode,
|
>> orig_count, result_mode,
|
||||||
&complement_p))
|
&complement_p))
|
||||||
break;
|
break;
|
||||||
|
/* For ((int) (cstLL >> count)) >> cst2 just give up. Queuing
|
||||||
|
up outer sign extension (often left and right shift) is
|
||||||
|
hardly more efficient than the original. See PR70429. */
|
||||||
|
if (code == ASHIFTRT && mode != result_mode)
|
||||||
|
break;
|
||||||
|
|
||||||
rtx new_rtx = simplify_const_binary_operation (code, mode,
|
rtx new_rtx = simplify_const_binary_operation (code, mode,
|
||||||
XEXP (varop, 0),
|
XEXP (varop, 0),
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
2016-03-29 Jakub Jelinek <jakub@redhat.com>
|
2016-03-29 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR rtl-optimization/70429
|
||||||
|
* gcc.c-torture/execute/pr70429.c: New test.
|
||||||
|
|
||||||
PR tree-optimization/70405
|
PR tree-optimization/70405
|
||||||
* gcc.dg/pr70405.c: New test.
|
* gcc.dg/pr70405.c: New test.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
/* PR rtl-optimization/70429 */
|
||||||
|
|
||||||
|
__attribute__((noinline, noclone)) int
|
||||||
|
foo (int a)
|
||||||
|
{
|
||||||
|
return (int) (0x14ff6e2207db5d1fLL >> a) >> 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
if (sizeof (int) != 4 || sizeof (long long) != 8 || __CHAR_BIT__ != 8)
|
||||||
|
return 0;
|
||||||
|
if (foo (1) != 0x3edae8 || foo (2) != -132158092)
|
||||||
|
__builtin_abort ();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue