This is the mail archive of the 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]

[PATCH] Fix yet another expand_debug_expr ICE (PR middle-end/83694)


The recently added testcase for PR83666 ICEs on powerpc*/sparc*
and perhaps other targets, where get_inner_reference gives us
VOIDmode for a 512-bit field and smallest_int_mode_for_size
ICEs on it because there is no such integer mode.

Fixed by giving up above MAX_BITSIZE_MODE_ANY_INT, that would have been
BLKmode and not really useful for debug info generation anyway.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2018-01-05  Jakub Jelinek  <>

	PR middle-end/83694
	* cfgexpand.c (expand_debug_expr): Punt if mode1 is VOIDmode
	and bitsize might be greater than MAX_BITSIZE_MODE_ANY_INT.

--- gcc/cfgexpand.c.jj	2018-01-04 12:43:38.199537090 +0100
+++ gcc/cfgexpand.c	2018-01-05 12:10:46.960037601 +0100
@@ -4534,8 +4534,12 @@ expand_debug_expr (tree exp)
 	if (MEM_P (op0))
 	    if (mode1 == VOIDmode)
-	      /* Bitfield.  */
-	      mode1 = smallest_int_mode_for_size (bitsize);
+	      {
+		if (maybe_gt (bitsize, MAX_BITSIZE_MODE_ANY_INT))
+		  return NULL;
+		/* Bitfield.  */
+		mode1 = smallest_int_mode_for_size (bitsize);
+	      }
 	    poly_int64 bytepos = bits_to_bytes_round_down (bitpos);
 	    if (maybe_ne (bytepos, 0))


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