View | Details | Return to bug 63495
Collapse All | Expand All

(-)gcc/stor-layout.c.jj (-7 / +9 lines)
Lines 2400-2416 min_align_of_type (tree type) Link Here
2400
{
2400
{
2401
  unsigned int align = TYPE_ALIGN (type);
2401
  unsigned int align = TYPE_ALIGN (type);
2402
  align = MIN (align, BIGGEST_ALIGNMENT);
2402
  align = MIN (align, BIGGEST_ALIGNMENT);
2403
  if (!TYPE_USER_ALIGN (type))
2404
    {
2403
#ifdef BIGGEST_FIELD_ALIGNMENT
2405
#ifdef BIGGEST_FIELD_ALIGNMENT
2404
  align = MIN (align, BIGGEST_FIELD_ALIGNMENT);
2406
      align = MIN (align, BIGGEST_FIELD_ALIGNMENT);
2405
#endif
2407
#endif
2406
  unsigned int field_align = align;
2408
      unsigned int field_align = align;
2407
#ifdef ADJUST_FIELD_ALIGN
2409
#ifdef ADJUST_FIELD_ALIGN
2408
  tree field = build_decl (UNKNOWN_LOCATION, FIELD_DECL, NULL_TREE,
2410
      tree field = build_decl (UNKNOWN_LOCATION, FIELD_DECL, NULL_TREE, type);
2409
			   type);
2411
      field_align = ADJUST_FIELD_ALIGN (field, field_align);
2410
  field_align = ADJUST_FIELD_ALIGN (field, field_align);
2412
      ggc_free (field);
2411
  ggc_free (field);
2412
#endif
2413
#endif
2413
  align = MIN (align, field_align);
2414
      align = MIN (align, field_align);
2415
    }
2414
  return align / BITS_PER_UNIT;
2416
  return align / BITS_PER_UNIT;
2415
}
2417
}
2416
2418
(-)gcc/testsuite/gcc.target/i386/pr63495.c.jj (+6 lines)
Line 0 Link Here
1
/* PR c/63495 */
2
/* { dg-do compile { target { i?86-*-linux* x86_64-*-linux* } } } */
3
/* { dg-options "-std=gnu11" } */
4
5
struct __attribute__ ((aligned (8))) S { char c; };
6
_Static_assert (_Alignof (struct S) >= 8, "wrong alignment");

Return to bug 63495