re PR middle-end/70127 (wrong code on x86_64-linux-gnu at -O3 in 32-bit and 64-bit modes)

PR tree-optimization/70127
	* fold-const.c (operand_equal_p): Revert the 2015-10-28 change.

	* gcc.c-torture/execute/pr70127.c: New test.

From-SVN: r234090
This commit is contained in:
Jakub Jelinek 2016-03-09 21:05:40 +01:00 committed by Jakub Jelinek
parent 96b3c82df1
commit 2bd8090ff5
4 changed files with 36 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2016-03-08 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/70127
* fold-const.c (operand_equal_p): Revert the 2015-10-28 change.
2016-03-09 David Malcolm <dmalcolm@redhat.com>
PR c/68473

View File

@ -3032,6 +3032,9 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
TYPE_SIZE (TREE_TYPE (arg1)),
flags)))
return 0;
/* Verify that access happens in similar types. */
if (!types_compatible_p (TREE_TYPE (arg0), TREE_TYPE (arg1)))
return 0;
/* Verify that accesses are TBAA compatible. */
if (!alias_ptr_types_compatible_p
(TREE_TYPE (TREE_OPERAND (arg0, 1)),

View File

@ -1,3 +1,8 @@
2016-03-08 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/70127
* gcc.c-torture/execute/pr70127.c: New test.
2016-03-09 Cesar Philippidis <cesar@codesourcery.com>
* c-c++-common/goacc/combined-directives-2.c: New test.

View File

@ -0,0 +1,23 @@
/* PR tree-optimization/70127 */
struct S { int f; signed int g : 2; } a[1], c = {5, 1}, d;
short b;
__attribute__((noinline, noclone)) void
foo (int x)
{
if (x != 1)
__builtin_abort ();
}
int
main ()
{
while (b++ <= 0)
{
struct S e = {1, 1};
d = e = a[0] = c;
}
foo (a[0].g);
return 0;
}