This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/72787] Query related to gcc-4_6-branch fix for Bug-49279 (Getting issue with __restrict type qualifier)
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 04 Aug 2016 08:04:56 +0000
- Subject: [Bug tree-optimization/72787] Query related to gcc-4_6-branch fix for Bug-49279 (Getting issue with __restrict type qualifier)
- Auto-submitted: auto-generated
- References: <bug-72787-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72787
--- Comment #7 from rguenther at suse dot de <rguenther at suse dot de> ---
On Thu, 4 Aug 2016, ranjan.winner at gmail dot com wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72787
>
> --- Comment #6 from martin <ranjan.winner at gmail dot com> ---
> (In reply to Richard Biener from comment #1)
> > You can't rely on __builtin_object_size this way, please look up its
> > documentation.
>
> Hi Richard,
>
> Are you pointing to this line of test-case :
>
> size_t _sz = __builtin_object_size(dst, 1);
>
> That we can't rely on __builtin_object_size this way.
> I am getting wrong size only if I use __restrict qualifier, otherwise it
> calculate correct size.
>
> Also if we directly print the value of "__builtin_object_size(dst, 1)", then I
> am getting correct size.
You are always getting a conservative size. Note that GCC 4.6 is no
longer maintained so this but is pointless.