[PATCH 4/N] Do not ICE on an invalid input for MV.
Richard Biener
richard.guenther@gmail.com
Tue Mar 14 13:47:00 GMT 2017
On Tue, Mar 14, 2017 at 1:24 PM, Martin Liška <mliska@suse.cz> wrote:
> On 03/14/2017 12:09 PM, Richard Biener wrote:
>> 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()?
>
> Yep. Early bail out would be better.
>
>>
>> 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?
>
> It's covered in MV pass:
>
> $ ./xgcc -B. /tmp/mvc-single.c
> /tmp/mvc-single.c:6:1: warning: single target_clones attribute is ignored
> foo ()
I see.
Attached patch is ok.
Thanks,
Richard.
> Martin
>
>>
>>
>>>
>>> Thanks,
>>> Martin
>
More information about the Gcc-patches
mailing list