This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Failures in branch range calculation


On Mon, 2004-05-24 at 22:58, Caroline Tice wrote:
> I sent the following response to Richard Earnshaw, but forgot to CC the 
> gcc-patches list.  Sorry.
> 
> -- Caroline Tice
> ctice@apple
> 
> 
> I have a patch I am currently working on for updating/fixing a lot of 
> small problems with
> the hot/cold partitioning stuff.  Currently, in my patch, the code for 
> the function
> text_section looks like this:
> 
> void
> text_section (void)
> {
>    if (in_section != in_text)
>      {
>        in_section = in_text;
>        fprintf (asm_out_file, "%s\n", TEXT_SECTION_ASM_OP);
>        assemble_align (FUNCTION_BOUNDARY);
>      }
> }
> 
> Will this be okay?  Will it fix your problem?  If not, what do you 
> think would be better?  I do
> not know when I will be able to submit my full patch, because I am 
> running into some
> very obscure, difficult-to-track-down bugs when I try to do a profiled 
> bootstrap on an x86/Linux
> machine, doing partitioning.  But I would be happy to submit (or have 
> you submit) a patch
> containing the above fix, if you think that would be appropriate.  
> Please let me know what
> you think.

Sorry, no this isn't going to work.  On thumb instructions are 2 bytes
long, but  FUNCTION_BOUNDARY has to be set to 4 bytes so that we can get
some interworking issues with ARM state right.  In the middle of a
function WE MUST NOT put out any additional alignment.

Just the act of switching sections should NOT cause alignment statements
to be issued -- EVER.  Sections don't have alignment constraints;
objects within them do.

Instead you'll have to identify the objects that aren't being aligned
properly and add appropriate code there.  You should investigate whether
you can use LABEL_ALIGN or LABEL_ALIGN_AFTER_BARRIER to solve your real
problem.  

It would be easier to advise on this if there was a testcase that
demonstrated the problem.

R.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]