From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25441 invoked by alias); 23 Jun 2015 20:50:32 -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 25387 invoked by uid 48); 23 Jun 2015 20:50:28 -0000 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/66626] [i386] gcc.dg/torture/stackalign/non-local-goto-5.c segfaults w/ -mregparm=3 Date: Tue, 23 Jun 2015 20:50:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-06/txt/msg02347.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D66626 Uro=C5=A1 Bizjak changed: What |Removed |Added ---------------------------------------------------------------------------- CC|uros at gcc dot gnu.org |ubizjak at gmail do= t com --- Comment #2 from Uro=C5=A1 Bizjak --- A better testcase: --cut here-- extern void abort (void); int s (int i, int j, int k, int l) { __label__ l1; int f (int i, int j, int k, int l) { if (i + j + k + l =3D=3D 10) goto l1; return 0; } return f (i, j, k, l); l1:; return 1; } int main () { if (s (1, 2, 3, 4) !=3D 1) abort (); return 0; } --cut here-- Nested function "f" compiles with "-O2 -m32 -mregparm=3D3" to: f.1491: pushl %esi pushl %ebp addl %eax, %edx addl %edx, %ecx movl %esp, %ebp addl 12(%ebp), %ecx cmpl $10, %ecx je .L6 leave xorl %eax, %eax addl $4, %esp ret .L6: movl 4(%ebp), %edx movl $.L3, %eax movl (%edx), %ebp movl 4(%ebp), %edx <----!! movl 4(%edx), %esp jmp *%eax The marked insn leads to corrupted %esp, since it is restored from invalid location. When the insn is removed, the testcase runs without problems. >>From gcc-bugs-return-490016-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jun 23 21:13:36 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 5247 invoked by alias); 23 Jun 2015 21:13:35 -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 5202 invoked by uid 48); 23 Jun 2015 21:13:32 -0000 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/66626] [i386] gcc.dg/torture/stackalign/non-local-goto-5.c segfaults w/ -mregparm=3 Date: Tue, 23 Jun 2015 21:13:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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: Message-ID: In-Reply-To: References: 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: 2015-06/txt/msg02348.txt.bz2 Content-length: 252 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D66626 --- Comment #3 from Uro=C5=A1 Bizjak --- (In reply to Uro=C5=A1 Bizjak from comment #2) > A better testcase: Nope. This one works OK. The testcase from Comment #1 fails. >>From gcc-bugs-return-490017-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jun 23 21:21:56 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 13161 invoked by alias); 23 Jun 2015 21:21: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 13063 invoked by uid 48); 23 Jun 2015 21:21:52 -0000 From: "kkojima at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/66563] [4.9 Regression] ICE (segmentation fault) on sh4-linux-gnu Date: Tue, 23 Jun 2015 21:21:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: kkojima at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: 2015-06/txt/msg02349.txt.bz2 Content-length: 845 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66563 --- Comment #32 from Kazumoto Kojima --- (In reply to Oleg Endo from comment #31) Yes, your insn_and_split is quite same with the one I've tried first and it resolved this case too. The volatile will work of cause. The CSE in problem was done by IRA, not by CSE pass, though. Then I'm curious about how other targets handle the issue and found that some targets like arm differentiate GOT sequences for the different constant pool with the similar counter. I like it because it seems that differentiated RTLs fix the root cause of the issue, even though such CSE won't be done after reload. I've just done the usual tests for trunk and will apply it on trunk. Unfortunately 4.9 is now frozen for 4.9.3 release. I'll backport the patch to 4.9 when it reopens.