public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix mode checks in var-tracking.c
@ 2009-10-22 21:40 Richard Sandiford
  2009-10-22 21:45 ` Jakub Jelinek
  2009-10-28 14:17 ` Fix mode checks in var-tracking.c Ian Lance Taylor
  0 siblings, 2 replies; 7+ messages in thread
From: Richard Sandiford @ 2009-10-22 21:40 UTC (permalink / raw)
  To: gcc-patches; +Cc: jakub

As Jakub pointed out, my recent wrap_constant pass removed some
XPASSes in the guality.exp testsuite.  This is a repost of the
patch I suggested there, having now bootstrapped & regression-tested
it on x86_64-linux-gnu.  The idea is to check the mode of the
original variable location (which is documented as being a
VALUE, MEM or REG) instead of the expanded version, which could
be a CONST_INT.  In the second hunk, I moved the mode check above
the call to vt_expand_loc, since it's far cheaper.

The "after" results for this patch were exactly the same as the "before"
results, which wasn't what I was hoping.  By rights, the XPASSes should
have reappeared.  I looked at the logs again, and it seems many of the
guality.exp tests are failing for me when run from a normal -j5 top-level
"make check".  E.g. I get:

FAIL: b is not computable, expected 3003
FAIL: ab is not computable, expected 6296328
FAIL: ac is not computable, expected 6296332
FAIL: msg is not computable, expected 4198085
FAIL: 0 PASS, 4 FAIL, 0 UNRESOLVED
XFAIL: gcc.dg/guality/inline-params.c  -Os  execution test

both before and after the patch.  (This is one of the tests that my
patch regressed.  The other regressing tests have similar output.)

I went back and looked at my logs for the wrap_constant patch,
and saw the same thing.  So I hadn't missed the dropped XPASSes
after all; they never were XPASSes in my results to begin with.
I had to run the guality.exp separately, which is what I did when
looking at Jakub's original bug report.  The tests do XPASS after
the patch when run individually, and do fail before the patch
when run in the same way.

My guess is that I'm hitting some problem that causes the underlying gdb
session to fail in some unreported way.  But some tests do XPASS for me
even in the normal results, and that list of XPASSes has been consistent
over several runs.  So it does seem to be deterministic.

OK to install?

Richard


gcc/
	* var-tracking.c (emit_note_insn_var_location): Get the mode of
	a variable part from its REG, MEM or VALUE.

Index: gcc/var-tracking.c
===================================================================
--- gcc/var-tracking.c	2009-10-22 19:20:19.000000000 +0100
+++ gcc/var-tracking.c	2009-10-22 19:20:54.000000000 +0100
@@ -6402,7 +6402,7 @@ emit_note_insn_var_location (void **varp
 	  continue;
 	}
       loc[n_var_parts] = loc2;
-      mode = GET_MODE (loc[n_var_parts]);
+      mode = GET_MODE (var->var_part[i].loc_chain->loc);
       initialized = var->var_part[i].loc_chain->init;
       last_limit = offsets[n_var_parts] + GET_MODE_SIZE (mode);
 
@@ -6413,9 +6413,9 @@ emit_note_insn_var_location (void **varp
 	  break;
       if (j < var->n_var_parts
 	  && wider_mode != VOIDmode
+	  && mode == GET_MODE (var->var_part[j].loc_chain->loc)
 	  && (loc2 = vt_expand_loc (var->var_part[j].loc_chain->loc, vars))
 	  && GET_CODE (loc[n_var_parts]) == GET_CODE (loc2)
-	  && mode == GET_MODE (loc2)
 	  && last_limit == var->var_part[j].offset)
 	{
 	  rtx new_loc = NULL;

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-10-28 14:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-22 21:40 Fix mode checks in var-tracking.c Richard Sandiford
2009-10-22 21:45 ` Jakub Jelinek
2009-10-22 22:31   ` Richard Sandiford
2009-10-23  0:37     ` Jakub Jelinek
2009-10-23 21:28     ` [PATCH] Slight emit_note_insn_var_location optimization (was Re: Fix mode checks in var-tracking.c) Jakub Jelinek
2009-10-28 14:22       ` Ian Lance Taylor
2009-10-28 14:17 ` Fix mode checks in var-tracking.c Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).