public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kyrill Tkachov <kyrylo.tkachov@arm.com>
To: James Greenhalgh <james.greenhalgh@arm.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	 Marcus Shawcroft <Marcus.Shawcroft@arm.com>,
	Richard Earnshaw <Richard.Earnshaw@arm.com>
Subject: Re: [PATCH][AArch64] Increase static buffer size in aarch64_rewrite_selected_cpu
Date: Tue, 21 Apr 2015 08:19:00 -0000	[thread overview]
Message-ID: <553607FD.9090407@arm.com> (raw)
In-Reply-To: <20150420203001.GB7414@arm.com>


On 20/04/15 21:30, James Greenhalgh wrote:
> On Mon, Apr 20, 2015 at 05:24:39PM +0100, Kyrill Tkachov wrote:
>> Hi all,
>>
>> When trying to compile a testcase with -mcpu=cortex-a57+crypto+nocrc I got
>> the weird assembler error:
>> Assembler messages:
>> Error: missing architectural extension
>> Error: unrecognized option -mcpu=cortex-a57+crypto+no
>>
>> The problem is the aarch64_rewrite_selected_cpu that is used to rewrite -mcpu
>> for big.LITTLE options has a limit of 20 characters in what it handles, which
>> we can exhaust quickly if we specify architectural extensions in a
>> fine-grained manner.
>>
>> This patch increases that character limit to 128 and adds an assert to
>> confirm that no bad things happen.
> You've implemented this as a hard ICE, was that intended?

Yeah, the idea is that before this we would silently truncate i.e. do the wrong thing.
Now, if we exceed the limit we ICE. I don't think it should be a user error because
it's not really the user's fault that the compiler doesn't handle crazy long strings
but handling arbitrary large strings would make this function more complex than I think
is needed for the majority of cases. If you plan to rewrite this in the future, we can
revisit that.


>
>> It also fixes another problem: If we pass a big.LITTLE combination with
>> feature modifiers like: -mcpu=cortex-a57.cortex-a53+nosimd
>>
>> the code will truncate everything after '.', thus destroying the extensions
>> that we want to pass.  The patch adds code to stitch the extensions back on
>> after the LITTLE cpu is removed.
> UGH, I should not be allowed near strings! This code is on my list of
> things I'd love to rewrite to this year! For now, this is OK and please
> also queue it for 5.2 when that opens for patches.

Committed to trunk with r222258.

Thanks for looking at it,
Kyrill

>
>> Ok for trunk?
> Yes, thanks. And sorry again for introducing this in the first place.
>
> James
>

  reply	other threads:[~2015-04-21  8:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-20 16:24 Kyrill Tkachov
2015-04-20 20:30 ` James Greenhalgh
2015-04-21  8:19   ` Kyrill Tkachov [this message]
2015-04-29 14:10   ` Kyrill Tkachov
2015-05-12  9:10     ` Kyrill Tkachov
2015-05-12  9:19       ` James Greenhalgh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=553607FD.9090407@arm.com \
    --to=kyrylo.tkachov@arm.com \
    --cc=Marcus.Shawcroft@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=james.greenhalgh@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).