Commit 9712cba0 by Jakub Jelinek Committed by Jakub Jelinek

re PR debug/46893 (ICE: in trunc_int_for_mode, at explow.c:56 with -O -g)

	PR debug/46893
	* cfgexpand.c (expand_debug_expr): If GET_MODE (op0) is VOIDmode,
	use TYPE_MODE (TREE_TYPE (tem)) instead of mode1.

	* gcc.dg/pr46893.c: New test.

From-SVN: r167949
parent 8f2cbdca
2010-12-16 Jakub Jelinek <jakub@redhat.com>
PR debug/46893
* cfgexpand.c (expand_debug_expr): If GET_MODE (op0) is VOIDmode,
use TYPE_MODE (TREE_TYPE (tem)) instead of mode1.
2010-12-16 Chung-Lin Tang <cltang@codesourcery.com> 2010-12-16 Chung-Lin Tang <cltang@codesourcery.com>
PR target/46883 PR target/46883
...@@ -2703,7 +2703,7 @@ expand_debug_expr (tree exp) ...@@ -2703,7 +2703,7 @@ expand_debug_expr (tree exp)
enum machine_mode opmode = GET_MODE (op0); enum machine_mode opmode = GET_MODE (op0);
if (opmode == VOIDmode) if (opmode == VOIDmode)
opmode = mode1; opmode = TYPE_MODE (TREE_TYPE (tem));
/* This condition may hold if we're expanding the address /* This condition may hold if we're expanding the address
right past the end of an array that turned out not to right past the end of an array that turned out not to
...@@ -2724,7 +2724,8 @@ expand_debug_expr (tree exp) ...@@ -2724,7 +2724,8 @@ expand_debug_expr (tree exp)
? SIGN_EXTRACT ? SIGN_EXTRACT
: ZERO_EXTRACT, mode, : ZERO_EXTRACT, mode,
GET_MODE (op0) != VOIDmode GET_MODE (op0) != VOIDmode
? GET_MODE (op0) : mode1, ? GET_MODE (op0)
: TYPE_MODE (TREE_TYPE (tem)),
op0, GEN_INT (bitsize), GEN_INT (bitpos)); op0, GEN_INT (bitsize), GEN_INT (bitpos));
} }
......
2010-12-16 Jakub Jelinek <jakub@redhat.com>
PR debug/46893
* gcc.dg/pr46893.c: New test.
2010-12-16 H.J. Lu <hongjiu.lu@intel.com> 2010-12-16 H.J. Lu <hongjiu.lu@intel.com>
PR lto/46976 PR lto/46976
......
/* PR debug/46893 */
/* { dg-do compile } */
/* { dg-options "-O -g" } */
void
foo (void)
{
union { unsigned long long l; double d; } u = { 0x7ff0000000000000ULL };
double v = 0, w = -u.d;
if (w)
w = v;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment