Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Ticket #293 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Alignment of unions incorrect

Reported by: fvbommel Assigned to: lindquist
Priority: major Milestone:
Component: backend Version: hg tip
Keywords: Cc:

Description

(Filing this so it doesn't get forgotten)

If a local variable is of a union type, it may have the wrong alignment. For example, a union { short[3] arr; long l; } gets translated to { [3 x i16], i16 }, and alloca'd as that. Since the alignment of the latter type is only 2, not 8, LLVM may misalign it.

There should probably be an alloca->setAlignment(type->alignsize()); for each alloca that could possibly be for a union type (or a type containing a union).

Change History

05/14/09 07:27:15 changed by lindquist

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in rev [1350]

Copyright © 2008, LDC Development Team.