From: Richard Biener <richard.guenther@gmail.com>
To: Eric Botcazou <botcazou@adacore.com>
Cc: gcc-patches@gcc.gnu.org, Jan Hubicka <hubicka@ucw.cz>
Subject: Re: [PATCH] Fix LTO type mismatch warning on transparent union
Date: Thu, 30 May 2024 19:06:59 +0200 [thread overview]
Message-ID: <4CD0C5FB-F639-4C65-BDC2-FFF1AEAE6E9C@gmail.com> (raw)
In-Reply-To: <7669030.EvYhyI6sBW@fomalhaut>
> Am 30.05.2024 um 13:46 schrieb Eric Botcazou <botcazou@adacore.com>:
>
>
>>
>> Do function pointers inter-operate TBAA wise for this case and would this
>> possibly An issue?
>
> Do you mean in LTO mode? I must say I'm not sure of the way LTO performs TBAA
> for function pointers: does it require (strict) matching of the type for all
> the parameters of the pointed-to function types?
Yes, I think in terms of how we compute canonical types. These pointer to derived types prove difficult for c23 as well (even without considering cross language interoperability and LTO).
> If so, then I guess it could
> theoretically assign different alias sets to compatible function pointers when
> one of them happens to point to the function type of a function imported with
> the transparent union gap, with some problematic fallout when objects of these
> function pointers happen to be indirectly modified in the program...
>
> Note that there is an equivalent bypass based on common_or_extern a few lines
> below in the function (although I'm not sure if it's problematic TBAA-wise).
I’d have to check. I think the diagnostic at hand tries to diagnose possible call ABI issues, so not sure why it mentions strict aliasing. Or maybe I misremember.
A patch like yours would be OK if this is really just about the ABI issue.
Richard
> --
> Eric Botcazou
>
>
prev parent reply other threads:[~2024-05-30 17:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-29 13:30 Eric Botcazou
2024-05-29 15:34 ` Richard Biener
2024-05-30 11:46 ` Eric Botcazou
2024-05-30 17:06 ` Richard Biener [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=4CD0C5FB-F639-4C65-BDC2-FFF1AEAE6E9C@gmail.com \
--to=richard.guenther@gmail.com \
--cc=botcazou@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hubicka@ucw.cz \
/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).