see https://bugs.gentoo.org/show_bug.cgi?id=426572
Please provide a test case, not a link.
Created attachment 27788 [details] source code /usr/bin/gcc: file format elf32-x86-64 gcc -m64 -O2 -c ./host_ppc_isel.i -o test.o In file included from priv/host_ppc_isel.c:37:0: ../VEX/pub/libvex_basictypes.h: In function 'Ptr_to_ULong': ../VEX/pub/libvex_basictypes.h:195:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] ../VEX/pub/libvex_basictypes.h: In function 'ULong_to_Ptr': ../VEX/pub/libvex_basictypes.h:200:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] priv/host_ppc_isel.c: In function 'iselInt64Expr': priv/host_ppc_isel.c:2834:1: internal compiler error: in memory_address_length, at config/i386/i386.c:23341
The testcase works for me with: GNU C (GCC) version 4.7.2 20120713 (prerelease) [gcc-4_7-branch revision 189471] (x86_64-unknown-linux-gnu) and 4.8.0.
Are you using X32 GCC binary?
(In reply to comment #4) > Are you using X32 GCC binary? So -mx32 makes it fail or rather GCC defaulting to x32 makes it fail?
if gcc is compiled as X32 /usr/bin/gcc: file format elf32-x86-64 and command gcc -m64 -O2 -c ./host_ppc_isel.i -o test.o
It is fixed on trunk. It is on 4.7 branch as of revision 189343.
This address: (gdb) call debug_rtx (addr) (and:DI (symbol_ref:DI ("h_DPBtoBCD") [flags 0x41] <function_decl 0x7ffff1b8b400 h_DPBtoBCD>) (const_int 4294967295 [0xffffffff])) (gdb) triggers ICE.
Can you test following patch that prevents non-register AND address operands: --cut here-- Index: i386.c =================================================================== --- i386.c (revision 189483) +++ i386.c (working copy) @@ -11591,7 +11591,8 @@ ix86_decompose_address (rtx addr, struct ix86_addr if (GET_CODE (addr) == SUBREG && GET_MODE (SUBREG_REG (addr)) == SImode) addr = SUBREG_REG (addr); - else if (GET_MODE (addr) == DImode) + else if (REG_P (addr) + && GET_MODE (addr) == DImode) addr = gen_rtx_SUBREG (SImode, addr, 0); else if (GET_MODE (addr) != VOIDmode) return 0; --cut here--
This only happens on hjl/x32/gcc-4_7-branch branch.
(In reply to comment #9) > Can you test following patch that prevents non-register AND address operands: > > --cut here-- > Index: i386.c > =================================================================== > --- i386.c (revision 189483) > +++ i386.c (working copy) > @@ -11591,7 +11591,8 @@ ix86_decompose_address (rtx addr, struct ix86_addr > if (GET_CODE (addr) == SUBREG > && GET_MODE (SUBREG_REG (addr)) == SImode) > addr = SUBREG_REG (addr); > - else if (GET_MODE (addr) == DImode) > + else if (REG_P (addr) > + && GET_MODE (addr) == DImode) > addr = gen_rtx_SUBREG (SImode, addr, 0); > else if (GET_MODE (addr) != VOIDmode) > return 0; > --cut here-- It doesn't work. I will find which checkin on trunk fixed this.
It is fixed by revision 186839: http://gcc.gnu.org/ml/gcc-cvs/2012-04/msg00791.html on trunk.
Author: uros Date: Sun Jul 15 08:13:47 2012 New Revision: 189491 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189491 Log: PR target/53961 Backport from mainline 2012-04-25 Jakub Jelinek <jakub@redhat.com> PR target/53110 * config/i386/i386.md (and<mode>3): For andq $0xffffffff, reg instead expand it as zero extension. Modified: branches/gcc-4_7-branch/gcc/ChangeLog branches/gcc-4_7-branch/gcc/config/i386/i386.md
Fixed.
I synced hjl/x32/gcc-4_7-branch with gcc-4_7-branch.
.
Author: uros Date: Sun Jul 22 15:44:51 2012 New Revision: 189756 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189756 Log: PR target/53961 * config/i386/i386.md (*lea): New insn pattern. (*lea_1): Remove. (*lea<mode>_2): Ditto. (*lea_{3,4,5,6}_zext): Ditto. * config/i386/constraints.md (j): Remove address constraint. * config/i386/i386.c (ix86_decompose_address): Allow SImode subreg of an address. (ix86_print_operand_address): Handle SImode subreg of an address. (ix86_avoid_lea_for_add): Reject zero-extended addresses for now. Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/constraints.md trunk/gcc/config/i386/i386.c trunk/gcc/config/i386/i386.md trunk/gcc/config/i386/predicates.md
Author: uros Date: Mon Jul 23 16:04:23 2012 New Revision: 189787 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189787 Log: PR target/53961 * config/i386/i386.md (*lea): Add asserts to detect invalid addresses. * config/i386/i386.c (ix86_print_operand_address): Ditto. (ix86_decompose_address): Allow (zero_extend:DI (subreg:SI (...))) addresses. Prevent zero extensions of CONST_INT operands. Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/i386.c trunk/gcc/config/i386/i386.md
Author: uros Date: Tue Jul 24 11:37:20 2012 New Revision: 189806 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189806 Log: PR target/53961 * config/i386/i386.c (ix86_legitimate_address_p): Move check for negative constant address for TARET_X32 ... (ix86_decompose_address): ... here. Reject constant addresses that don't satisfy x86_64_immediate_operand predicate. Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/i386.c trunk/gcc/config/i386/i386.md
These patches, and the patch for PR52530, should be backported to 4.7.2
Author: uros Date: Thu Aug 2 16:24:25 2012 New Revision: 190089 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190089 Log: Backport from mainline 2012-07-24 Uros Bizjak <ubizjak@gmail.com> PR target/53961 * config/i386/i386.c (ix86_legitimate_address_p): Move check for negative constant address for TARGET_X32 ... (ix86_decompose_address): ... here. Reject constant addresses that don't satisfy x86_64_immediate_operand predicate. 2012-07-23 Uros Bizjak <ubizjak@gmail.com> PR target/53961 * config/i386/i386.md (*lea): Add asserts to detect invalid addresses. * config/i386/i386.c (ix86_print_operand_address): Ditto. (ix86_decompose_address): Allow (zero_extend:DI (subreg:SI (...))) addresses. Prevent zero extensions of CONST_INT operands. 2012-07-22 Uros Bizjak <ubizjak@gmail.com> PR target/53961 * config/i386/i386.md (*lea): New insn pattern. (*lea_1): Remove. (*lea<mode>_2): Ditto. (*lea_{3,4,5,6}_zext): Ditto. * config/i386/predicates.md (lea_address_operand): Do not reject zero-extended address operands. * config/i386/constraints.md (j): Remove address constraint. * config/i386/i386.c (ix86_decompose_address): Allow SImode subreg of an address. (ix86_print_operand_address): Handle SImode subreg of an address. (ix86_avoid_lea_for_addr): Reject zero-extended addresses for now. Modified: branches/gcc-4_7-branch/gcc/ChangeLog branches/gcc-4_7-branch/gcc/config/i386/constraints.md branches/gcc-4_7-branch/gcc/config/i386/i386.c branches/gcc-4_7-branch/gcc/config/i386/i386.md branches/gcc-4_7-branch/gcc/config/i386/predicates.md
Fixed everywhere.