public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/57915] New: ICE in set_address_disp, at rtlanal.c:5537
@ 2013-07-16 22:27 etienne_lorrain at yahoo dot fr
  2013-09-12 14:48 ` [Bug rtl-optimization/57915] [4.8/4.9 Regression] " mpolacek at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: etienne_lorrain at yahoo dot fr @ 2013-07-16 22:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57915

            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 ‘menu’:
  bug.c:59:1: internal compiler error: in set_address_disp, at rtlanal.c:5537
   }
   ^
  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 = strlen (src);
  if (len > nb)
    len = nb;

  __builtin_memcpy (dst, src, len);
  dst[len] = '\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 = getkey();
    if ((type == kernel_bottom_menu) ? (key == (0x1312)) : key == (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: <gcc-bugs-return-426303-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
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: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
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" <gcc-bugzilla@gcc.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: <bug-56888-4-TOHFjIRoyt@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-56888-4@http.gcc.gnu.org/bugzilla/>
References: <bug-56888-4@http.gcc.gnu.org/bugzilla/>
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?idV888

Brooks Moses <brooks at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |brooks at gcc dot gnu.org

--- Comment #10 from Brooks Moses <brooks at gcc dot gnu.org> ---
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.


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-06-23  8:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-16 22:27 [Bug c/57915] New: ICE in set_address_disp, at rtlanal.c:5537 etienne_lorrain at yahoo dot fr
2013-09-12 14:48 ` [Bug rtl-optimization/57915] [4.8/4.9 Regression] " mpolacek at gcc dot gnu.org
2013-09-12 14:58 ` jakub at gcc dot gnu.org
2013-09-20 16:29 ` vmakarov at redhat dot com
2013-11-19  9:47 ` rguenth at gcc dot gnu.org
2013-11-22 10:53 ` rguenth at gcc dot gnu.org
2014-01-23 13:55 ` abel at gcc dot gnu.org
2014-01-31 15:24 ` jakub at gcc dot gnu.org
2014-01-31 15:25 ` jakub at gcc dot gnu.org
2014-02-04 12:15 ` jakub at gcc dot gnu.org
2014-02-04 12:59 ` [Bug rtl-optimization/57915] [4.8 " jakub at gcc dot gnu.org
2014-05-22  9:03 ` rguenth at gcc dot gnu.org
2014-12-19 13:32 ` jakub at gcc dot gnu.org
2015-06-23  8:41 ` rguenth at gcc dot gnu.org

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).