From 4bdd6fa67e3e13f0cb8f5d9c738f374135ec9748 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Thu, 5 Apr 2012 23:47:16 +0200 Subject: [PATCH] re PR target/52882 (ICE in memory_address_length, at config/i386/i386.c:23373) PR target/52882 * config/i386/i386.c (ix86_decompose_address): Allow VOIDmode CONST_INT operands, zero-extended with AND. testsuite/ChangeLog: PR target/52882 * gcc.target/i386/pr52882.c: New test. From-SVN: r186170 --- gcc/ChangeLog | 8 +++++++- gcc/config/i386/i386.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr52882.c | 19 +++++++++++++++++++ 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr52882.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e24e0d2..0df25cf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,10 +1,16 @@ +2012-04-05 Uros Bizjak + + PR target/52882 + * config/i386/i386.c (ix86_decompose_address): Allow VOIDmode + CONST_INT operands, zero-extended with AND. + 2012-04-05 Oleg Endo PR target/50751 * config/sh/sh.c (sh_find_mov_disp_adjust): Take machine_mode as the first argument instead of mode size. Move displacement calculations to ... - (mov_insn_size, max_mov_insn_displacement, mov_insn_alignment_mask): + (mov_insn_size, max_mov_insn_displacement, mov_insn_alignment_mask): ... these new functions. (disp_adjust): Remove max_mov_disp field. (sh_legitimate_index_p): Use max_mov_insn_displacement and diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index d58dafc..c959113 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -11510,7 +11510,7 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) addr = SUBREG_REG (addr); else if (GET_MODE (addr) == DImode) addr = gen_rtx_SUBREG (SImode, addr, 0); - else + else if (GET_MODE (addr) != VOIDmode) return 0; } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c4e4ecb..cde30ef 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-04-05 Uros Bizjak + + PR target/52882 + * gcc.target/i386/pr52882.c: New test. + 2012-04-05 Bill Schmidt Dominique D'Humieures diff --git a/gcc/testsuite/gcc.target/i386/pr52882.c b/gcc/testsuite/gcc.target/i386/pr52882.c new file mode 100644 index 0000000..5f0f12a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr52882.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +struct S1 { + int f0; + int f1; +}; + +int fn1 (); +void fn2 (struct S1); + +void +fn3 () { + struct S1 a = { 1, 0 }; + if (fn1 ()) + fn2 (a); + for (; a.f1;) { + } +} -- 2.7.4