This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
fix strlensi in i386.md
- To: gcc-patches at gcc dot gnu dot org
- Subject: fix strlensi in i386.md
- From: Philipp Thomas <pthomas at suse dot de>
- Date: Fri, 3 Mar 2000 22:25:46 +0100
- Cc: Jan Hubicka <jh at suse dot cz>
eoschar and align were accessed befor being initialized. Here's what I think
is the correct fix:
Fri Mar 03 22:21:40 2000 Philipp Thomas <pthomas@suse.de>
* config/i386/i386.md(strlensi): Initialize variables before
accessing them.
Index: i386.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.md,v
retrieving revision 1.140
diff -u -p -r1.140 i386.md
--- i386.md 2000/03/01 11:15:52 1.140
+++ i386.md 2000/03/03 21:13:40
@@ -8591,7 +8591,9 @@
""
"
{
- rtx out, addr, eoschar, align, scratch1, scratch2, scratch3;
+ rtx out, addr, scratch1, scratch2, scratch3;
+ rtx eoschar = operands[2];
+ rtx align = operands[3];
/* The generic case of strlen expander is long. Avoid it's
expanding unless TARGET_INLINE_ALL_STRINGOPS. */
@@ -8603,8 +8605,6 @@
out = operands[0];
addr = force_reg (Pmode, XEXP (operands[1], 0));
- eoschar = operands[2];
- align = operands[3];
scratch1 = gen_reg_rtx (SImode);
if (TARGET_UNROLL_STRLEN && eoschar == const0_rtx && optimize > 1
--
Philipp Thomas <pthomas@suse.de>
SuSE GmbH, Deutschherrenstrasse 15-29, 90429 Nuremberg
The only difference between a bug and a feature is you can turn a feature off.