This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch,gas,avr] PR21683: Add new pseudo instruction __gcc_isr
- From: Nick Clifton <nickc at redhat dot com>
- To: Georg-Johann Lay <avr at gjlay dot de>, Binutils Development <binutils at sourceware dot org>
- Date: Thu, 29 Jun 2017 13:43:01 +0100
- Subject: Re: [patch,gas,avr] PR21683: Add new pseudo instruction __gcc_isr
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=nickc at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C70BC72669
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C70BC72669
- References: <6005e48a-e5c3-3c32-f9f1-6dfc7f11606d@gjlay.de> <e12c983c-069b-b061-3962-786c1375e8c6@gjlay.de>
Hi Georg-Johann,
In general I think that the patch is OK, but there are a few small niggles
that I would like to see fixed:
> + chunk 1 (Prologue) or chunk 2 (Epilogue). Funktions might come
> + without epilogue or with more than one epilogue, and even code
> + located statically after the last epologue might belong to a function.
Typos: Funktions and epologue
> +static struct
> +{
> + /* Previous __gcc_isr chunk (one of the enums above or 0),
> + and it's location for diagnostics. */
> + int prev_chunk;
Umm - 0 is a valid value for the enum you are using. Either the
enum should not contain 0, or else a different value should be used
to indicate no-previous-chunk, or else the meaning of this field should
be changed.
> + if (ISR_CHUNK_Done != avr_isr.prev_chunk
> + && name[0] == '_' && name[1] == '_'
> + && 0 == strcmp (name, "__gcc_isr.n_pushed"))
Why do you bother checking name[0] and name[1] ? Unless speed of assembly
is a real issue, you could just simplify the code and drop these two tests.
> + {
> + if (!avr_isr.sym_n_pushed)
> + {
> + static int suffix;
> + char xname[30];
> + sprintf (xname, "%s.%u", name, ++suffix);
Paranoia - 30 bytes may not be enough for a pathological input file which
contains 2^31 nested symbol pushes... Using snprintf would catch this problem.
Cheers
Nick