Commit 98f51044 by Jakub Jelinek Committed by Jakub Jelinek

re PR debug/64511 (ICE at -O3 with -g enabled on x86_64-linux-gnu)

	PR debug/64511
	* simplify-rtx.c (simplify_relational_operation_1): Don't try to
	optimize (eq/ne (and (side_effects) (const_int 0)) (const_int 0))
	into (eq/ne (and (not (side_effects)) (const_int 0)) (const_int 0)).

	* gcc.dg/pr64511.c: New test.

From-SVN: r219974
parent b85a3242
2015-01-21 Jakub Jelinek <jakub@redhat.com> 2015-01-21 Jakub Jelinek <jakub@redhat.com>
PR debug/64511
* simplify-rtx.c (simplify_relational_operation_1): Don't try to
optimize (eq/ne (and (side_effects) (const_int 0)) (const_int 0))
into (eq/ne (and (not (side_effects)) (const_int 0)) (const_int 0)).
PR sanitizer/64706 PR sanitizer/64706
* doc/invoke.texi (-fsanitize=vptr): Document. * doc/invoke.texi (-fsanitize=vptr): Document.
......
...@@ -4589,7 +4589,8 @@ simplify_relational_operation_1 (enum rtx_code code, machine_mode mode, ...@@ -4589,7 +4589,8 @@ simplify_relational_operation_1 (enum rtx_code code, machine_mode mode,
if ((code == EQ || code == NE) if ((code == EQ || code == NE)
&& op0code == AND && op0code == AND
&& rtx_equal_p (XEXP (op0, 0), op1) && rtx_equal_p (XEXP (op0, 0), op1)
&& !side_effects_p (op1)) && !side_effects_p (op1)
&& op1 != CONST0_RTX (cmp_mode))
{ {
rtx not_y = simplify_gen_unary (NOT, cmp_mode, XEXP (op0, 1), cmp_mode); rtx not_y = simplify_gen_unary (NOT, cmp_mode, XEXP (op0, 1), cmp_mode);
rtx lhs = simplify_gen_binary (AND, cmp_mode, not_y, XEXP (op0, 0)); rtx lhs = simplify_gen_binary (AND, cmp_mode, not_y, XEXP (op0, 0));
...@@ -4602,7 +4603,8 @@ simplify_relational_operation_1 (enum rtx_code code, machine_mode mode, ...@@ -4602,7 +4603,8 @@ simplify_relational_operation_1 (enum rtx_code code, machine_mode mode,
if ((code == EQ || code == NE) if ((code == EQ || code == NE)
&& op0code == AND && op0code == AND
&& rtx_equal_p (XEXP (op0, 1), op1) && rtx_equal_p (XEXP (op0, 1), op1)
&& !side_effects_p (op1)) && !side_effects_p (op1)
&& op1 != CONST0_RTX (cmp_mode))
{ {
rtx not_x = simplify_gen_unary (NOT, cmp_mode, XEXP (op0, 0), cmp_mode); rtx not_x = simplify_gen_unary (NOT, cmp_mode, XEXP (op0, 0), cmp_mode);
rtx lhs = simplify_gen_binary (AND, cmp_mode, not_x, XEXP (op0, 1)); rtx lhs = simplify_gen_binary (AND, cmp_mode, not_x, XEXP (op0, 1));
......
2015-01-21 Jakub Jelinek <jakub@redhat.com> 2015-01-21 Jakub Jelinek <jakub@redhat.com>
PR debug/64511
* gcc.dg/pr64511.c: New test.
PR rtl-optimization/62078 PR rtl-optimization/62078
* g++.dg/opt/pr62078.C: New test. * g++.dg/opt/pr62078.C: New test.
......
/* PR debug/64511 */
/* { dg-do compile } */
/* { dg-options "-O3 -g" } */
int a, c;
int *volatile b;
void
foo (int p)
{
int d;
int *e = &a;
d = ((p == 0) & *e) != 0;
b = e;
for (; c;)
;
}
void
bar (void)
{
foo (1);
}
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