Patchwork [committed] Fix ICE on vector shift in dwarf2out (PR debug/49294)

login
register
mail settings
Submitter Jakub Jelinek
Date June 6, 2011, 5:51 p.m.
Message ID <20110606175145.GU17079@tyan-ft48-01.lab.bos.redhat.com>
Download mbox | patch
Permalink /patch/98968/
State New
Headers show

Comments

Jakub Jelinek - June 6, 2011, 5:51 p.m.
Hi!

Trying to create vector zero_extend is wrong, while mem_loc_descriptor
will for now fail for vector modes, the code attempted to expand zero_extend
anyway.

Fixed thusly, committed to trunk as obvious after bootstrapping/regtesting
on x86_64-linux and i686-linux.

2011-06-06  Jakub Jelinek  <jakub@redhat.com>

	PR debug/49294
	* dwarf2out.c (mem_loc_descriptor) <do_shift>: Give up for
	non-MODE_INT modes.

	* gcc.dg/debug/pr49294.c: New test.


	Jakub

Patch

--- gcc/dwarf2out.c.jj	2011-06-06 10:24:41.000000000 +0200
+++ gcc/dwarf2out.c	2011-06-06 10:30:05.000000000 +0200
@@ -14904,6 +14904,8 @@  mem_loc_descriptor (rtx rtl, enum machin
       goto do_shift;
 
     do_shift:
+      if (GET_MODE_CLASS (mode) != MODE_INT)
+	break;
       op0 = mem_loc_descriptor (XEXP (rtl, 0), mode, mem_mode,
 				VAR_INIT_STATUS_INITIALIZED);
       {
--- gcc/testsuite/gcc.dg/debug/pr49294.c.jj	2011-06-06 10:39:41.000000000 +0200
+++ gcc/testsuite/gcc.dg/debug/pr49294.c	2011-06-06 10:39:21.000000000 +0200
@@ -0,0 +1,14 @@ 
+/* PR debug/49294 */
+/* { dg-do compile } */
+
+typedef __attribute__ ((vector_size ((8) * sizeof (short)))) short V;
+
+int k;
+V v;
+
+void
+foo (void)
+{
+  V w = { k, k, k, k, k, k, k, k };
+  V x = v >> w;
+}