|
|
Created:
12 years, 6 months ago by harshit Modified:
12 years, 6 months ago CC:
gcc-patches_gcc.gnu.org Visibility:
Public. |
Descriptioncommit fc3a55ccec9bc770c79f8a221f5abd397befc8f6
Author: Harshit Chopra <harshit@google.com>
Date: Thu Sep 20 17:49:59 2012 -0700
Instead of emitting absolute addresses to the function patch sections, emit relative addresses. Absolute addresses might require relocation, which is time consuming and fraught with other issues.
M gcc/config/i386/i386.c
Tested:
Ran make check-gcc and manually confirmed that the affected tests pass.
ChangeLog:
2012-09-28 Harshit Chopra <harshit@google.com>
* gcc/config/i386/i386.c (ix86_output_function_nops_prologue_epilogue): Emit relative address to function patch sections.
Patch Set 1 #
MessagesTotal messages: 9
commit fc3a55ccec9bc770c79f8a221f5abd397befc8f6 Author: Harshit Chopra <harshit@google.com> Date: Thu Sep 20 17:49:59 2012 -0700 Instead of emitting absolute addresses to the function patch sections, emit relative addresses. Absolute addresses might require relocation, which is time consuming and fraught with other issues. M gcc/config/i386/i386.c Tested: Ran make check-gcc and manually confirmed that the affected tests pass. ChangeLog: 2012-09-28 Harshit Chopra <harshit@google.com> * gcc/config/i386/i386.c (ix86_output_function_nops_prologue_epilogue): Emit relative address to function patch sections. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index f72b0b5..8c9334f 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -11098,7 +11098,7 @@ ix86_output_function_nops_prologue_epilogue (FILE *file, $LFPEL0: <pre_instruction> 0x90 (repeated num_actual_nops times) - .quad $LFPESL0 + .quad $LFPESL0 - . followed by section 'section_name' which contains the address of instruction at 'label'. */ @@ -11110,7 +11110,10 @@ ix86_output_function_nops_prologue_epilogue (FILE *file, asm_fprintf (file, ASM_BYTE"0x90\n"); fprintf (file, ASM_QUAD); + /* Output "section_label - ." for the relative address of the entry in + the section 'section_name'. */ assemble_name_raw (file, section_label); + fprintf (file, " - ."); fprintf (file, "\n"); /* Emit the backpointer section. For functions belonging to comdat group, @@ -11144,7 +11147,7 @@ ix86_output_function_nops_prologue_epilogue (FILE *file, .quad $LFPEL0 */ ASM_OUTPUT_INTERNAL_LABEL (file, section_label); - fprintf(file, ASM_QUAD"\t"); + fprintf(file, ASM_QUAD); assemble_name_raw (file, label); fprintf (file, "\n"); -- This patch is available for review at http://codereview.appspot.com/6572065
Sign in to reply to this message.
Ping! -- Harshit On Fri, Sep 28, 2012 at 2:24 AM, Harshit Chopra <harshit@google.com> wrote: > commit fc3a55ccec9bc770c79f8a221f5abd397befc8f6 > Author: Harshit Chopra <harshit@google.com> > Date: Thu Sep 20 17:49:59 2012 -0700 > > Instead of emitting absolute addresses to the function patch sections, > emit relative addresses. Absolute addresses might require relocation, which > is time consuming and fraught with other issues. > > M gcc/config/i386/i386.c > > Tested: > Ran make check-gcc and manually confirmed that the affected tests pass. > > ChangeLog: > > 2012-09-28 Harshit Chopra <harshit@google.com> > > * gcc/config/i386/i386.c > (ix86_output_function_nops_prologue_epilogue): Emit relative address to > function patch sections. > > diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c > index f72b0b5..8c9334f 100644 > --- a/gcc/config/i386/i386.c > +++ b/gcc/config/i386/i386.c > @@ -11098,7 +11098,7 @@ ix86_output_function_nops_prologue_epilogue (FILE > *file, > $LFPEL0: > <pre_instruction> > 0x90 (repeated num_actual_nops times) > - .quad $LFPESL0 > + .quad $LFPESL0 - . > followed by section 'section_name' which contains the address > of instruction at 'label'. > */ > @@ -11110,7 +11110,10 @@ ix86_output_function_nops_prologue_epilogue (FILE > *file, > asm_fprintf (file, ASM_BYTE"0x90\n"); > > fprintf (file, ASM_QUAD); > + /* Output "section_label - ." for the relative address of the entry in > + the section 'section_name'. */ > assemble_name_raw (file, section_label); > + fprintf (file, " - ."); > fprintf (file, "\n"); > > /* Emit the backpointer section. For functions belonging to comdat > group, > @@ -11144,7 +11147,7 @@ ix86_output_function_nops_prologue_epilogue (FILE > *file, > .quad $LFPEL0 > */ > ASM_OUTPUT_INTERNAL_LABEL (file, section_label); > - fprintf(file, ASM_QUAD"\t"); > + fprintf(file, ASM_QUAD); > assemble_name_raw (file, label); > fprintf (file, "\n"); > > > -- > This patch is available for review at > http://codereview.appspot.com/6572065 >
Sign in to reply to this message.
Harshit, why didn't you propose this patch for trunk? Why should we make it a google-local patch? Diego. On Fri, Sep 28, 2012 at 5:24 AM, Harshit Chopra <harshit@google.com> wrote: > commit fc3a55ccec9bc770c79f8a221f5abd397befc8f6 > Author: Harshit Chopra <harshit@google.com> > Date: Thu Sep 20 17:49:59 2012 -0700 > > Instead of emitting absolute addresses to the function patch sections, emit relative addresses. Absolute addresses might require relocation, which is time consuming and fraught with other issues. > > M gcc/config/i386/i386.c > > Tested: > Ran make check-gcc and manually confirmed that the affected tests pass. > > ChangeLog: > > 2012-09-28 Harshit Chopra <harshit@google.com> > > * gcc/config/i386/i386.c (ix86_output_function_nops_prologue_epilogue): Emit relative address to function patch sections. > > diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c > index f72b0b5..8c9334f 100644 > --- a/gcc/config/i386/i386.c > +++ b/gcc/config/i386/i386.c > @@ -11098,7 +11098,7 @@ ix86_output_function_nops_prologue_epilogue (FILE *file, > $LFPEL0: > <pre_instruction> > 0x90 (repeated num_actual_nops times) > - .quad $LFPESL0 > + .quad $LFPESL0 - . > followed by section 'section_name' which contains the address > of instruction at 'label'. > */ > @@ -11110,7 +11110,10 @@ ix86_output_function_nops_prologue_epilogue (FILE *file, > asm_fprintf (file, ASM_BYTE"0x90\n"); > > fprintf (file, ASM_QUAD); > + /* Output "section_label - ." for the relative address of the entry in > + the section 'section_name'. */ > assemble_name_raw (file, section_label); > + fprintf (file, " - ."); > fprintf (file, "\n"); > > /* Emit the backpointer section. For functions belonging to comdat group, > @@ -11144,7 +11147,7 @@ ix86_output_function_nops_prologue_epilogue (FILE *file, > .quad $LFPEL0 > */ > ASM_OUTPUT_INTERNAL_LABEL (file, section_label); > - fprintf(file, ASM_QUAD"\t"); > + fprintf(file, ASM_QUAD); > assemble_name_raw (file, label); > fprintf (file, "\n"); > > > -- > This patch is available for review at http://codereview.appspot.com/6572065
Sign in to reply to this message.
Harshit, why didn't you propose this patch for trunk? Why should we make it a google-local patch? Diego. On Fri, Sep 28, 2012 at 5:24 AM, Harshit Chopra <harshit@google.com> wrote: > commit fc3a55ccec9bc770c79f8a221f5abd397befc8f6 > Author: Harshit Chopra <harshit@google.com> > Date: Thu Sep 20 17:49:59 2012 -0700 > > Instead of emitting absolute addresses to the function patch sections, emit relative addresses. Absolute addresses might require relocation, which is time consuming and fraught with other issues. > > M gcc/config/i386/i386.c > > Tested: > Ran make check-gcc and manually confirmed that the affected tests pass. > > ChangeLog: > > 2012-09-28 Harshit Chopra <harshit@google.com> > > * gcc/config/i386/i386.c (ix86_output_function_nops_prologue_epilogue): Emit relative address to function patch sections. > > diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c > index f72b0b5..8c9334f 100644 > --- a/gcc/config/i386/i386.c > +++ b/gcc/config/i386/i386.c > @@ -11098,7 +11098,7 @@ ix86_output_function_nops_prologue_epilogue (FILE *file, > $LFPEL0: > <pre_instruction> > 0x90 (repeated num_actual_nops times) > - .quad $LFPESL0 > + .quad $LFPESL0 - . > followed by section 'section_name' which contains the address > of instruction at 'label'. > */ > @@ -11110,7 +11110,10 @@ ix86_output_function_nops_prologue_epilogue (FILE *file, > asm_fprintf (file, ASM_BYTE"0x90\n"); > > fprintf (file, ASM_QUAD); > + /* Output "section_label - ." for the relative address of the entry in > + the section 'section_name'. */ > assemble_name_raw (file, section_label); > + fprintf (file, " - ."); > fprintf (file, "\n"); > > /* Emit the backpointer section. For functions belonging to comdat group, > @@ -11144,7 +11147,7 @@ ix86_output_function_nops_prologue_epilogue (FILE *file, > .quad $LFPEL0 > */ > ASM_OUTPUT_INTERNAL_LABEL (file, section_label); > - fprintf(file, ASM_QUAD"\t"); > + fprintf(file, ASM_QUAD); > assemble_name_raw (file, label); > fprintf (file, "\n"); > > > -- > This patch is available for review at http://codereview.appspot.com/6572065
Sign in to reply to this message.
On Fri, Oct 5, 2012 at 6:53 PM, Diego Novillo <dnovillo@google.com> wrote: > Harshit, why didn't you propose this patch for trunk? Why should we > make it a google-local patch? In the meantime, let's put it in the google branches. Please make sure that you ping the upstream patch. It will need more testing than just make check-gcc. You need to do a full bootstrap with all default languages. Also, make sure that the motivation and benefits of the patch are very clear. Thanks. Diego.
Sign in to reply to this message.
Okay. I will ping the upstream patch along with the modifications that I have done so far in the google branch. -- Harshit On Fri, Oct 5, 2012 at 4:13 PM, Diego Novillo <dnovillo@google.com> wrote: > On Fri, Oct 5, 2012 at 6:53 PM, Diego Novillo <dnovillo@google.com> wrote: > > Harshit, why didn't you propose this patch for trunk? Why should we > > make it a google-local patch? > > In the meantime, let's put it in the google branches. Please make > sure that you ping the upstream patch. It will need more testing than > just make check-gcc. You need to do a full bootstrap with all default > languages. Also, make sure that the motivation and benefits of the > patch are very clear. > > > Thanks. Diego. >
Sign in to reply to this message.
xray feature is not in trunk yet. David On Fri, Oct 5, 2012 at 3:53 PM, Diego Novillo <dnovillo@google.com> wrote: > Harshit, why didn't you propose this patch for trunk? Why should we > make it a google-local patch? > > > Diego. > > On Fri, Sep 28, 2012 at 5:24 AM, Harshit Chopra <harshit@google.com> wrote: >> commit fc3a55ccec9bc770c79f8a221f5abd397befc8f6 >> Author: Harshit Chopra <harshit@google.com> >> Date: Thu Sep 20 17:49:59 2012 -0700 >> >> Instead of emitting absolute addresses to the function patch sections, emit relative addresses. Absolute addresses might require relocation, which is time consuming and fraught with other issues. >> >> M gcc/config/i386/i386.c >> >> Tested: >> Ran make check-gcc and manually confirmed that the affected tests pass. >> >> ChangeLog: >> >> 2012-09-28 Harshit Chopra <harshit@google.com> >> >> * gcc/config/i386/i386.c (ix86_output_function_nops_prologue_epilogue): Emit relative address to function patch sections. >> >> diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c >> index f72b0b5..8c9334f 100644 >> --- a/gcc/config/i386/i386.c >> +++ b/gcc/config/i386/i386.c >> @@ -11098,7 +11098,7 @@ ix86_output_function_nops_prologue_epilogue (FILE *file, >> $LFPEL0: >> <pre_instruction> >> 0x90 (repeated num_actual_nops times) >> - .quad $LFPESL0 >> + .quad $LFPESL0 - . >> followed by section 'section_name' which contains the address >> of instruction at 'label'. >> */ >> @@ -11110,7 +11110,10 @@ ix86_output_function_nops_prologue_epilogue (FILE *file, >> asm_fprintf (file, ASM_BYTE"0x90\n"); >> >> fprintf (file, ASM_QUAD); >> + /* Output "section_label - ." for the relative address of the entry in >> + the section 'section_name'. */ >> assemble_name_raw (file, section_label); >> + fprintf (file, " - ."); >> fprintf (file, "\n"); >> >> /* Emit the backpointer section. For functions belonging to comdat group, >> @@ -11144,7 +11147,7 @@ ix86_output_function_nops_prologue_epilogue (FILE *file, >> .quad $LFPEL0 >> */ >> ASM_OUTPUT_INTERNAL_LABEL (file, section_label); >> - fprintf(file, ASM_QUAD"\t"); >> + fprintf(file, ASM_QUAD); >> assemble_name_raw (file, label); >> fprintf (file, "\n"); >> >> >> -- >> This patch is available for review at http://codereview.appspot.com/6572065
Sign in to reply to this message.
Ok for google branches. Please consider resend the original xray patch to trunk (gcc-4_8) You need to make the runtime bits available publicly though. thanks, David On Fri, Sep 28, 2012 at 2:24 AM, Harshit Chopra <harshit@google.com> wrote: > commit fc3a55ccec9bc770c79f8a221f5abd397befc8f6 > Author: Harshit Chopra <harshit@google.com> > Date: Thu Sep 20 17:49:59 2012 -0700 > > Instead of emitting absolute addresses to the function patch sections, emit relative addresses. Absolute addresses might require relocation, which is time consuming and fraught with other issues. > > M gcc/config/i386/i386.c > > Tested: > Ran make check-gcc and manually confirmed that the affected tests pass. > > ChangeLog: > > 2012-09-28 Harshit Chopra <harshit@google.com> > > * gcc/config/i386/i386.c (ix86_output_function_nops_prologue_epilogue): Emit relative address to function patch sections. > > diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c > index f72b0b5..8c9334f 100644 > --- a/gcc/config/i386/i386.c > +++ b/gcc/config/i386/i386.c > @@ -11098,7 +11098,7 @@ ix86_output_function_nops_prologue_epilogue (FILE *file, > $LFPEL0: > <pre_instruction> > 0x90 (repeated num_actual_nops times) > - .quad $LFPESL0 > + .quad $LFPESL0 - . > followed by section 'section_name' which contains the address > of instruction at 'label'. > */ > @@ -11110,7 +11110,10 @@ ix86_output_function_nops_prologue_epilogue (FILE *file, > asm_fprintf (file, ASM_BYTE"0x90\n"); > > fprintf (file, ASM_QUAD); > + /* Output "section_label - ." for the relative address of the entry in > + the section 'section_name'. */ > assemble_name_raw (file, section_label); > + fprintf (file, " - ."); > fprintf (file, "\n"); > > /* Emit the backpointer section. For functions belonging to comdat group, > @@ -11144,7 +11147,7 @@ ix86_output_function_nops_prologue_epilogue (FILE *file, > .quad $LFPEL0 > */ > ASM_OUTPUT_INTERNAL_LABEL (file, section_label); > - fprintf(file, ASM_QUAD"\t"); > + fprintf(file, ASM_QUAD); > assemble_name_raw (file, label); > fprintf (file, "\n"); > > > -- > This patch is available for review at http://codereview.appspot.com/6572065
Sign in to reply to this message.
Thanks for the review. Submitted to google/main branch. Do I also need to explicitly submit this patch to google/gcc-4_7 branch? -- Harshit On Sat, Oct 6, 2012 at 10:16 AM, Xinliang David Li <davidxl@google.com>wrote: > Ok for google branches. > > Please consider resend the original xray patch to trunk (gcc-4_8) You > need to make the runtime bits available publicly though. > Will send an updated patch to trunk (with all the changes I have made since I sent the original patch). > > thanks, > > David > > On Fri, Sep 28, 2012 at 2:24 AM, Harshit Chopra <harshit@google.com> > wrote: > > commit fc3a55ccec9bc770c79f8a221f5abd397befc8f6 > > Author: Harshit Chopra <harshit@google.com> > > Date: Thu Sep 20 17:49:59 2012 -0700 > > > > Instead of emitting absolute addresses to the function patch > sections, emit relative addresses. Absolute addresses might require > relocation, which is time consuming and fraught with other issues. > > > > M gcc/config/i386/i386.c > > > > Tested: > > Ran make check-gcc and manually confirmed that the affected tests pass. > > > > ChangeLog: > > > > 2012-09-28 Harshit Chopra <harshit@google.com> > > > > * gcc/config/i386/i386.c > (ix86_output_function_nops_prologue_epilogue): Emit relative address to > function patch sections. > > > > diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c > > index f72b0b5..8c9334f 100644 > > --- a/gcc/config/i386/i386.c > > +++ b/gcc/config/i386/i386.c > > @@ -11098,7 +11098,7 @@ ix86_output_function_nops_prologue_epilogue > (FILE *file, > > $LFPEL0: > > <pre_instruction> > > 0x90 (repeated num_actual_nops times) > > - .quad $LFPESL0 > > + .quad $LFPESL0 - . > > followed by section 'section_name' which contains the address > > of instruction at 'label'. > > */ > > @@ -11110,7 +11110,10 @@ ix86_output_function_nops_prologue_epilogue > (FILE *file, > > asm_fprintf (file, ASM_BYTE"0x90\n"); > > > > fprintf (file, ASM_QUAD); > > + /* Output "section_label - ." for the relative address of the entry in > > + the section 'section_name'. */ > > assemble_name_raw (file, section_label); > > + fprintf (file, " - ."); > > fprintf (file, "\n"); > > > > /* Emit the backpointer section. For functions belonging to comdat > group, > > @@ -11144,7 +11147,7 @@ ix86_output_function_nops_prologue_epilogue > (FILE *file, > > .quad $LFPEL0 > > */ > > ASM_OUTPUT_INTERNAL_LABEL (file, section_label); > > - fprintf(file, ASM_QUAD"\t"); > > + fprintf(file, ASM_QUAD); > > assemble_name_raw (file, label); > > fprintf (file, "\n"); > > > > > > -- > > This patch is available for review at > http://codereview.appspot.com/6572065 >
Sign in to reply to this message.
|