From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1111 invoked by alias); 23 Jul 2014 10:36:40 -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 1079 invoked by uid 48); 23 Jul 2014 10:36:36 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/61861] Incorrect column number for -Wdiscarded-qualifiers Date: Wed, 23 Jul 2014 10:36:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.10.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-07/txt/msg01544.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D61861 Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu.org --- Comment #4 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- Is this something new? Dodji made some changes recently to the location of built-in tokens. >>From gcc-bugs-return-456954-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jul 23 10:40:09 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 2820 invoked by alias); 23 Jul 2014 10:40:09 -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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 2786 invoked by uid 48); 23 Jul 2014 10:40:05 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/61886] New: [4.8/4.9/4.10 Regression] LTO breaks fread with _FORTIFY_SOURCE=2 Date: Wed, 23 Jul 2014 10:40:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: diagnostic, lto, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org 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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter cc attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-07/txt/msg01545.txt.bz2 Content-length: 5209 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D61886 Bug ID: 61886 Summary: [4.8/4.9/4.10 Regression] LTO breaks fread with _FORTIFY_SOURCE=3D2 Product: gcc Version: 4.9.1 Status: UNCONFIRMED Keywords: diagnostic, lto, wrong-code Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org CC: hubicka at gcc dot gnu.org Created attachment 33176 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D33176&action=3Dedit testcase extracted from cairo test suite With the attached testcase extracted from the Cairo testsuite (which they b= uild with -flto ...) you get > gcc-4.9 create-for-stream.i -O2 -flto -r -nostdlib In function =E2=80=98__fread_alias=E2=80=99, inlined from =E2=80=98test_surface=E2=80=99 at create-for-stream.c:218:= 9: /usr/include/bits/stdio2.h:290:2: warning: call to =E2=80=98__fread_chk_war= n=E2=80=99 declared with attribute warning: fread called with bigger size * nmemb than length of destination buffer return __fread_chk (__ptr, __bos0 (__ptr), __size, __n, __stream); ^ where we mangle compile-time : _55 =3D wc.index; _77 =3D __builtin_constant_p (_55); if (_77 =3D=3D 0) goto ; else goto ; : _78 =3D _55 | 1; if (_78 > 4294967295) goto ; else goto ; : _79 =3D __fread_chk (&file_contents, 4096, 1, _55, fp_48); goto ; : if (_55 > 4096) goto ; else goto ; : _81 =3D *__fread_chk (&file_contents, 4096, 1, _55, fp_48); goto ; : _82 =3D *fread (&file_contents, 1, _55, fp_48); : # _83 =3D PHI <_79(15), _81(17), _82(18)> into the bogus : _49 =3D wc.index; _64 =3D __builtin_constant_p (_49); if (_64 =3D=3D 0) goto ; else goto ; : _65 =3D _49 | 1; if (_65 > 4294967295) goto ; else goto ; : _66 =3D __fread_chk_warn (&file_contents, 4096, 1, _49, fp_43); goto ; : if (_49 > 4096) goto ; else goto ; : _67 =3D __fread_chk_warn (&file_contents, 4096, 1, _49, fp_43); goto ; : _68 =3D __fread_alias (&file_contents, 1, _49, fp_43); : # _69 =3D PHI <_66(15), _67(17), _68(18)> somehow messing up the aliases game glibc plays: extern size_t __fread_chk (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __wur; extern size_t __REDIRECT (__fread_alias, (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream), fread) __wur; extern size_t __REDIRECT (__fread_chk_warn, (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream), __fread_chk) __wur __warnattr ("fread called with bigger size * nmemb than length " "of destination buffer"); __fortify_function __wur size_t fread (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) { if (__bos0 (__ptr) !=3D (size_t) -1) { if (!__builtin_constant_p (__size) || !__builtin_constant_p (__n) || (__size | __n) >=3D (((size_t) 1) << (8 * sizeof (size_t) / 2)= )) return __fread_chk (__ptr, __bos0 (__ptr), __size, __n, __stream); if (__size * __n > __bos0 (__ptr)) return __fread_chk_warn (__ptr, __bos0 (__ptr), __size, __n, __stre= am); } return __fread_alias (__ptr, __size, __n, __stream); } Merging nodes for *__fread_chk. Candidates: *__fread_chk/98 (__fread_chk_warn) @0x7ffff6dc2b80 Type: function Visibility: undef external public next sharing asm name: 97 References: Referring: Read from file: /tmp/ccu88pge.o First run: 0 Function flags: Called by: test_surface/78 Calls: __fread_chk/97 (__fread_chk) @0x7ffff6dc2cf0 Type: function Visibility: external public previous sharing asm name: 98 References: Referring: Read from file: /tmp/ccu88pge.o First run: 0 Function flags: Called by: test_surface/78 (0.00 per call) After resolution: *__fread_chk/98 (__fread_chk_warn) @0x7ffff6dc2b80 Type: function Visibility: undef external public next sharing asm name: 97 References: Referring: Read from file: /tmp/ccu88pge.o First run: 0 Function flags: Called by: test_surface/78 Calls: __fread_chk/97 (__fread_chk) @0x7ffff6dc2cf0 Type: function Visibility: external public previous sharing asm name: 98 References: Referring: Read from file: /tmp/ccu88pge.o First run: 0 Function flags: Called by: test_surface/78 (0.00 per call) Calls: but we obviously shouldn't merge these ... (I believe we shouldn't drop any aliases at LTO symbol merging time, which means _not_ merging based on asm-name?) >>From gcc-bugs-return-456955-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jul 23 10:40:18 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 3465 invoked by alias); 23 Jul 2014 10:40:17 -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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 3337 invoked by uid 48); 23 Jul 2014 10:40:13 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/61886] [4.8/4.9/4.10 Regression] LTO breaks fread with _FORTIFY_SOURCE=2 Date: Wed, 23 Jul 2014 10:40:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: diagnostic, lto, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: target_milestone 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: 2014-07/txt/msg01546.txt.bz2 Content-length: 294 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61886 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |4.8.4