From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19996 invoked by alias); 23 Apr 2007 11:22:12 -0000 Received: (qmail 19945 invoked by uid 48); 23 Apr 2007 11:22:01 -0000 Date: Mon, 23 Apr 2007 11:22:00 -0000 Message-ID: <20070423112201.19944.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/31641] [4.1/4.2/4.3 Regression] ICE in s390_expand_setmem, at config/s390/s390.c:3618 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "krebbel at gcc dot gnu dot org" 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 X-SW-Source: 2007-04/txt/msg01667.txt.bz2 ------- Comment #2 from krebbel at gcc dot gnu dot org 2007-04-23 12:21 ------- In your example the memset function is called with -1 as length argument. When GCC tries to expand this as a builtin function an assertion in the s390 back end function s390_expand_setmem is triggered. Although an ICE is the wrong thing to respond I would consider it a code bug as well. I've proposed a patch to issue a proper error message and call the library function in that situation. The library function probably would write one byte below the target address causing a segfault for a -1 length which is most likely not what the programmer intended but thats what would happen in the -O0 as well. -- krebbel at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2007-04-23 12:21:59 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31641