https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83748

--- Comment #6 from Sumit <sbansal at ciena dot com> ---
mstrict-align does not seems to help. Only aligning them forcefully does work.

  ome_CardCfgPxfp_t                 xfpPecInfo __attribute__((aligned(4)));
  ome_CardCfgPsfp_t                 sfpPecInfo __attribute__((aligned(4)));
  ome_CardCfgPcfp_t                 cfpPecInfo __attribute__((aligned(4)));

Looks like that the base address of the structure itself is misaligned causing
all its elements to be misaligned as well.

In the below assembly, clearly an odd value is being pushed into r26 and r31
/vobs/viking_tsam/tsamgbb/fac/gbbotmntg.c:807
 3b53920:       3b 21 01 27     addi    r25,r1,295
/vobs/viking_tsam/tsamgbb/fac/gbbotmntg.c:806
 3b53924:       3b e1 01 23     addi    r31,r1,291
/vobs/viking_tsam/tsamgbb/fac/gbbotmntg.c:805
 3b53928:       3b 41 01 1f     addi    r26,r1,287
/vobs/viking_tsam/tsamgbb/fac/gbbotmntg.c:808

Later, r26 and r31 being pushed to floating point register.

/vobs/viking_tsam/tsamgbb/fac/gbbotmntg.c:838
 3b539f0:       c0 3a 00 00     lfs     f1,0(r26)
 3b539f4:       c0 1f 00 00     lfs     f0,0(r31)

Can the sequence of local elements in this function can cause some issue,
because there are couple of elements which are of odd bytes in size such as
GBB_FAC_ROLE_t = 1 byte
GBB_DISP_BasicPortInfoList_t = 117 bytes

But as per my understanding, proper padding would have been added in between to
nullify their effects.

Reply via email to