This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] SH : Add target specific option -msort-data for SH-ELFtarget
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Anil Paranjape <AnilP1 at KPITCummins dot com>
- Cc: Richard Sandiford <richard at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 23 Jun 2005 06:37:15 -0700
- Subject: Re: [Patch] SH : Add target specific option -msort-data for SH-ELFtarget
- References: <4A1BE23A7B777442B60F4B4916AE0F13062DB870@sohm.kpit.com>
Anil Paranjape wrote:
> Hi Zack,
>
> Thank you for your comments.
> It would be really useful if this is done target independent.
I've since noticed that you or someone else at KPT posted a similar patch for
the H8 back end...
> As far as my knowledge is concerned, it requires change in
> "gcc/varasm.c".
Yes, that's where I would start.
> How to relate this feature with "-Os" option so as not to enable it by
> default ?
if (optimize_size) { ... }
Better, create a new generic -fsort-data option (common.opt) which is turned
on by optimize_size.
> Kindly guide me on how to write this patch so that it will be target
> independent.
sorry, I can't answer such a vague question. Try moving your existing code to
varasm.c, guided by optimize_size. If you find, while you are doing that,
that you have specific questions to ask, then I'll be happy to answer them.
zw