From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27850 invoked by alias); 9 Apr 2013 13:57:12 -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 27828 invoked by uid 48); 9 Apr 2013 13:57:09 -0000 From: "devspam at moreofthesa dot me.uk" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/56881] Miscompilation (optimisation failure?) causing NULL dereference and segfault at runtime Date: Tue, 09 Apr 2013 13:57:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: devspam at moreofthesa dot me.uk X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Target Known to work Host Version Known to fail Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2013-04/txt/msg00750.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D56881 devspam at moreofthesa dot me.uk changed: What |Removed |Added ---------------------------------------------------------------------------- Target| |amd64 Known to work| |4.7.2 Host| |amd64 Version|unknown |4.8.0 Known to fail| |4.8.0 --- Comment #2 from devspam at moreofthesa dot me.uk 2013-04-09 13:57:08 UT= C --- (In reply to comment #1) > IMHO, if domalloc() does return NULL for some cases, > having NULL-checking statement before/inside memmove is required. It doesn't return NULL =E2=80=93 if malloc() returns null, domalloc() will = report that and exit. But even if it did, that doesn't explain the problem occurring on= ly at some optimisation levels. Anyway. I've done some more testing. The problem is (or is related to) -fcaller-saves: -O2 and -Os both trigger the problem, but add -fno-caller-s= aves and all is well. >>From gcc-bugs-return-419606-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Apr 09 14:22:32 2013 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 19799 invoked by alias); 9 Apr 2013 14:22:31 -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 19744 invoked by uid 48); 9 Apr 2013 14:22:28 -0000 From: "ysrumyan at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/56885] [4.8/4.9 Regression] ICE: in assign_by_spills, at lra-assigns.c:1268 with -O -fschedule-insns -fselective-scheduling Date: Tue, 09 Apr 2013 14:22:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: ysrumyan at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.1 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-04/txt/msg00751.txt.bz2 Content-length: 273 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56885 --- Comment #6 from Yuri Rumyantsev 2013-04-09 14:22:28 UTC --- Forgot to mention that __builtin_memset and function argument are not interchangeable since both use the same register di.