* Fix PR 61461: -fdump-rtl-all-slim causes ICE
@ 2014-07-15 4:30 Bernd Edlinger
2014-07-18 5:05 ` Jeff Law
0 siblings, 1 reply; 2+ messages in thread
From: Bernd Edlinger @ 2014-07-15 4:30 UTC (permalink / raw)
To: Richard Biener; +Cc: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 735 bytes --]
Hi,
When I try to print the dumps of fold-const.c
with -fdump-rtl-all-slim cc1plus crashes.
This is caused by pretty-printing the ADDR_VEC pattern,
which has a single argument, a vector of LABEL_REFs at position 0.
But instead XEXP(x,0) is printed, which causes the ICE.
However also ADDR_DIFF_VEC seems to do the wrong thing,
because the XEXP(0) is an uninteresting label, which references just
the own position.
Instead of that, the list of LABEL_REFs should be printed IMO,
which is at position 1, in this case.
The attached patch fixes both, by prining the list if LABEL_REFs
separated by semicolons.
Boot-strapped and regression-tested on x86_64-linux-gnu.
OK for trunk?
Thanks
Bernd.
[-- Attachment #2: changelog-pr61461.txt --]
[-- Type: text/plain, Size: 150 bytes --]
2014-07-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR rtl-optimization/61461
* sched-vis.c (print_pattern) <ADDR_VEC, ADDR_DIFF_VEC>: Fixed.
[-- Attachment #3: patch-pr61461.diff --]
[-- Type: application/octet-stream, Size: 758 bytes --]
Index: gcc/sched-vis.c
===================================================================
--- gcc/sched-vis.c (revision 212492)
+++ gcc/sched-vis.c (working copy)
@@ -611,9 +611,18 @@ print_pattern (pretty_printer *pp, const_rtx x, in
pp_printf (pp, "asm {%s}", XSTR (x, 0));
break;
case ADDR_VEC:
- /* Fall through. */
+ for (int i = 0; i < XVECLEN (x, 0); i++)
+ {
+ print_value (pp, XVECEXP (x, 0, i), verbose);
+ pp_semicolon (pp);
+ }
+ break;
case ADDR_DIFF_VEC:
- print_value (pp, XEXP (x, 0), verbose);
+ for (int i = 0; i < XVECLEN (x, 1); i++)
+ {
+ print_value (pp, XVECEXP (x, 1, i), verbose);
+ pp_semicolon (pp);
+ }
break;
case TRAP_IF:
pp_string (pp, "trap_if ");
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Fix PR 61461: -fdump-rtl-all-slim causes ICE
2014-07-15 4:30 Fix PR 61461: -fdump-rtl-all-slim causes ICE Bernd Edlinger
@ 2014-07-18 5:05 ` Jeff Law
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2014-07-18 5:05 UTC (permalink / raw)
To: Bernd Edlinger, Richard Biener; +Cc: gcc-patches
On 07/14/14 20:25, Bernd Edlinger wrote:
> Hi,
>
> When I try to print the dumps of fold-const.c
> with -fdump-rtl-all-slim cc1plus crashes.
> This is caused by pretty-printing the ADDR_VEC pattern,
> which has a single argument, a vector of LABEL_REFs at position 0.
> But instead XEXP(x,0) is printed, which causes the ICE.
>
> However also ADDR_DIFF_VEC seems to do the wrong thing,
> because the XEXP(0) is an uninteresting label, which references just
> the own position.
>
> Instead of that, the list of LABEL_REFs should be printed IMO,
> which is at position 1, in this case.
>
> The attached patch fixes both, by prining the list if LABEL_REFs
> separated by semicolons.
>
>
> Boot-strapped and regression-tested on x86_64-linux-gnu.
> OK for trunk?
>
>
> Thanks
> Bernd.
>
>
>
> changelog-pr61461.txt
>
>
> 2014-07-15 Bernd Edlinger<bernd.edlinger@hotmail.de>
>
> PR rtl-optimization/61461
> * sched-vis.c (print_pattern) <ADDR_VEC, ADDR_DIFF_VEC>: Fixed.
OK.
jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-18 5:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-15 4:30 Fix PR 61461: -fdump-rtl-all-slim causes ICE Bernd Edlinger
2014-07-18 5:05 ` Jeff Law
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).