This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 4/N] Do not ICE on an invalid input for MV.


On Tue, Mar 14, 2017 at 11:24 AM, Martin Liška <mliska@suse.cz> wrote:
> Hello.
>
> This fixes ICE when one does not provide valid target names:
> __attribute__((target_clones("default,foo,bar")))
>
> In that situation I suggest to print:
>
> $ ./xgcc -B. /tmp/mvc-ice.c
> /tmp/mvc-ice.c:6:1: error: attribute(target("foo")) is unknown
>  foo ()
>  ^~~
> /tmp/mvc-ice.c:6:1: error: attribute(target("bar")) is unknown
> /tmp/mvc-ice.c: In function ‘foo.resolver’:
> cc1: fatal error: At least one more version other than the default is expected
>
> Should I add a test-case for a fatal error?

Better avoid fatal_error, can't you just return early after regular error()?

Do we error similarly for __attribute__((target_clones("default")))
from generic code?

I wonder if we can just go ahead even with num_versions == 1?


>
> Thanks,
> Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]