diff mbox

fix -da

Message ID 25abf866-1e1d-74dd-90e3-40323d91a3b0@acm.org
State New
Headers show

Commit Message

Nathan Sidwell May 11, 2017, 2:25 p.m. UTC
A simple thinko caused -da to start including ipa dumps.  While 
investigating I noticed we might also place the kind enumeration into 
pflags, so defensively stripped that out.

Fixed thusly & committed.

nathan
diff mbox

Patch

2017-05-11  Nathan Sidwell  <nathan@acm.org>

	* dumpfile.h (TDF_FLAGS): New.
	* dumpfile.c (dump_start): Use TDF_FLAGS.
	(dump_enable_all): Fix TDF_KIND check thinko.

Index: dumpfile.c
===================================================================
--- dumpfile.c	(revision 247902)
+++ dumpfile.c	(working copy)
@@ -490,7 +490,7 @@  dump_start (int phase, int *flag_ptr)
       dfi->pstream = stream;
       dump_file = dfi->pstream;
       /* Initialize current dump flags. */
-      pflags = dfi->pflags;
+      pflags = TDF_FLAGS (dfi->pflags);
     }
 
   stream = dump_open_alternate_stream (dfi);
@@ -500,7 +500,7 @@  dump_start (int phase, int *flag_ptr)
       count++;
       alt_dump_file = dfi->alt_stream;
       /* Initialize current -fopt-info flags. */
-      alt_flags = dfi->alt_flags;
+      alt_flags = TDF_FLAGS (dfi->alt_flags);
     }
 
   if (flag_ptr)
@@ -682,7 +682,7 @@  dump_enable_all (int flags, const char *
 
   for (i = 0; i < m_extra_dump_files_in_use; i++)
     {
-      if (TDF_KIND (m_extra_dump_files[i].pflags) & ir_dump_type)
+      if (TDF_KIND (m_extra_dump_files[i].pflags) == ir_dump_type)
         {
           const char *old_filename = m_extra_dump_files[i].pfilename;
           m_extra_dump_files[i].pstate = -1;
Index: dumpfile.h
===================================================================
--- dumpfile.h	(revision 247902)
+++ dumpfile.h	(working copy)
@@ -55,6 +55,7 @@  enum tree_dump_index
 #define TDF_IPA		3	/* is an IPA dump */
 #define TDF_KIND_MASK   3
 #define TDF_KIND(X) ((X) & TDF_KIND_MASK)
+#define TDF_FLAGS(X) ((X) & ~TDF_KIND_MASK)
 
 /* Bit 2 unused, available for hire.  */
 #define TDF_ADDRESS	(1 << 3)	/* dump node addresses */