public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/63989] New: tree-ssa-strlen.c doesn't handle constant pointer plus and array refs if constant offset is smaller than known constant string length
@ 2014-11-20  9:31 jakub at gcc dot gnu.org
  2014-11-20  9:44 ` [Bug tree-optimization/63989] " jakub at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-11-20  9:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63989

            Bug ID: 63989
           Summary: tree-ssa-strlen.c doesn't handle constant pointer plus
                    and array refs if constant offset is smaller than
                    known constant string length
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
                CC: dimhen at gmail dot com, jakub at gcc dot gnu.org,
                    nheghathivhistha at gmail dot com, rguenth at gcc dot gnu.org,
                    trippels at gcc dot gnu.org
        Depends on: 61773
            Blocks: 63787

+++ This bug was initially created as a clone of Bug #61773 +++

char *foo (void)
{
  char *p = __builtin_malloc (64);
  char *q = __builtin_malloc (64);
  __builtin_strcat (q, "abcde");
  __builtin_strcat (p, "ab");
  p[1] = q[3];
  __builtin_strcat (p, q);
  return q;
}

gives

> ../../obj2/gcc/cc1 -quiet -O2 t.c
t.c: In function ‘foo’:
t.c:1:7: internal compiler error: in get_string_length, at
tree-ssa-strlen.c:417
 char *foo (void)
       ^
0x876c3d2 get_string_length
        /space/rguenther/tramp3d/trunk/gcc/tree-ssa-strlen.c:417
0x8772b02 get_string_length
        /space/rguenther/tramp3d/trunk/gcc/tree.h:2731
0x8772b02 handle_builtin_strlen
        /space/rguenther/tramp3d/trunk/gcc/tree-ssa-strlen.c:899

(gdb) up
#1  0x0876c3d3 in get_string_length (si=0x3c)
    at /space/rguenther/tramp3d/trunk/gcc/tree-ssa-strlen.c:417
417           gcc_assert (builtin_decl_implicit_p (BUILT_IN_STPCPY));


while trying to write a testcase that shows that handle_char_store should
handle a character copy from a known non-zero value.  Well, while really
trying to incrementally teach handle_char_store to handle arbitrary
stores.
>From gcc-bugs-return-467687-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Nov 20 09:44:40 2014
Return-Path: <gcc-bugs-return-467687-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 14002 invoked by alias); 20 Nov 2014 09:44:39 -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 13906 invoked by uid 48); 20 Nov 2014 09:44:34 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/63989] tree-ssa-strlen.c doesn't handle constant pointer plus and array refs if constant offset is smaller than known constant string length
Date: Thu, 20 Nov 2014 09:44: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: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub 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: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: target_milestone
Message-ID: <bug-63989-4-M2yNLIBOjN@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63989-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63989-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: 2014-11/txt/msg02159.txt.bz2
Content-length: 289

https://gcc.gnu.org/bugzilla/show_bug.cgi?idc989

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |5.0


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

end of thread, other threads:[~2022-01-09  0:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-20  9:31 [Bug tree-optimization/63989] New: tree-ssa-strlen.c doesn't handle constant pointer plus and array refs if constant offset is smaller than known constant string length jakub at gcc dot gnu.org
2014-11-20  9:44 ` [Bug tree-optimization/63989] " jakub at gcc dot gnu.org
2014-11-20 11:20 ` rguenther at suse dot de
2014-11-21  9:38 ` jakub at gcc dot gnu.org
2014-12-08 17:25 ` jakub at gcc dot gnu.org
2015-01-08 21:31 ` jakub at gcc dot gnu.org
2015-04-22 12:01 ` jakub at gcc dot gnu.org
2015-07-16  9:18 ` rguenth at gcc dot gnu.org
2022-01-09  0:45 ` pinskia 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).