Commit aad88aed by Richard Biener Committed by Richard Biener

re PR middle-end/67120 (wrong code for volatile pointers at -O1 and above on x86_64-linux-gnu)

2015-08-05  Richard Biener  <rguenther@suse.de>

	PR middle-end/67120
	* match.pd: Compare address bases with == if they are decls
	or SSA names, not operand_equal_p.  Otherwise fail.

	* gcc.dg/torture/pr67120.c: New testcase.

From-SVN: r226623
parent a56ea54a
2015-08-05 Richard Biener <rguenther@suse.de> 2015-08-05 Richard Biener <rguenther@suse.de>
PR middle-end/67120
* match.pd: Compare address bases with == if they are decls
or SSA names, not operand_equal_p. Otherwise fail.
2015-08-05 Richard Biener <rguenther@suse.de>
PR tree-optimization/67055 PR tree-optimization/67055
* tree-ssa-ccp.c (fold_builtin_alloca_with_align): Handle * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Handle
NULL gimple_block. NULL gimple_block.
......
...@@ -1848,13 +1848,14 @@ along with GCC; see the file COPYING3. If not see ...@@ -1848,13 +1848,14 @@ along with GCC; see the file COPYING3. If not see
(if (base0 && base1) (if (base0 && base1)
(with (with
{ {
int equal; int equal = 2;
if (decl_in_symtab_p (base0) if (decl_in_symtab_p (base0)
&& decl_in_symtab_p (base1)) && decl_in_symtab_p (base1))
equal = symtab_node::get_create (base0) equal = symtab_node::get_create (base0)
->equal_address_to (symtab_node::get_create (base1)); ->equal_address_to (symtab_node::get_create (base1));
else else if ((DECL_P (base0) || TREE_CODE (base0) == SSA_NAME)
equal = operand_equal_p (base0, base1, 0); && (DECL_P (base1) || TREE_CODE (base1) == SSA_NAME))
equal = (base0 == base1);
} }
(if (equal == 1 (if (equal == 1
&& (cmp == EQ_EXPR || cmp == NE_EXPR && (cmp == EQ_EXPR || cmp == NE_EXPR
......
2015-08-05 Richard Biener <rguenther@suse.de>
PR middle-end/67120
* gcc.dg/torture/pr67120.c: New testcase.
2015-08-05 Paul Thomas <pault@gcc.gnu.org> 2015-08-05 Paul Thomas <pault@gcc.gnu.org>
PR fortran/52846 PR fortran/52846
......
/* { dg-do run } */
volatile int *volatile *a;
static volatile int *volatile **b = &a;
int
main ()
{
volatile int *volatile c;
*b = &c;
if (a != &c)
__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