Re: Consistency of function attributes between prototype and definition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 05, 2015 at 12:05:44PM +0200, Florian Weimer wrote:
> >>>>> Maybe aligned(1) will do what you want?
> >>>>
> >>>> Interesting idea.  Would this alter generated code?
> >>>
> >>> It shouldn't -- it can only increase alignment (not decrease it).
> >>
> >> Why do you think that?
> > 
> > Because the documentation says so.  Maybe it is wrong though, I didn't
> > test it.  If so, please file a bug.
> 
> I see a difference on x86_64:
> 
> @@ -3,7 +3,6 @@
>  .LCOLDB0:
>  	.text
>  .LHOTB0:
> -	.p2align 4,,15
>  	.globl	f
>  	.type	f, @function
>  f:
> 
> I don't think this is a bug because the manual says:
> 
> “However, when you explicitly specify a function alignment this
> overrides the effect of the '-falign-functions' […] option for this
> function.”
> 
> So I think this attribute isn't useful for this purpose.  Looks like
> we'd need a new attribute, as Jeff suggested.

And even worse, for targets where minimum alignment is bigger than 1
(most risc targets), the compiler errors if you try to use aligned(1).

:-(


Segher



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux