From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27012 invoked by alias); 16 Jul 2013 22:27: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 Received: (qmail 24830 invoked by uid 48); 16 Jul 2013 22:25:15 -0000 From: "etienne_lorrain at yahoo dot fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/57915] New: ICE in set_address_disp, at rtlanal.c:5537 Date: Tue, 16 Jul 2013 22:27:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: etienne_lorrain at yahoo dot fr 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 bug_severity priority component assigned_to reporter 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: 2013-07/txt/msg00809.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D57915 Bug ID: 57915 Summary: ICE in set_address_disp, at rtlanal.c:5537 Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: etienne_lorrain at yahoo dot fr On latest Fedora, with: gcc version 4.8.1 20130603 (Red Hat 4.8.1-1) (GCC) I get: $ /usr/bin/gcc -m32 -Os bug.c bug.c: In function =E2=80=98menu=E2=80=99: bug.c:59:1: internal compiler error: in set_address_disp, at rtlanal.c:55= 37 } ^ Please submit a full bug report, possibly related to asm(... "X" (*str)) , I use "X" mostly because I had problems using "m" when the pointer points to local variable on the stack. The problem do not exists with previous compiler versions, not a new code. The simplified source code I finished to get after few hours is: $ cat bug.c extern inline const char * _strnchr (const char *str, char c, unsigned size) { asm ("cld ; repne scasb %%es:(%%edi),%%al" : "+c" (size), "+D" (str): "a" (c), "X" (*str):"cc"); return str - 1; } extern inline unsigned strlen (const char *str) { return _strnchr (str, '\0', (~0)) - str; } extern inline void _strncpy (char *dst, const char *src, unsigned nb) { unsigned len =3D strlen (src); if (len > nb) len =3D nb; __builtin_memcpy (dst, src, len); dst[len] =3D '\0'; } extern inline char * strcpy (char *dst, const char *src) { _strncpy (dst, src, (~0)); return dst; } typedef struct { char go_msg[8]; char scanpath[16]; } gujin_param_t; extern gujin_param_t copy_gujin_param; enum { kernel_bottom_menu, setup_bottom_menu } type; unsigned short getkey(void); unsigned timeout; unsigned menu (void) { char local_scanpath[sizeof (copy_gujin_param.scanpath)]; strcpy (local_scanpath, copy_gujin_param.scanpath); for (;;) { unsigned short key =3D getkey(); if ((type =3D=3D kernel_bottom_menu) ? (key =3D=3D (0x1312)) : key =3D= =3D (0x3900 | ' ')) { strcpy (local_scanpath, copy_gujin_param.scanpath); } } } Regards, Etienne. >>From gcc-bugs-return-426303-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jul 17 01:57:56 2013 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 10970 invoked by alias); 17 Jul 2013 01:57:56 -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 8339 invoked by uid 48); 17 Jul 2013 01:55:53 -0000 From: "brooks at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/56888] memcpy implementation optimized as a call to memcpy Date: Wed, 17 Jul 2013 01:57:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 4.8.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: brooks at gcc dot gnu.org X-Bugzilla-Status: NEW 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: cc 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: 2013-07/txt/msg00810.txt.bz2 Content-length: 979 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56888 Brooks Moses changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |brooks at gcc dot gnu.org --- Comment #10 from Brooks Moses --- FWIW, this issue also affected GLIBC. Pointer to discussion, along with fixes, here: http://sourceware.org/ml/libc-alpha/2013-07/msg00306.html It seems to me -- based on my own experience, as well as Max's -- that the -ftree-distribute-patterns documentation could be notably improved. In my case, I read it clearly and understood it to mean that it was only responsible for the loop-distribution portion of the rearrangement in the code examples, and that the replacement of a loop by a memcpy call was some other optimization pass. Other than the documentation issues, this seems like a non-bug.