From 0c076fa35902eadbbf8b43b16ec75f744949be61 Mon Sep 17 00:00:00 2001 From: uros Date: Mon, 26 Nov 2007 15:52:57 +0000 Subject: [PATCH] PR target/34215 * config/i386/i386.md (truncdfsf2): Select SLOT_TEMP stack slot if virtual registers are instantiated. (truncxf2): Ditto. (floatsi2): Ditto. (floatdisf2): Ditto. (floatdidf2): Ditto. testsuite/ChangeLog: PR target/34215 * gcc.target/i386/pr34215.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130440 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 26 ++++++++++++++++---------- gcc/config/i386/i386.md | 32 ++++++++++++++++++++------------ gcc/testsuite/ChangeLog | 7 ++++++- gcc/testsuite/gcc.target/i386/pr34215.c | 19 +++++++++++++++++++ 4 files changed, 61 insertions(+), 23 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr34215.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6f27344..acdc3d1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2007-11-26 Uros Bizjak + + PR target/34215 + * config/i386/i386.md (truncdfsf2): Select SLOT_TEMP stack slot if + virtual registers are instantiated. + (truncxf2): Ditto. + (floatsi2): Ditto. + (floatdisf2): Ditto. + (floatdidf2): Ditto. + 2007-11-26 Rask Ingemann Lambertsen PR target/34174 @@ -66,8 +76,7 @@ 2007-11-25 Richard Guenther - * tree.h (struct tree_block): Move locus member next to - flags. + * tree.h (struct tree_block): Move locus member next to flags. * c-decl.c (SCOPE_LIST_APPEND): Use BLOCK_CHAIN. (SCOPE_LIST_CONCAT): Likewise. (pop_scope): Likewise. @@ -92,7 +101,7 @@ register that dies there. 2007-11-23 Dirk Mueller - Richard Guenther + Richard Guenther PR middle-end/34197 * tree-vrp.c (check_array_ref): Move check for valid location.. @@ -105,7 +114,7 @@ outer_code. 2007-11-23 Richard Guenther - Michael Matz + Michael Matz PR tree-optimization/34176 * alloc-pool.h (empty_alloc_pool): Declare. @@ -119,11 +128,9 @@ 2007-11-23 Richard Guenther - * tree-ssa-copy.c (may_propagate_copy): Remove redundant - checks. + * tree-ssa-copy.c (may_propagate_copy): Remove redundant checks. (merge_alias_info): Do verification only if checking is - enabled. Merge flow-sensitive alias information in simple - cases. + enabled. Merge flow-sensitive alias information in simple cases. * tree-ssa-operands.c (get_addr_dereference_operands): Also complain about missing NMTs. @@ -160,8 +167,7 @@ 2007-11-22 Kaz Kojima - * config/sh/sh.md (divsi_inv_m3): Handle zero dividend - specially. + * config/sh/sh.md (divsi_inv_m3): Handle zero dividend specially. 2007-11-22 Uros Bizjak diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 4580afc..9b03b95 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -4074,7 +4074,8 @@ ; else { - rtx temp = assign_386_stack_local (SFmode, SLOT_VIRTUAL); + int slot = virtuals_instantiated ? SLOT_TEMP : SLOT_VIRTUAL; + rtx temp = assign_386_stack_local (SFmode, slot); emit_insn (gen_truncdfsf2_with_temp (operands[0], operands[1], temp)); DONE; } @@ -4258,7 +4259,10 @@ DONE; } else - operands[2] = assign_386_stack_local (mode, SLOT_VIRTUAL); + { + int slot = virtuals_instantiated ? SLOT_TEMP : SLOT_VIRTUAL; + operands[2] = assign_386_stack_local (mode, slot); + } }) (define_insn "*truncxfsf2_mixed" @@ -4833,7 +4837,8 @@ operands[1] = force_reg (SImode, operands[1]); else if (!MEM_P (operands[1])) { - rtx tmp = assign_386_stack_local (SImode, SLOT_VIRTUAL); + int slot = virtuals_instantiated ? SLOT_TEMP : SLOT_VIRTUAL; + rtx tmp = assign_386_stack_local (SImode, slot); emit_move_insn (tmp, operands[1]); operands[1] = tmp; } @@ -4847,9 +4852,10 @@ && !optimize_size && !MEM_P (operands[1])) { - rtx tmp = assign_386_stack_local (GET_MODE (operands[1]), SLOT_VIRTUAL); - emit_move_insn (tmp, operands[1]); - operands[1] = tmp; + int slot = virtuals_instantiated ? SLOT_TEMP : SLOT_VIRTUAL; + rtx tmp = assign_386_stack_local (GET_MODE (operands[1]), slot); + emit_move_insn (tmp, operands[1]); + operands[1] = tmp; } ") @@ -5116,9 +5122,10 @@ && !optimize_size && !MEM_P (operands[1])) { - rtx tmp = assign_386_stack_local (GET_MODE (operands[1]), SLOT_VIRTUAL); - emit_move_insn (tmp, operands[1]); - operands[1] = tmp; + int slot = virtuals_instantiated ? SLOT_TEMP : SLOT_VIRTUAL; + rtx tmp = assign_386_stack_local (GET_MODE (operands[1]), slot); + emit_move_insn (tmp, operands[1]); + operands[1] = tmp; } }) @@ -5192,9 +5199,10 @@ && !optimize_size && !MEM_P (operands[1])) { - rtx tmp = assign_386_stack_local (GET_MODE (operands[1]), SLOT_VIRTUAL); - emit_move_insn (tmp, operands[1]); - operands[1] = tmp; + int slot = virtuals_instantiated ? SLOT_TEMP : SLOT_VIRTUAL; + rtx tmp = assign_386_stack_local (GET_MODE (operands[1]), slot); + emit_move_insn (tmp, operands[1]); + operands[1] = tmp; } }) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d45e36f..a67d239 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-11-26 Uros Bizjak + + PR target/34215 + * gcc.target/i386/pr34215.c: New test. + 2007-11-26 Rask Ingemann Lambertsen PR target/34174 @@ -89,7 +94,7 @@ * g++.dg/warn/pr33160.C: New. 2007-11-23 Richard Guenther - Michael Matz + Michael Matz PR tree-optimization/34176 * gcc.c-torture/execute/pr34176.c: New testcase. diff --git a/gcc/testsuite/gcc.target/i386/pr34215.c b/gcc/testsuite/gcc.target/i386/pr34215.c new file mode 100644 index 0000000..9e194ff --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr34215.c @@ -0,0 +1,19 @@ +/* Testcase by Martin Michlmayr */ + +/* { dg-do compile } */ +/* { dg-require-effective-target ilp32 } */ +/* { dg-options "-O2" } */ + +double pow (double, double); + +void calc_score_dist (int mxdlen, long double d, long double **dist) +{ + unsigned long i, scr2; + for (i = 1; i <= mxdlen; i++) + { + for (scr2 = mxdlen; scr2 <= mxdlen + 10; scr2++) + { + } + dist[i][scr2] *= pow (1.0 / d, i); + } +} -- 2.7.4