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]
Other format: [Raw text]

Check for NULL_RTX in gen_highpart


Hi,

The following testcase was submitted in PR 5279.
It causes gcc 3.0.3 to ICE, and mainline to segfault.

This patch does not solve the PR, but it causes mainline
to ICE instead of segfault, since simplify_gen_subreg
can return NULL_RTX.

2002-01-06  Craig Rodrigues  <rodrigc@gcc.gnu.org>

	* emit-rtl.c (gen_highpart): Add check for NULL_RTX.

Index: emit-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.241
diff -u -r1.241 emit-rtl.c
--- emit-rtl.c	2002/01/01 22:22:25	1.241
+++ emit-rtl.c	2002/01/06 17:52:26
@@ -1200,7 +1200,7 @@
   /* simplify_gen_subreg is not guaranteed to return a valid operand for
      the target if we have a MEM.  gen_highpart must return a valid operand,
      emitting code if necessary to do so.  */
-  if (GET_CODE (result) == MEM)
+  if (result != NULL_RTX && GET_CODE (result) == MEM)
     result = validize_mem (result);
 
   if (!result)
-- 
Craig Rodrigues        
http://www.gis.net/~craigr    
rodrigc@mediaone.net          


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