[RTEMS Project] #4013: Using the size of an object to deduce the alignment is broken on some architectures

RTEMS trac trac at rtems.org
Mon Jun 29 06:24:59 UTC 2020


#4013: Using the size of an object to deduce the alignment is broken on some
architectures
-----------------------------+------------------------------
 Reporter:  Sebastian Huber  |       Owner:  Sebastian Huber
     Type:  defect           |      Status:  assigned
 Priority:  normal           |   Milestone:  5.2
Component:  score            |     Version:  5
 Severity:  normal           |  Resolution:
 Keywords:                   |  Blocked By:
 Blocking:                   |
-----------------------------+------------------------------

Comment (by Sebastian Huber):

 This ticket is not about the stack pointer. It is about the alignment of
 objects and in particular partitions. When the compiler places something
 like this on 2-byte alignment
 {{{
 typedef struct {
   uint64_t data [16];
 } area;

 #if CONFIGURE_MAXIMUM_PARTITIONS > 0
   static area partition_areas [CONFIGURE_MAXIMUM_PARTITIONS];
 #endif
 }}}
 with -O2, then the performance cannot be that bad on this architecture.

 The user has always the option to fine tune this. Why should RTEMS enforce
 artificial alignment requirements?

--
Ticket URL: <http://devel.rtems.org/ticket/4013#comment:6>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list