diff options
author | Eric Botcazou <ebotcazou@libertysurf.fr> | 2005-10-19 16:42:17 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2005-10-19 14:42:17 +0000 |
commit | e48050bd060e5faeae80c4c833e14fe3885ed599 (patch) | |
tree | 78ff2fa79db3827d5cfd641d055766a3bbc93414 | |
parent | 486516b60ba69fa8bd5fd13a9e4f630642d18546 (diff) | |
download | gcc-e48050bd060e5faeae80c4c833e14fe3885ed599.zip gcc-e48050bd060e5faeae80c4c833e14fe3885ed599.tar.gz gcc-e48050bd060e5faeae80c4c833e14fe3885ed599.tar.bz2 |
re PR middle-end/23199 (ICE in int_mode_for_mode, at stor-layout.c:251)
PR middle-end/23199
* cfgrtl.c (safe_insert_insn_on_edge): Use can_copy_p to detect
whether registers live on the edge can be saved/restored.
From-SVN: r105618
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cfgrtl.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/profile-generate-2.c | 35 |
4 files changed, 47 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4963ef9..45d936a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-10-19 Eric Botcazou <ebotcazou@libertysurf.fr> + + PR middle-end/23199 + * cfgrtl.c (safe_insert_insn_on_edge): Use can_copy_p to detect + whether registers live on the edge can be saved/restored. + 2005-10-19 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (fixup_mova): Skip notes. diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 00a219d4..f49eceb 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -1456,16 +1456,9 @@ safe_insert_insn_on_edge (rtx insn, edge e) regset killed; rtx save_regs = NULL_RTX; unsigned regno; - int noccmode; enum machine_mode mode; reg_set_iterator rsi; -#ifdef AVOID_CCMODE_COPIES - noccmode = true; -#else - noccmode = false; -#endif - killed = ALLOC_REG_SET (®_obstack); for (x = insn; x; x = NEXT_INSN (x)) @@ -1491,7 +1484,8 @@ safe_insert_insn_on_edge (rtx insn, edge e) if (mode == VOIDmode) return false; - if (noccmode && mode == CCmode) + /* Avoid copying in CCmode if we can't. */ + if (!can_copy_p (mode)) return false; save_regs = alloc_EXPR_LIST (0, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a79e36e..860f927 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2005-10-19 Eric Botcazou <ebotcazou@libertysurf.fr> + + * gcc.dg/profile-generate-2.c: New test. + 2005-10-18 Danny Smith <dannysmith@users.sourceforge.net> PR target/23589 diff --git a/gcc/testsuite/gcc.dg/profile-generate-2.c b/gcc/testsuite/gcc.dg/profile-generate-2.c new file mode 100644 index 0000000..eaea065 --- /dev/null +++ b/gcc/testsuite/gcc.dg/profile-generate-2.c @@ -0,0 +1,35 @@ +/* PR middle-end/23199 */ +/* Testcase by Ralf Menzel <menzel@ls6.cs.uni-dortmund.de> */ + +/* { dg-do compile } */ +/* { dg-options "-O -fprofile-generate" } */ + +union rtunion_def +{ + struct rtx_def *rt_rtx; +}; + +typedef union rtunion_def rtunion; + +struct rtx_def +{ + unsigned int in_struct : 1; + union u { + rtunion fld[1]; + } u; +}; + +typedef struct rtx_def *rtx; + +static void +check_annul_list_true_false (int annul_true_p, rtx delay_list) +{ + rtx temp; + while (1) + { + temp = delay_list; + rtx trial = (((temp)->u.fld[0]).rt_rtx); + if ((annul_true_p && (((trial))->in_struct))) + return; + } +} |