[RX] : Wrong alignment of falign-labels=n

Sandeep Kumar Singh Sandeep.Singh2@kpit.com
Sun Jun 8 03:08:00 GMT 2014


Hi,

I need some help,

The GNURX toolchain align wrong labels with option falign-labels=n, where n
is number of bytes. As per GCC manual, the GNU RX toolchain should align as
given below, The relationship between -falign-labels and expected .balign
output supposed to be:
-falign-labels=4 --> .balign 4
-falign-labels=8 --> .balign 8
-falign-labels=16 --> .balign 16

However, listed pseudo code was the like (without any optimization):
-falign-labels=1 --> .balign 2
-falign-labels=4 --> .balign 16
-falign-labels=8 --> .balign 256
-falign-labels=16 --> .balign 65536

Test Case
#include <stdio.h>
int max(int num1, int num2) ;
int main ()
{
   int a = 100 ;
   int b = 200 ;
   int ret ;
   ret = max(a, b) ;
   printf( "Max value is : %d\n", ret ) ;
   return 0 ;
}

int max(int num1, int num2)
{
   int result ;
   if (num1 > num2)
      result = num1 ;
   else
      result = num2 ;
   return result ;
}

Steps to reproduce:
$rx-elf-gcc  -falign-labels=n(n=2,4,8,16,32) -S test.c

Regards,
Sandeep Kumar Singh
Senior Technical member staff, AESBU - Infotainment & Clusters
KPIT Technologies Limited
Phone: +91-20-66525000 | cell: +91-9730704579
_____________________________________________________
KPIT | Web: www.kpit.com   Social: Facebook | Twitter | Linkedin | Youtube



More information about the Gcc-help mailing list