[PATCH ARM]: PR67745: Fix function alignment after __attribute__ 2/2

Christian Bruel christian.bruel@st.com
Mon Oct 12 10:56:00 GMT 2015



On 10/08/2015 04:30 PM, Bernd Schmidt wrote:
> On 10/08/2015 03:50 PM, Christian Bruel wrote:
>> Humm, I don't know what kind of alignment optimization for functions we
>> have based on a declaration only. greping DECL_ALIGN on functions there
>> are some bits in the ipa-icf code that seems to merge code using this
>> information, but I think we have a definition at that point.
>> but honestly, I'm very unfamiliar with this pass. Do you have something
>> else in mind ?
>
> I had a vague memory of us optimizing that, but I can't find the code
> either and maybe it's just not there. That doesn't mean someone isn't
> going to add it in the future, and I'm uncomfortable leaving incorrect
> DECL_ALIGN values around.
>
> It looks like rest_of_decl_compilation may be a good place to take care
> of declarations, but using FUNCTION_BOUNDARY is probably going to give
> the wrong results. So maybe a target hook, function_boundary_for_decl,
> defaulting to just returning FUNCTION_BOUNDARY? Eventually it could
> replace the macro entirely.
>
>

yes I see, I was hoping to avoid a new hook, but as you said it seems 
mandatory for the mere declaration case.

Here is one proposal, it defaults to nothing and the ARM implementation 
does not need to handle the vptr bit setting. so that simplifies a lot 
the things.

The hook is called from rest_of_decl_compilation for mere declarations 
and allocate_struct_function for definitions.






-------------- next part --------------
A non-text attachment was scrubbed...
Name: align_hook.patch
Type: text/x-patch
Size: 7362 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20151012/61f3a9a0/attachment.bin>


More information about the Gcc-patches mailing list