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]

combine.c accesses uninitialized variable :-(



The last patch to combine accesses uninitialized memory.  I noticed
this since compilation of glibc produced an ICE.

Here's a patch that also fixes another problem (a prototype declared
with static but the function doesn't have static).  

Ok to install if it passes bootstrap and checking?

Andreas 

2001-01-12  Andreas Jaeger  <aj@suse.de>

	* combine.c (reversed_comparison): Fix typo in last patch.
	(combine_reversed_comparison_code): Make static to follow
	prototype declaration.

Index: combine.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/combine.c,v
retrieving revision 1.174
diff -u -r1.174 combine.c
--- combine.c	2001/01/11 23:10:30	1.174
+++ combine.c	2001/01/12 08:42:28
@@ -11123,7 +11123,7 @@
 
 /* Like jump.c' reversed_comparison_code, but use combine infrastructure for
    searching backward.  */
-enum rtx_code
+static enum rtx_code
 combine_reversed_comparison_code (exp)
      rtx exp;
 {
@@ -11135,7 +11135,7 @@
      return code1;
    /* Otherwise try and find where the condition codes were last set and
       use that.  */
-   x = get_last_value (XEXP (x, 0));
+   x = get_last_value (XEXP (exp, 0));
    if (GET_CODE (x) != COMPARE)
      return UNKNOWN;
    return reversed_comparison_code_parts (GET_CODE (exp),

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj

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