public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix segfault with -fdump-tree-all-all
@ 2008-03-19 15:45 Martin Jambor
  2008-03-19 19:46 ` Richard Guenther
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Jambor @ 2008-03-19 15:45 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 1463 bytes --]

Hi,

I made  myself a simple  c++ test case (preprocessed  source attached)
and found out  that the trunk gcc was segfaulting at  it when run with
-fdump-tree-all-all.  The segfault can be fixed by the following patch
which I have not regression tested  nor bootstrapped.  I hope it is so
simple that someone will test  and commit it alongside something else.
Finally,  the author of  the modified  code might  want to  handle the
problem differently....

Thanks for attention,

Martin

Changelog:

2008-03-19  Martin Jambor  <mjambor@suse.cz>

	* tree-data-ref.c (dump_data_dependence_relation): Avoid data
	reference dumps if dependence is unknown.

Patch:

Index: gcc/tree-data-ref.c
===================================================================
--- gcc/tree-data-ref.c	(revision 133342)
+++ gcc/tree-data-ref.c	(working copy)
@@ -362,13 +362,16 @@ dump_data_dependence_relation (FILE *out
   drb = DDR_B (ddr);
   fprintf (outf, "(Data Dep: \n");
 
+  if (DDR_ARE_DEPENDENT (ddr) == chrec_dont_know)
+    {
+      fprintf (outf, "    (don't know)\n)\n");
+      return;
+    }  
+
   dump_data_reference (outf, dra);
   dump_data_reference (outf, drb);
 
-  if (DDR_ARE_DEPENDENT (ddr) == chrec_dont_know)
-    fprintf (outf, "    (don't know)\n");
-  
-  else if (DDR_ARE_DEPENDENT (ddr) == chrec_known)
+  if (DDR_ARE_DEPENDENT (ddr) == chrec_known)
     fprintf (outf, "    (no dependence)\n");
   
   else if (DDR_ARE_DEPENDENT (ddr) == NULL_TREE)


[-- Attachment #2: member.ii.gz --]
[-- Type: application/x-gzip, Size: 4571 bytes --]

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

end of thread, other threads:[~2008-03-21 12:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-19 15:45 [PATCH] Fix segfault with -fdump-tree-all-all Martin Jambor
2008-03-19 19:46 ` Richard Guenther
2008-03-19 20:54   ` Martin Jambor
2008-03-21 13:06     ` Martin Jambor
2008-03-21 13:11       ` 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).