Commit 5a4c9a49 by Richard Biener Committed by Richard Biener

re PR rtl-optimization/91656 (wrong code with -fgcse-after-reload)

2019-09-05  Richard Biener  <rguenther@suse.de>

	PR rtl-optimization/91656
	* postreload-gcse.c (record_last_mem_set_info): Revert addition
	of early out.

	* gcc.dg/torture/pr91656-1.c: New testcase.
	* gcc.dg/torture/pr91656-2.c: Likewise.
	* gcc.dg/torture/pr91656-3.c: Likewise.

From-SVN: r275406
parent b1019384
2019-09-05 Richard Biener <rguenther@suse.de>
PR rtl-optimization/91656
* postreload-gcse.c (record_last_mem_set_info): Revert addition
of early out.
2019-09-05 Richard Biener <rguenther@suse.de>
PR middle-end/90501
* tree-inline.c (declare_return_variable): Mark the return
slot as addressable after building an address of it.
......
......@@ -696,9 +696,6 @@ record_last_reg_set_info_regno (rtx_insn *insn, int regno)
static void
record_last_mem_set_info (rtx_insn *insn)
{
if (!transp)
return;
struct modifies_mem *list_entry;
list_entry = (struct modifies_mem *) obstack_alloc (&modifies_mem_obstack,
......
2019-09-05 Richard Biener <rguenther@suse.de>
PR rtl-optimization/91656
* gcc.dg/torture/pr91656-1.c: New testcase.
* gcc.dg/torture/pr91656-2.c: Likewise.
* gcc.dg/torture/pr91656-3.c: Likewise.
2019-09-05 Nathan Sidwell <nathan@acm.org>
PR preprocessor/91639
......
/* { dg-do run } */
/* { dg-additional-options "-fgcse-after-reload" } */
int a, b, c, d, e;
static __attribute__ ((__noipa__))
int foo (int i)
{
__builtin_memmove (&i, &e, 1);
if (a > 0)
i /= e;
e /= 5;
b = 0;
return i + c + d + 5;
}
int
main (void)
{
int x = foo (4);
if (x != 5)
__builtin_abort ();
return 0;
}
/* { dg-do run { target int128 } } */
/* { dg-additional-options "-fgcse-after-reload" } */
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef unsigned long long u64;
int a, b, c;
__int128 e;
int
d (u16 g)
{
u64 f = __builtin_bswap64 (c);
f = g == a;
__builtin_memmove (&f, &e, 1);
e >>= b;
return a + f;
}
int
main (void)
{
__int128 x = d (0);
if (x != 0)
__builtin_abort ();
return 0;
}
/* { dg-do run { target int128 } } */
/* { dg-additional-options "-fgcse-after-reload" } */
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef unsigned long long u64;
int a, b, c;
int
d (u16 e, u64 f)
{
b |= e;
__builtin_memset (&f, e, 2);
a = (u16) - e >= 2 ? : __builtin_popcountll (f);
return a + c;
}
int
main (void)
{
__int128 x = d (~0, 0);
if (x != 16)
__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