register struct S *b asm ("rbp"); register unsigned int c asm ("rbx"); register unsigned int f asm ("r14"); extern int a; void foo (int); struct S { unsigned int h[8]; }; void bar (void) { unsigned int j, k, l, m; j = (f & 0xffff) | ((b->h[2] & 0xffff) << 16); k = c & 0xffff; if (k == 0) { foo (0); } l = (j / k) & 0xffff; m = (j % k) & 0xffff; f = (f & 0xffff0000) | l; b->h[2] = (b->h[2] & 0xffff0000) | m; } on x86_64 causes ICE in reg_bitfield_target_p. try_combine is called on i3: (insn 33 32 35 2 (set (strict_low_part (subreg:HI (reg/v:SI 43 r14 [ f ]) 0)) (subreg:HI (reg:SI 68) 0)) 56 {*movstricthi_1} (insn_list:REG_DEP_TRUE 30 (nil)) (expr_list:REG_DEAD (reg:SI 68) (nil))) and i2: (insn 30 29 31 2 (parallel [ (set (reg:SI 68) (and:SI (reg:SI 66) (const_int 65535 [0xffff]))) (clobber (reg:CC 17 flags)) ]) 289 {*andsi_1} (insn_list:REG_DEP_TRUE 29 (nil)) (expr_list:REG_DEAD (reg:SI 66) (expr_list:REG_UNUSED (reg:CC 17 flags) (nil)))) but somewhere changes the pattern of i3 into invalid rtl: (set (strict_low_part (reg:HI 43 r14 [ f ])) (subreg:HI (reg:SI 66) 0)) (note missing subreg in the strict_low_part operand). Works just fine in 3.3, reproduced in 3.4.2 and on HEAD.
Confirmed on the mainline.
Postponed until GCC 3.4.4.
http://gcc.gnu.org/ml/gcc-patches/2004-11/msg01574.html
Subject: Bug 17825 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-rhl-branch Changes by: jakub@gcc.gnu.org 2004-11-24 22:28:46 Modified files: gcc : ChangeLog combine.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.c-torture/compile: 20041119-1.c Log message: PR rtl-optimization/17825 * combine.c (subst): Ignore STRICT_LOW_PART no matter if REG_P (new) or not. * gcc.c-torture/compile/20041119-1.c: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=2.2326.2.399.2.58&r2=2.2326.2.399.2.59 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/combine.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.400.4.6.2.3&r2=1.400.4.6.2.4 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.3389.2.170.2.29&r2=1.3389.2.170.2.30 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/20041119-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=NONE&r2=1.1.2.1
Subject: Bug 17825 CVSROOT: /cvs/gcc Module name: gcc Changes by: jakub@gcc.gnu.org 2004-11-27 09:39:01 Modified files: gcc : ChangeLog combine.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.c-torture/compile: 20041119-1.c Log message: PR rtl-optimization/17825 * combine.c (subst): Ignore STRICT_LOW_PART no matter if REG_P (new) or not. * gcc.c-torture/compile/20041119-1.c: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.6580&r2=2.6581 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/combine.c.diff?cvsroot=gcc&r1=1.461&r2=1.462 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4656&r2=1.4657 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/20041119-1.c.diff?cvsroot=gcc&r1=1.1&r2=1.2
Subject: Bug 17825 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: sayle@gcc.gnu.org 2005-03-17 01:36:15 Modified files: gcc : ChangeLog combine.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.c-torture/compile: 20041119-1.c Log message: PR rtl-optimization/17825 Backport from mainline 2004-11-27 Jakub Jelinek <jakub@redhat.com> * combine.c (subst): Ignore STRICT_LOW_PART no matter if REG_P (new) or not. PR rtl-optimization/17825 Backport from mainline 2004-11-27 Jakub Jelinek <jakub@redhat.com> * gcc.c-torture/compile/20041119-1.c: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.818&r2=2.2326.2.819 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/combine.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.400.4.13&r2=1.400.4.14 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.370&r2=1.3389.2.371 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/20041119-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.2.28.1
Fixed.