From: "Kewen.Lin" <linkw@linux.ibm.com>
To: richard.sandiford@arm.com
Cc: apinski@marvell.com, gcc-patches@gcc.gnu.org, polacek@redhat.com,
Joseph Myers <joseph@codesourcery.com>,
jason@redhat.com, nathan@acm.org,
Segher Boessenkool <segher@kernel.crashing.org>
Subject: Re: [PATCH] Fix aarch64 PR 99657: ICE with SVE types used without an error
Date: Thu, 8 Dec 2022 17:15:49 +0800 [thread overview]
Message-ID: <c0fdb768-d97a-7b0e-8935-e0e4035ad9ae@linux.ibm.com> (raw)
In-Reply-To: <mptv8mm732s.fsf@arm.com>
on 2022/12/8 15:43, Richard Sandiford wrote:
> "Kewen.Lin" <linkw@linux.ibm.com> writes:
>> on 2022/12/7 20:55, Richard Sandiford wrote:
>>> "Kewen.Lin" <linkw@linux.ibm.com> writes:
>>>> Hi Richard,
>>>>
>>>> on 2022/12/7 17:16, Richard Sandiford wrote:
>>>>> "Kewen.Lin" <linkw@linux.ibm.com> writes:
>>>>>> Hi,
>>>>>>
>>>>>> In the recent discussion on how to make some built-in type only valid for
>>>>>> some target features efficiently[1], Andrew mentioned this patch which he
>>>>>> made previously (Thanks!). I confirmed it can help rs6000 related issue,
>>>>>> and noticed PR99657 is still opened, so I think we still want this to
>>>>>> be reviewed.
>>>>>
>>>>> But does it work for things like:
>>>>>
>>>>> void f(foo_t *x, foo_t *y) { *x = *y; }
>>>>>
>>>>> where no variables are being created with foo_t type?
>>>>>
>>>>
>>>> I think it can work for this case as it touches build_indirect_ref.
>>>
>>> Ah, ok. But indirecting through a pointer doesn't seem to match
>>> TCTX_AUTO_STORAGE.
>>>
>>
>> Indeed. :)
>>
>>> I guess another case is where there are global variables of the type
>>> that you want to forbid, compiled while the target feature is enabled,
>>> and then a function tries to access those variables with the target
>>> feature locally disabled (through a pragma or attribute). Does that
>>> case work?
>>>
>>
>> Thanks for pointing out this, I tried with the below test case:
>>
>> __vector_quad a1;
>> __vector_quad a2;
>>
>> __attribute__((target("cpu=power8")))
>> void foo ()
>> {
>> a2 = a3;
>> }
>>
>> the verify_type_context doesn't catch it as you suspected, I think
>> it needs some enhancements somewhere.
>
> FWIW, another possible case is:
>
> foo_t f();
> void g(foo_t);
> void h() { g(f()); }
>
> I'm not aware of any verify_type_context checks that would catch this
> for SVE (since it's valid for SVE types).
OK, thanks for the information, MMA built-in types are not allowed to be
used in function arguments, by hacking with the restriction relaxing, I
confirm the verify_type_context check can't catch this case.
BR,
Kewen
prev parent reply other threads:[~2022-12-08 9:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-09 10:09 apinski
2021-11-09 14:38 ` Richard Sandiford
2022-12-07 2:21 ` Kewen.Lin
2022-12-07 9:16 ` Richard Sandiford
2022-12-07 11:29 ` Kewen.Lin
2022-12-07 12:55 ` Richard Sandiford
2022-12-08 2:14 ` Kewen.Lin
2022-12-08 7:43 ` Richard Sandiford
2022-12-08 9:15 ` Kewen.Lin [this message]
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=c0fdb768-d97a-7b0e-8935-e0e4035ad9ae@linux.ibm.com \
--to=linkw@linux.ibm.com \
--cc=apinski@marvell.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jason@redhat.com \
--cc=joseph@codesourcery.com \
--cc=nathan@acm.org \
--cc=polacek@redhat.com \
--cc=richard.sandiford@arm.com \
--cc=segher@kernel.crashing.org \
/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).