public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Debug temps regressions
       [not found] ` <20091014073147.GZ14664@tyan-ft48-01.lab.bos.redhat.com>
@ 2009-10-14  9:43   ` Jakub Jelinek
  2009-10-14 15:47     ` Jakub Jelinek
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2009-10-14  9:43 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: gcc-patches

Hi!

On redhat/gcc-4_4-branch with debug temps and PR41616 backports:

On Wed, Oct 14, 2009 at 09:31:47AM +0200, Jakub Jelinek wrote:
> make check results look fine except on x86_64, where I see new regressions
> (-O3 -g, so likely VTA related):
> 
> +FAIL: gcc.dg/torture/pr34330.c  -O3 -g  (internal compiler error)
> +FAIL: gcc.dg/torture/pr34330.c  -O3 -g  (test for excess errors)

This one is when separate_decls_in_region_debug_bind in tree-parloops.c is
called on
# DEBUG D#1 => NULL
It causes assertion failure immediately:
867       var = gimple_debug_bind_get_var (stmt);
868       gcc_assert (DECL_P (var) && SSA_VAR_P (var));

As this function is called on all debug stmts, we have to handle also
DEBUG_EXPR_DECL.  It isn't in the hash table, so we should probably
immediately return, just the question is if we should return true or false.
True will gsi_remove that debug stmt, which is probably better, but I'm not
100% sure.

> +FAIL: gcc.target/x86_64/abi/test_bitfields.c compilation,  -O3 -g (internal compiler error)
> +UNRESOLVED: gcc.target/x86_64/abi/test_bitfields.c execution,  -O3 -g

This one is caused by the other patch, PR41616.
The ICE is with a zero-length bitfield during cfgexpand but I think even
non-zero length bitfields will ICE.

Both of the testcases are fixed by, but haven't bootstrapped/regtested
it yet.  Neither testcase fails on the trunk, the issues are just latent
there.

2009-10-14  Jakub Jelinek  <jakub@redhat.com>

	* tree-parloops.c (separate_decls_in_region_debug_bind): Drop debug
	stmts setting DEBUG_EXPR_DECLs.

	* cfgexpand.c (expand_debug_expr): Ignore zero-length bitfields.
	Don't crash if mode1 is VOIDmode.

--- gcc/tree-parloops.c.jj	2009-09-08 12:32:17.000000000 +0200
+++ gcc/tree-parloops.c	2009-10-14 11:13:57.000000000 +0200
@@ -865,6 +865,8 @@ separate_decls_in_region_debug_bind (gim
   void **slot, **dslot;
 
   var = gimple_debug_bind_get_var (stmt);
+  if (TREE_CODE (var) == DEBUG_EXPR_DECL)
+    return true;
   gcc_assert (DECL_P (var) && SSA_VAR_P (var));
   ielt.uid = DECL_UID (var);
   dslot = htab_find_slot_with_hash (decl_copies, &ielt, ielt.uid, NO_INSERT);
--- gcc/cfgexpand.c.jj	2009-10-14 09:49:29.000000000 +0200
+++ gcc/cfgexpand.c	2009-10-14 11:23:58.000000000 +0200
@@ -2267,6 +2267,9 @@ expand_debug_expr (tree exp)
 					&mode1, &unsignedp, &volatilep, false);
 	rtx orig_op0;
 
+	if (bitsize == 0)
+	  return NULL;
+
 	orig_op0 = op0 = expand_debug_expr (tem);
 
 	if (!op0)
@@ -2304,6 +2307,9 @@ expand_debug_expr (tree exp)
 
 	if (MEM_P (op0))
 	  {
+	    if (mode1 == VOIDmode)
+	      /* Bitfield.  */
+	      mode1 = smallest_mode_for_size (bitsize, MODE_INT);
 	    if (bitpos >= BITS_PER_UNIT)
 	      {
 		op0 = adjust_address_nv (op0, mode1, bitpos / BITS_PER_UNIT);
@@ -2311,7 +2317,8 @@ expand_debug_expr (tree exp)
 	      }
 	    else if (bitpos < 0)
 	      {
-		int units = (-bitpos + BITS_PER_UNIT - 1) / BITS_PER_UNIT;
+		HOST_WIDE_INT units
+		  = (-bitpos + BITS_PER_UNIT - 1) / BITS_PER_UNIT;
 		op0 = adjust_address_nv (op0, mode1, units);
 		bitpos += units * BITS_PER_UNIT;
 	      }


	Jakub

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

* Re: [PATCH] Debug temps regressions
  2009-10-14  9:43   ` [PATCH] Debug temps regressions Jakub Jelinek
@ 2009-10-14 15:47     ` Jakub Jelinek
  2009-10-14 16:20       ` Richard Guenther
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2009-10-14 15:47 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: gcc-patches

On Wed, Oct 14, 2009 at 11:40:59AM +0200, Jakub Jelinek wrote:
> 2009-10-14  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* tree-parloops.c (separate_decls_in_region_debug_bind): Drop debug
> 	stmts setting DEBUG_EXPR_DECLs.
> 
> 	* cfgexpand.c (expand_debug_expr): Ignore zero-length bitfields.
> 	Don't crash if mode1 is VOIDmode.

Now bootstrapped/regtested on the trunk.

	Jakub

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

* Re: [PATCH] Debug temps regressions
  2009-10-14 15:47     ` Jakub Jelinek
@ 2009-10-14 16:20       ` Richard Guenther
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Guenther @ 2009-10-14 16:20 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Alexandre Oliva, gcc-patches

On Wed, Oct 14, 2009 at 5:28 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Oct 14, 2009 at 11:40:59AM +0200, Jakub Jelinek wrote:
>> 2009-10-14  Jakub Jelinek  <jakub@redhat.com>
>>
>>       * tree-parloops.c (separate_decls_in_region_debug_bind): Drop debug
>>       stmts setting DEBUG_EXPR_DECLs.
>>
>>       * cfgexpand.c (expand_debug_expr): Ignore zero-length bitfields.
>>       Don't crash if mode1 is VOIDmode.
>
> Now bootstrapped/regtested on the trunk.

Ok.

Thanks,
Richard.

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <oriqei5z4s.fsf@livre.localdomain>
     [not found] ` <20091014073147.GZ14664@tyan-ft48-01.lab.bos.redhat.com>
2009-10-14  9:43   ` [PATCH] Debug temps regressions Jakub Jelinek
2009-10-14 15:47     ` Jakub Jelinek
2009-10-14 16:20       ` Richard Guenther

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