public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Bernd Schmidt <bschmidt@redhat.com>
Cc: Richard Biener <richard.guenther@gmail.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
		Jason Merrill <jason@redhat.com>
Subject: Re: [PATCH] PR middle-end/67220: GCC fails to properly handle libcall symbol visibility of built functions
Date: Wed, 21 Oct 2015 03:42:00 -0000	[thread overview]
Message-ID: <CAMe9rOoT0fjMTuCAN81dJtrQqiKddJYvVj+esjJjuYFk-zpoWg@mail.gmail.com> (raw)
In-Reply-To: <5626D034.6000306@redhat.com>

On Tue, Oct 20, 2015 at 4:37 PM, Bernd Schmidt <bschmidt@redhat.com> wrote:
> On 10/15/2015 12:37 PM, H.J. Lu wrote:
>>
>> On Thu, Oct 15, 2015 at 1:44 AM, Richard Biener
>> <richard.guenther@gmail.com> wrote:
>>>
>>> On Wed, Oct 14, 2015 at 6:21 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>>>>
>>>> By default, there is no visibility on builtin functions.  When there is
>>>> explicitly declared visibility on the C library function which a builtin
>>>> function fall back on, we should honor the explicit visibility on the
>>>> the C library function.
>
>
>>> Doesn't the C++ FE have the same issue?
>>>
>>
>> Unlike gcc, visibility triggers a warning in g++:
>>
>> memcpy.i:2:14: warning: ‘void* memcpy(void*, const void*, size_t)’:
>> visibility attribute ignored because it conflicts with previous
>> declaration [-Wattributes]
>>   extern void *memcpy(void *dest, const void *src, size_t n)
>>                ^
>> <built-in>: note: previous declaration of ‘void* memcpy(void*, const
>> void*, size_t)’
>> [hjl@gnu-tools-1 pr67220]$
>
>
> I see no good reason for C and C++ to have different behaviour here. It
> looks like the C++ frontend sets DECL_VISIBILITY_SPECIFIED to 1 for
> builtins, causing the above behaviour. Cc'ing Jason, but I think the C++
> frontend should be changed not to set D_V_S and have the same changes as the
> C frontend for merging the visibilities.
>
> Other than that I don't see a problem with the concept. However, I also
> agree that the tests should not be i386 specific.

Sure.  Just add target-specific scan-assembler-not.

> One final question - it would seem that glibc is currently not affected by
> this problem (at least I'm not seeing memcpy@plt calls in the binary on my
> system), so how come this has become an issue now?
>
>

R_386_PLT32 only shows in .o files.  There are many of them in
libc_pic.os.

-- 
H.J.

  reply	other threads:[~2015-10-21  2:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14 16:21 H.J. Lu
2015-10-14 16:46 ` Ramana Radhakrishnan
2015-10-14 16:51   ` H.J. Lu
2015-10-14 17:17     ` Ramana Radhakrishnan
2015-10-15  8:44 ` Richard Biener
2015-10-15 10:38   ` H.J. Lu
2015-10-20 23:43     ` Bernd Schmidt
2015-10-21  3:42       ` H.J. Lu [this message]
2016-01-15 18:44       ` H.J. Lu

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=CAMe9rOoT0fjMTuCAN81dJtrQqiKddJYvVj+esjJjuYFk-zpoWg@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=bschmidt@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=richard.guenther@gmail.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).