View | Details | Return to bug 58145 | Differences between
and this patch

Collapse All | Expand All

(-)gcc/tree-sra.c.jj (-2 / +10 lines)
Lines 1466-1474 build_ref_for_offset (location_t loc, tr Link Here
1466
{
1466
{
1467
  tree prev_base = base;
1467
  tree prev_base = base;
1468
  tree off;
1468
  tree off;
1469
  tree mem_ref;
1469
  HOST_WIDE_INT base_offset;
1470
  HOST_WIDE_INT base_offset;
1470
  unsigned HOST_WIDE_INT misalign;
1471
  unsigned HOST_WIDE_INT misalign;
1471
  unsigned int align;
1472
  unsigned int align;
1473
  bool is_volatile = TREE_THIS_VOLATILE (TREE_TYPE (base));
1472
1474
1473
  gcc_checking_assert (offset % BITS_PER_UNIT == 0);
1475
  gcc_checking_assert (offset % BITS_PER_UNIT == 0);
1474
  get_object_alignment_1 (base, &align, &misalign);
1476
  get_object_alignment_1 (base, &align, &misalign);
Lines 1515-1522 build_ref_for_offset (location_t loc, tr Link Here
1515
    align = (misalign & -misalign);
1517
    align = (misalign & -misalign);
1516
  if (align < TYPE_ALIGN (exp_type))
1518
  if (align < TYPE_ALIGN (exp_type))
1517
    exp_type = build_aligned_type (exp_type, align);
1519
    exp_type = build_aligned_type (exp_type, align);
1518
1520
  if (is_volatile && !TREE_THIS_VOLATILE (exp_type))
1519
  return fold_build2_loc (loc, MEM_REF, exp_type, base, off);
1521
    exp_type = build_qualified_type (exp_type, TYPE_QUALS (exp_type)
1522
					       | TYPE_QUAL_VOLATILE);
1523
1524
  mem_ref = fold_build2_loc (loc, MEM_REF, exp_type, base, off);
1525
  if (TREE_THIS_VOLATILE (exp_type))
1526
    TREE_THIS_VOLATILE (mem_ref) = 1;
1527
  return mem_ref;
1520
}
1528
}
1521
1529
1522
/* Construct a memory reference to a part of an aggregate BASE at the given
1530
/* Construct a memory reference to a part of an aggregate BASE at the given

Return to bug 58145