Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 194975 | Differences between
and this patch

Collapse All | Expand All

(-)gcc/stor-layout.c (-1 / +9 lines)
Lines 525-531 start_record_layout (tree t) Link Here
525
#ifdef STRUCTURE_SIZE_BOUNDARY
525
#ifdef STRUCTURE_SIZE_BOUNDARY
526
  /* Packed structures don't need to have minimum size.  */
526
  /* Packed structures don't need to have minimum size.  */
527
  if (! TYPE_PACKED (t))
527
  if (! TYPE_PACKED (t))
528
    rli->record_align = MAX (rli->record_align, (unsigned) STRUCTURE_SIZE_BOUNDARY);
528
    {
529
      unsigned tmp;
530
531
      /* #pragma pack overrides STRUCTURE_SIZE_BOUNDARY.  */
532
      tmp = (unsigned) STRUCTURE_SIZE_BOUNDARY;
533
      if (maximum_field_alignment != 0)
534
	tmp = MIN (tmp, maximum_field_alignment);
535
      rli->record_align = MAX (rli->record_align, tmp);
536
    }
529
#endif
537
#endif
530
538
531
  rli->offset = size_zero_node;
539
  rli->offset = size_zero_node;
(-)gcc/testsuite/gcc.dg/pragma-pack-4.c (+10 lines)
Line 0 Link Here
1
/* Check that pragma pack overrides STRUCTURE_SIZE_BOUNDARY.  */
2
/* { dg-do compile } */
3
4
#pragma pack(1)
5
struct S
6
{
7
  char a;
8
};
9
10
int test[sizeof(struct S) == 1 ? 1: -1];

Return to bug 194975