[prev in list] [next in list] [prev in thread] [next in thread] 

List:       leaf-devel
Subject:    [leaf-devel] uboot compile problem on
From:       Erich Titl <erich.titl () think ! ch>
Date:       2014-02-13 11:02:01
Message-ID: 52FCA629.4060001 () think ! ch
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Hi

While compiling 5.x I am getting stuck at uboot

>>>>>>>>>>
part_efi.c: In function 'gpt_fill_pte':
part_efi.c:433:38: error: iteration 32u invokes undefined behavior
[-Werror=aggressive-loop-optimizations]
     (efi_char16_t)(partitions[i].name[k]);
                                      ^
part_efi.c:431:3: note: containing loop
   for (k = 0; k < name_len; k++)
   ^
cc1: all warnings being treated as errors
>>>>>>>>>>>

the gcc is from the actual toolchain
i486-unknown-linux-uclibc-gcc (GCC) 4.8.2

the code looks like
>>>>>>>>>>>
                /* partition attributes */
                memset(&gpt_e[i].attributes, 0,
                       sizeof(gpt_entry_attributes));

                /* partition name */
                name_len = sizeof(gpt_e[i].partition_name)
                        / sizeof(efi_char16_t);
                for (k = 0; k < name_len; k++)
                        gpt_e[i].partition_name[k] =
                                (efi_char16_t)(partitions[i].name[k]);
>>>>>>>>>>>>

I suspect the name_len to be the culprit, because
>>>>>
name_len = sizeof(gpt_e[i].partition_name)
                        / sizeof(efi_char16_t);

 98 typedef struct _gpt_entry {
 99         efi_guid_t partition_type_guid;
100         efi_guid_t unique_partition_guid;
101         __le64 starting_lba;
102         __le64 ending_lba;
103         gpt_entry_attributes attributes;
104         efi_char16_t partition_name[72 / sizeof (efi_char16_t)];
105 } __attribute__ ((packed)) gpt_entry;
>>>>>

partition name is of type efi_char16_t, so name_len will always be 1

Is it possible that the compiler gets confused when trying to optimize
this loop?
Any ideas how to tackle this?

Thanks

Erich


["smime.p7s" (application/pkcs7-signature)]

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk

_______________________________________________
leaf-devel mailing list
leaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/leaf-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic