From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96604 invoked by alias); 9 Apr 2015 21:29:24 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 96570 invoked by uid 55); 9 Apr 2015 21:29:20 -0000 From: "xur at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/65724] __builtin_object_size difference for C and C++ Date: Thu, 09 Apr 2015 21:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: xur at google dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-04/txt/msg00766.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65724 --- Comment #2 from xur at google dot com --- Do you mean the result of 0 in g++ is intentional? But I'm not quite understand the relation with _FORTIFY_SOURCE=2. This macro does not seem to be check in tree-objsz pass. In other words, if I unset _FORTIFY_SOURCE or set it 1, I still get the same result. Could you give me some pointer of the reference that I can check? Thanks, Rong On Thu, Apr 9, 2015 at 2:05 PM, jakub at gcc dot gnu.org < gcc-bugzilla@gcc.gnu.org> wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65724 > > Jakub Jelinek changed: > > What |Removed |Added > > ---------------------------------------------------------------------------- > CC| |jakub at gcc dot gnu.org > > --- Comment #1 from Jakub Jelinek --- > Well, C has flexible array members, while C++ does not have those, so > there is > a significant difference in between the two. And when you embed a [0] > array > into another structure, it is intentional that _FORTIFY_SOURCE=2 (i.e. the > more > restrictive mode, beyond the standards) only allows to fill the fields and > not > cross to outside of that. > > -- > You are receiving this mail because: > You reported the bug. >