public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/53433] [4.8 Regression] ICE in int_mode_for_mode, at stor-layout.c:424 during lto-bootstrap Date: Wed, 04 Jul 2012 10:11:00 -0000 [thread overview] Message-ID: <bug-53433-4-s0K2yZBrcu@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-53433-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53433 --- Comment #21 from Uros Bizjak <ubizjak at gmail dot com> 2012-07-04 10:10:13 UTC --- It looks that expand_builtin_strncmp gets miscompiled. Try to compile the testcase from Comment #5 with -O2 on x86_64-pc-linux-gnu. Put breakpoint in gen_cmpstrnsi. When debugging "normal", non-LTO, non-profiled build, we get: Breakpoint 1, gen_cmpstrnsi (operand0=0x7ffff1ace8a0, operand1=0x7ffff1acb8b8, operand2=0x7ffff1acb918, operand3=0x7ffff19a84f0, operand4=0x7ffff19a8480) at ../../gcc-svn/trunk/gcc/config/i386/i386.md:15989 15989 (set (match_operand:P 0 "register_operand" "=D") (gdb) bt #0 gen_cmpstrnsi (operand0=0x7ffff1ace8a0, operand1=0x7ffff1acb8b8, operand2=0x7ffff1acb918, operand3=0x7ffff19a84f0, operand4=0x7ffff19a8480) at ../../gcc-svn/trunk/gcc/config/i386/i386.md:15989 #1 0x00000000005bb0c0 in expand_builtin_strncmp (exp=0x7ffff1acdd20, target=0x7ffff1ace8a0, mode=<optimized out>) at ../../gcc-svn/trunk/gcc/builtins.c:4000 (gdb) up #1 0x00000000005bb0c0 in expand_builtin_strncmp (exp=0x7ffff1acdd20, target=0x7ffff1ace8a0, mode=<optimized out>) at ../../gcc-svn/trunk/gcc/builtins.c:4000 4000 GEN_INT (MIN (arg1_align, arg2_align))); (gdb) li 3995 3996 arg1_rtx = get_memory_rtx (arg1, len); 3997 arg2_rtx = get_memory_rtx (arg2, len); 3998 arg3_rtx = expand_normal (len); 3999 insn = gen_cmpstrnsi (result, arg1_rtx, arg2_rtx, arg3_rtx, 4000 GEN_INT (MIN (arg1_align, arg2_align))); 4001 if (insn) 4002 { 4003 emit_insn (insn); 4004 (gdb) p target $11 = (rtx_def *) 0x7ffff1ace8a0 (gdb) p result $12 = (rtx_def *) 0x7ffff1ace8a0 (gdb) debugging profiledbootstrap (--with-build-config=bootstrap-lto): Breakpoint 3, gen_cmpstrnsi (operand0=0x7ffff1ace9e0, operand1=0x7ffff1acb8b8, operand2=0x7ffff1acb918, operand3=0x7ffff19a84f0, operand4=0x7ffff19a8480) at ../../gcc-svn/trunk/gcc/config/i386/i386.md:15989 15989 (set (match_operand:P 0 "register_operand" "=D") (gdb) bt #0 gen_cmpstrnsi (operand0=0x7ffff1ace9e0, operand1=0x7ffff1acb8b8, operand2=0x7ffff1acb918, operand3=0x7ffff19a84f0, operand4=0x7ffff19a8480) at ../../gcc-svn/trunk/gcc/config/i386/i386.md:15989 #1 0x0000000000b3310f in _ZL22expand_builtin_strncmpP9tree_nodeP7rtx_def12machine_mode.isra.13 ( target=0x7ffff1ace8a0, exp=0x7ffff1acdd20) at ../../gcc-svn/trunk/gcc/builtins.c:4000 (gdb) p target $12 = (struct rtx_def *) 0x7ffff1ace8a0 (gdb) p result $13 = '\000' <repeats 113 times> (gdb) The trick is that a couple of lines above, we have: /* Make a place to write the result of the instruction. */ result = target; if (! (result != 0 && REG_P (result) && GET_MODE (result) == insn_mode && REGNO (result) >= FIRST_PSEUDO_REGISTER)) result = gen_reg_rtx (insn_mode); Probably "result" doesn't get propagated correctly to gen_cmpstrnsi, we have: (gdb) p *target $15 = {code = REG, mode = SImode, jump = 0, call = 0, unchanging = 0, volatil = 0, in_struct = 0, (gdb) down #0 gen_cmpstrnsi (operand0=0x7ffff1ace9e0, operand1=0x7ffff1acb8b8, operand2=0x7ffff1acb918, operand3=0x7ffff19a84f0, operand4=0x7ffff19a8480) at ../../gcc-svn/trunk/gcc/config/i386/i386.md:15989 15989 (set (match_operand:P 0 "register_operand" "=D") (gdb) p *operand0 $14 = {code = REG, mode = VOIDmode, jump = 0, call = 0, unchanging = 0, volatil = 0, in_struct = 0, Everything goes downhill there. (sorry for not using debug_rtx here, calling it gdb says "Cannot resolve function debug_rtx to any overloaded instance".)
next prev parent reply other threads:[~2012-07-04 10:11 UTC|newest] Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-05-21 11:00 [Bug c/53433] New: [4.8 Regression] ICE in int_mode_for_mode, at stor-layout.c:424 during bootstrap markus at trippelsdorf dot de 2012-05-21 12:39 ` [Bug c/53433] " markus at trippelsdorf dot de 2012-05-21 12:41 ` [Bug middle-end/53433] [4.8 Regression] ICE in int_mode_for_mode, at stor-layout.c:424 during lto-bootstrap markus at trippelsdorf dot de 2012-05-21 12:41 ` rguenth at gcc dot gnu.org 2012-05-21 12:47 ` rguenth at gcc dot gnu.org 2012-05-21 15:25 ` markus at trippelsdorf dot de 2012-05-22 13:07 ` vincenzo.innocente at cern dot ch 2012-05-22 13:43 ` vincenzo.innocente at cern dot ch 2012-05-23 9:03 ` vincenzo.innocente at cern dot ch 2012-05-24 22:31 ` ebotcazou at gcc dot gnu.org 2012-06-01 9:18 ` vincenzo.innocente at cern dot ch 2012-06-01 11:45 ` markus at trippelsdorf dot de 2012-06-01 11:50 ` rguenth at gcc dot gnu.org 2012-06-01 11:54 ` markus at trippelsdorf dot de 2012-06-01 12:01 ` vincenzo.innocente at cern dot ch 2012-06-01 12:31 ` markus at trippelsdorf dot de 2012-06-01 13:28 ` vincenzo.innocente at cern dot ch 2012-06-11 11:09 ` rguenth at gcc dot gnu.org 2012-06-13 14:36 ` markus at trippelsdorf dot de 2012-07-03 18:22 ` ubizjak at gmail dot com 2012-07-03 18:46 ` hjl.tools at gmail dot com 2012-07-04 10:11 ` ubizjak at gmail dot com [this message] 2012-07-04 10:38 ` ubizjak at gmail dot com 2012-07-04 10:59 ` ubizjak at gmail dot com 2012-07-04 11:17 ` rguenth at gcc dot gnu.org 2012-07-04 11:28 ` rguenth at gcc dot gnu.org 2012-07-04 11:31 ` ubizjak at gmail dot com 2012-07-04 11:54 ` markus at trippelsdorf dot de 2012-07-04 12:15 ` rguenth at gcc dot gnu.org 2012-07-04 12:33 ` ubizjak at gmail dot com 2012-07-04 13:48 ` rguenth at gcc dot gnu.org 2012-07-04 13:54 ` rguenth at gcc dot gnu.org 2012-07-04 13:57 ` rguenth at gcc dot gnu.org 2012-07-04 13:57 ` rguenth at gcc dot gnu.org 2012-07-04 13:58 ` rguenth at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-53433-4-s0K2yZBrcu@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).