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]

Patch: Internal Error Using -O2


Hi,

The attached patch fixes an internal compiler error which can occur
when using -O2.
The problem occurs (in this case) when the compiler realizes that a
C++ reference argument can't
live in a register and must be stored on the stack. At that time it
changes its location from REG to MEM and calls fixup_var_refs to fixup

all the insns which reference that location. In this case one such
insn was in the sequence associated with a C++ catch clause.
fixup_var_refs did not contain code to scan through the catch clauses,

so the insn was not fixed and was subsequently not recognized later.

Dave
Index: function.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/function.c,v
retrieving revision 1.189
diff -c -p -c -p -r1.189 function.c
*** function.c	1999/01/29 20:51:10	1.189
--- function.c	1999/02/04 00:39:37
*************** fixup_var_refs (var, promoted_mode, unsi
*** 1646,1651 ****
--- 1646,1656 ----
  	  end_sequence ();
  	}
      }
+ 
+   /* Scan the catch clauses for exception handling too.  */
+   push_to_sequence (catch_clauses);
+   fixup_var_refs_insns (var, promoted_mode, unsignedp, catch_clauses, 0);
+   end_sequence ();
  }
  
  /* REPLACEMENTS is a pointer to a list of the struct fixup_replacement and X is

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