* [PATCH] Fix dwarf2out ICE (PR debug/65771)
@ 2015-04-16 21:11 Jakub Jelinek
2015-04-16 23:45 ` [PATCH] Improve debug info generation for TLS + const " Jakub Jelinek
2015-04-17 7:25 ` [PATCH] Fix dwarf2out ICE " Richard Biener
0 siblings, 2 replies; 4+ messages in thread
From: Jakub Jelinek @ 2015-04-16 21:11 UTC (permalink / raw)
To: Jason Merrill; +Cc: gcc-patches
Hi!
As mentioned in the PR, on the following testcase we ICE, because for
# DEBUG D#2 => b
# DEBUG D#1 => a[D#2].t
# DEBUG c => D#1
during expansion we get the a[D#2].t added as MEM_EXPR of a MEM, and because
we can't mem_loc_descriptor that MEM (I'll post separately a trunk only
patch that fixes that in this case, but generally not all MEMs can be
represented in debug info), we try harder and try to use MEM_EXPR in
loc_list_from_tree, but that one ICEs on DEBUG_EXPR_DECL. There is nothing
we can do for those at this point, debug_exprs are only useful to
var-tracking, so returning NULL is the only thing we can do for those.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk and 5.1?
2015-04-16 Jakub Jelinek <jakub@redhat.com>
PR debug/65771
* dwarf2out.c (loc_list_from_tree): Return NULL
for DEBUG_EXPR_DECL.
* gcc.dg/debug/pr65771.c: New test.
--- gcc/dwarf2out.c.jj 2015-04-16 16:51:52.000000000 +0200
+++ gcc/dwarf2out.c 2015-04-16 16:57:28.866134980 +0200
@@ -14642,6 +14642,7 @@ loc_list_from_tree (tree loc, int want_a
case TARGET_MEM_REF:
case SSA_NAME:
+ case DEBUG_EXPR_DECL:
return NULL;
case COMPOUND_EXPR:
--- gcc/testsuite/gcc.dg/debug/pr65771.c.jj 2015-04-16 17:00:23.811328842 +0200
+++ gcc/testsuite/gcc.dg/debug/pr65771.c 2015-04-16 17:00:13.000000000 +0200
@@ -0,0 +1,15 @@
+/* PR debug/65771 */
+/* { dg-do link } */
+/* { dg-require-effective-target tls } */
+
+struct S { int s; int t; };
+__thread struct S a[10];
+int b;
+
+int
+main ()
+{
+ int c = a[b].t;
+ (void) c;
+ return 0;
+}
Jakub
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] Improve debug info generation for TLS + const (PR debug/65771)
2015-04-16 21:11 [PATCH] Fix dwarf2out ICE (PR debug/65771) Jakub Jelinek
@ 2015-04-16 23:45 ` Jakub Jelinek
2015-04-17 14:04 ` Jason Merrill
2015-04-17 7:25 ` [PATCH] Fix dwarf2out ICE " Richard Biener
1 sibling, 1 reply; 4+ messages in thread
From: Jakub Jelinek @ 2015-04-16 23:45 UTC (permalink / raw)
To: Jason Merrill; +Cc: gcc-patches
On Thu, Apr 16, 2015 at 11:11:06PM +0200, Jakub Jelinek wrote:
> during expansion we get the a[D#2].t added as MEM_EXPR of a MEM, and because
> we can't mem_loc_descriptor that MEM (I'll post separately a trunk only
> patch that fixes that in this case, but generally not all MEMs can be
> represented in debug info), we try harder and try to use MEM_EXPR in
Here is the patch for it, bootstrapped/regtested on x86_64-linux and
i686-linux, ok for trunk?
We handle TLS SYMBOL_REFs in mem_loc_descriptor, but in the testcase it
is surrounded by (const (plus (symbol_ref) (const_int))).
2015-04-16 Jakub Jelinek <jakub@redhat.com>
PR debug/65771
* dwarf2out.c (mem_loc_descriptor): For CONST, fallback to
trying mem_loc_descriptor on XEXP (rtl, 0).
--- gcc/dwarf2out.c.jj 2015-02-26 16:37:09.000000000 +0100
+++ gcc/dwarf2out.c 2015-04-16 16:45:44.584429608 +0200
@@ -12799,7 +12799,12 @@ mem_loc_descriptor (rtx rtl, machine_mod
}
if (!const_ok_for_output (rtl))
- break;
+ {
+ if (GET_CODE (rtl) == CONST)
+ mem_loc_result = mem_loc_descriptor (XEXP (rtl, 0), mode, mem_mode,
+ initialized);
+ break;
+ }
symref:
mem_loc_result = new_addr_loc_descr (rtl, dtprel_false);
Jakub
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix dwarf2out ICE (PR debug/65771)
2015-04-16 21:11 [PATCH] Fix dwarf2out ICE (PR debug/65771) Jakub Jelinek
2015-04-16 23:45 ` [PATCH] Improve debug info generation for TLS + const " Jakub Jelinek
@ 2015-04-17 7:25 ` Richard Biener
1 sibling, 0 replies; 4+ messages in thread
From: Richard Biener @ 2015-04-17 7:25 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: Jason Merrill, GCC Patches
On Thu, Apr 16, 2015 at 11:11 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> As mentioned in the PR, on the following testcase we ICE, because for
> # DEBUG D#2 => b
> # DEBUG D#1 => a[D#2].t
> # DEBUG c => D#1
> during expansion we get the a[D#2].t added as MEM_EXPR of a MEM, and because
> we can't mem_loc_descriptor that MEM (I'll post separately a trunk only
> patch that fixes that in this case, but generally not all MEMs can be
> represented in debug info), we try harder and try to use MEM_EXPR in
> loc_list_from_tree, but that one ICEs on DEBUG_EXPR_DECL. There is nothing
> we can do for those at this point, debug_exprs are only useful to
> var-tracking, so returning NULL is the only thing we can do for those.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk and 5.1?
Ok.
Thanks,
Richard.
> 2015-04-16 Jakub Jelinek <jakub@redhat.com>
>
> PR debug/65771
> * dwarf2out.c (loc_list_from_tree): Return NULL
> for DEBUG_EXPR_DECL.
>
> * gcc.dg/debug/pr65771.c: New test.
>
> --- gcc/dwarf2out.c.jj 2015-04-16 16:51:52.000000000 +0200
> +++ gcc/dwarf2out.c 2015-04-16 16:57:28.866134980 +0200
> @@ -14642,6 +14642,7 @@ loc_list_from_tree (tree loc, int want_a
>
> case TARGET_MEM_REF:
> case SSA_NAME:
> + case DEBUG_EXPR_DECL:
> return NULL;
>
> case COMPOUND_EXPR:
> --- gcc/testsuite/gcc.dg/debug/pr65771.c.jj 2015-04-16 17:00:23.811328842 +0200
> +++ gcc/testsuite/gcc.dg/debug/pr65771.c 2015-04-16 17:00:13.000000000 +0200
> @@ -0,0 +1,15 @@
> +/* PR debug/65771 */
> +/* { dg-do link } */
> +/* { dg-require-effective-target tls } */
> +
> +struct S { int s; int t; };
> +__thread struct S a[10];
> +int b;
> +
> +int
> +main ()
> +{
> + int c = a[b].t;
> + (void) c;
> + return 0;
> +}
>
> Jakub
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Improve debug info generation for TLS + const (PR debug/65771)
2015-04-16 23:45 ` [PATCH] Improve debug info generation for TLS + const " Jakub Jelinek
@ 2015-04-17 14:04 ` Jason Merrill
0 siblings, 0 replies; 4+ messages in thread
From: Jason Merrill @ 2015-04-17 14:04 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: gcc-patches
OK.
Jason
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-04-17 14:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-16 21:11 [PATCH] Fix dwarf2out ICE (PR debug/65771) Jakub Jelinek
2015-04-16 23:45 ` [PATCH] Improve debug info generation for TLS + const " Jakub Jelinek
2015-04-17 14:04 ` Jason Merrill
2015-04-17 7:25 ` [PATCH] Fix dwarf2out ICE " Richard Biener
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).