Bug 49780

Summary: [x32] internal compiler error: in create_mem_ref, at tree-ssa-address.c:806
Product: gcc Reporter: H.J. Lu <hjl.tools>
Component: targetAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: ubizjak
Priority: P3    
Version: 4.7.0   
Target Milestone: 4.7.0   
URL: http://gcc.gnu.org/ml/gcc-patches/2011-07/msg01555.html
Host: Target: x32
Build: Known to work:
Known to fail: Last reconfirmed:

Description H.J. Lu 2011-07-18 18:48:08 UTC
[hjl@gnu-6 ilp32-36]$ cat x.i 
typedef long long __m256i __attribute__ ((__vector_size__ (32),
       __may_alias__));
typedef union
{
  __m256i x;
  char a[32];
} union256i_b;
int check_union256i_b (union256i_b u, const char *v)
{
  int i;
  int err = 0;
  for (i = 0; i < (sizeof (u.a) / sizeof ((u.a)[0])); i++)
    if (u.a[i] != v[i])
      {
	err++;
      } 
  return err;
}
[hjl@gnu-6 ilp32-36]$ make
/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/ -S -o x.s -mx32 -O2 -mavx   x.i
x.i: In function ‘check_union256i_b’:
x.i:8:5: internal compiler error: in create_mem_ref, at tree-ssa-address.c:806
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [x.s] Error 1
[hjl@gnu-6 ilp32-36]$
Comment 1 uros 2011-07-20 12:58:31 UTC
Author: uros
Date: Wed Jul 20 12:58:28 2011
New Revision: 176506

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176506
Log:
	PR target/49780
	* config/i386/predicates.md (no_seg_addres_operand): No more special.
	* config/i386/i386.c (ix86_decompose_address): Allow only subregs
	of DImode hard registers in base.
	(ix86_legitimate_address_p): Allow SImode and DImode base and index
	registers.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c
    trunk/gcc/config/i386/predicates.md
Comment 2 Uroš Bizjak 2011-07-20 13:04:16 UTC
Fixed.
Comment 3 hjl@gcc.gnu.org 2011-07-20 23:05:54 UTC
Author: hjl
Date: Wed Jul 20 23:05:52 2011
New Revision: 176541

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176541
Log:
Remove checks that base and index registers are in Pmode.

2011-07-19  Uros Bizjak  <ubizjak@gmail.com>

	PR target/49780
	* config/i386/i386.c (ix86_legitimate_address_p): Remove checks
	that base and index registers are in Pmode.

Modified:
    branches/x32/gcc/ChangeLog.x32
    branches/x32/gcc/config/i386/i386.c
Comment 4 hjl@gcc.gnu.org 2011-07-20 23:07:00 UTC
Author: hjl
Date: Wed Jul 20 23:06:57 2011
New Revision: 176542

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176542
Log:
Allow only subregs of DImode hard regs.

2011-07-19  Uros Bizjak  <ubizjak@gmail.com>

	PR target/49780
	* config/i386/i386.c (ix86_decompose_address): Allow only subregs
	of DImode hard regs.

	* config/i386/predicates.md (no_seg_address_operand): Use
	define_predicate.

Modified:
    branches/x32/gcc/ChangeLog.x32
    branches/x32/gcc/config/i386/i386.c
    branches/x32/gcc/config/i386/predicates.md