On Fri, 2024-12-06 at 06:32 -0700, Jeff Law wrote:
> 
> On 12/6/24 5:23 AM, Sam James wrote:
> > Georg-Johann Lay <a...@gjlay.de> writes:
> > 
> > > This patch disables CRC lookup tables which consume quite some RAM.
> > 
> > Given that -foptimize-crc is new, it may be useful to CC the pass
> > authors in case they have input.
> I think this is trivially OK for the AVR.  The bigger question is should 
> we do something more general for -Os.
> 
> CRC generation through table lookups is going to take more data space. 
> You need a 256 byte table for each unique CRC (sizes & polynomial), and 
> the code to compute the index into the table can be (from a code size 
> standpoint) relatively expensive as well, particularly on the 
> micro-controllers if the crc is to be computed in a mode wider than a 
> word on the target.
> 
> So I would actually even support a more general "don't optimize CRCs by 
> default for -Os".
> 

I've been putting CRC tables for many years into .text / .rodata on various
MCU projects.  Never considered putting them into .data, since flash is
usually a lot larger than RAM.  What's the reasoning behind putting the
tables in .data?

Best regards,
Oleg Endo

Reply via email to