This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

fix strlensi in i386.md



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.  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]