[LLVMdev] RFC: llvm-convert.cpp Patch

Bill Wendling isanbard at gmail.com
Wed Nov 7 00:16:36 PST 2007


On Nov 6, 2007, at 6:07 PM, Dale Johannesen wrote:

>
> On Nov 6, 2007, at 5:45 PM, Bill Wendling wrote:
>> $ more testcase.c.t03.generic
>> Qux ()
>> {
>>   static char C.0[11] = {0};
>>   char Bar[11];
>>
>>   Bar = C.0;
>> }
>>
>> Anyway, it turns out that the gimplifier was generating the correct
>> alignment, but it was being overridden in assemble_variable():
>>
>>   /* On some machines, it is good to increase alignment  
>> sometimes.  */
>>   if (! DECL_USER_ALIGN (decl))
>>     {
>> #ifdef DATA_ALIGNMENT
>>       align = DATA_ALIGNMENT (TREE_TYPE (decl), align);
>> #endif
>> #ifdef CONSTANT_ALIGNMENT
>> =>    if (DECL_INITIAL (decl) != 0 && DECL_INITIAL (decl) !=
>> error_mark_node)
>>         align = CONSTANT_ALIGNMENT (DECL_INITIAL (decl), align);
>> #endif
>>     }
>
> Not sure I'm getting it, is this Bar itself or the constructed C.0
> that's getting realigned?
>
It's C.0 that's getting realigned.

-bw




More information about the llvm-dev mailing list