This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Debug temps regressions
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 14 Oct 2009 11:40:59 +0200
- Subject: [PATCH] Debug temps regressions
- References: <oriqei5z4s.fsf@livre.localdomain> <20091014073147.GZ14664@tyan-ft48-01.lab.bos.redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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