Check for NULL_RTX in gen_highpart

Andreas Jaeger aj@suse.de
Sun Jan 6 11:23:00 GMT 2002


Craig Rodrigues <rodrigc@mediaone.net> writes:

> Hi,
>
> The following testcase was submitted in PR 5279.

Where's the testcase?  Can you please send it - IMO it should be added
to the testsuite if there are no problems with it.

> 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)

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



More information about the Gcc-patches mailing list