View | Details | Raw Unified | Return to bug 56098
Collapse All | Expand All | Context: (Patch / File /
)

(-)gcc/tree-ssa-phiopt.c.jj (-4 / +9 lines)
 Lines 1342-1348   nt_init_block (struct dom_walk_data *dat Link Here 
1342
    {
1342
    {
1343
      gimple stmt = gsi_stmt (gsi);
1343
      gimple stmt = gsi_stmt (gsi);
1344
1344
1345
      if (gimple_assign_single_p (stmt))
1345
      if (gimple_assign_single_p (stmt) && !gimple_has_volatile_ops (stmt))
1346
	{
1346
	{
1347
	  add_or_mark_expr (bb, gimple_assign_lhs (stmt), nontrap_set, true);
1347
	  add_or_mark_expr (bb, gimple_assign_lhs (stmt), nontrap_set, true);
1348
	  add_or_mark_expr (bb, gimple_assign_rhs1 (stmt), nontrap_set, false);
1348
	  add_or_mark_expr (bb, gimple_assign_rhs1 (stmt), nontrap_set, false);
 Lines 1419-1425   cond_store_replacement (basic_block midd Link Here 
1419
1419
1420
  /* Check if middle_bb contains of only one store.  */
1420
  /* Check if middle_bb contains of only one store.  */
1421
  if (!assign
1421
  if (!assign
1422
      || !gimple_assign_single_p (assign))
1422
      || !gimple_assign_single_p (assign)
1423
      || gimple_has_volatile_ops (assign))
1423
    return false;
1424
    return false;
1424
1425
1425
  locus = gimple_location (assign);
1426
  locus = gimple_location (assign);
 Lines 1490-1498   cond_if_else_store_replacement_1 (basic_ Link Here 
1490
  if (then_assign == NULL
1491
  if (then_assign == NULL
1491
      || !gimple_assign_single_p (then_assign)
1492
      || !gimple_assign_single_p (then_assign)
1492
      || gimple_clobber_p (then_assign)
1493
      || gimple_clobber_p (then_assign)
1494
      || gimple_has_volatile_ops (then_assign)
1493
      || else_assign == NULL
1495
      || else_assign == NULL
1494
      || !gimple_assign_single_p (else_assign)
1496
      || !gimple_assign_single_p (else_assign)
1495
      || gimple_clobber_p (else_assign))
1497
      || gimple_clobber_p (else_assign)
1498
      || gimple_has_volatile_ops (else_assign))
1496
    return false;
1499
    return false;
1497
1500
1498
  lhs = gimple_assign_lhs (then_assign);
1501
  lhs = gimple_assign_lhs (then_assign);
 Lines 1829-1835   hoist_adjacent_loads (basic_block bb0, b Link Here 
1829
1832
1830
      /* Both statements must be assignments whose RHS is a COMPONENT_REF.  */
1833
      /* Both statements must be assignments whose RHS is a COMPONENT_REF.  */
1831
      if (!gimple_assign_single_p (def1)
1834
      if (!gimple_assign_single_p (def1)
1832
	  || !gimple_assign_single_p (def2))
1835
	  || !gimple_assign_single_p (def2)
1836
	  || gimple_has_volatile_ops (def1)
1837
	  || gimple_has_volatile_ops (def2))
1833
	continue;
1838
	continue;
1834
1839
1835
      ref1 = gimple_assign_rhs1 (def1);
1840
      ref1 = gimple_assign_rhs1 (def1);
(-)gcc/testsuite/gcc.dg/pr56098.c.jj (+16 lines)
Line 0    Link Here 
1
/* PR tree-optimization/56098 */
2
/* { dg-do compile } */
3
/* { dg-options "-O2 -fdump-tree-optimized" } */
4
5
volatile int *p;
6
7
void
8
foo (int x)
9
{
10
  *p = 1;
11
  if (x)
12
    *p = 2;
13
}
14
15
/* { dg-final { scan-tree-dump-not "=\[^\n\r]*\\*p" "optimized" } } */
16
/* { dg-final { cleanup-tree-dump "optimized" } } */

Return to bug 56098