public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix up --enable-checking=fold (PR middle-end/89503)
@ 2019-03-01  7:54 Jakub Jelinek
  2019-03-01  8:49 ` Richard Biener
  0 siblings, 1 reply; 6+ messages in thread
From: Jakub Jelinek @ 2019-03-01  7:54 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

Hi!

Some of the builtin folding sets TREE_NO_WARNING flags, which triggers as
--enable-checking=fold errors.  I think we should allow setting of
TREE_NO_WARNING flag when folding, so this patch arranges that.

Tested on:
../configure --enable-languages=c,c++,fortran --enable-checking=fold --disable-bootstrap
make -jN && make -jN -k check
No extra FAILs compared to normal regtest.  Ok for trunk?

2019-03-01  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/89503
	* fold-const.c (fold_checksum_tree): Ignore TREE_NO_WARNING bit
	on DECL_P and EXPR_P.

--- gcc/fold-const.c.jj	2019-02-21 00:01:05.714931643 +0100
+++ gcc/fold-const.c	2019-02-27 12:27:38.749353680 +0100
@@ -12130,6 +12130,7 @@ fold_checksum_tree (const_tree expr, str
       memcpy ((char *) &buf, expr, tree_size (expr));
       SET_DECL_ASSEMBLER_NAME ((tree)&buf, NULL);
       buf.decl_with_vis.symtab_node = NULL;
+      buf.base.nowarning_flag = 0;
       expr = (tree) &buf;
     }
   else if (TREE_CODE_CLASS (code) == tcc_type
@@ -12155,6 +12156,13 @@ fold_checksum_tree (const_tree expr, str
 	  TYPE_CACHED_VALUES (tmp) = NULL;
 	}
     }
+  else if (TREE_NO_WARNING (expr) && (DECL_P (expr) || EXPR_P (expr)))
+    {
+      /* Allow TREE_NO_WARNING to be set.  */
+      memcpy ((char *) &buf, expr, tree_size (expr));
+      buf.base.nowarning_flag = 0;
+      expr = (tree) &buf;
+    }
   md5_process_bytes (expr, tree_size (expr), ctx);
   if (CODE_CONTAINS_STRUCT (code, TS_TYPED))
     fold_checksum_tree (TREE_TYPE (expr), ctx, ht);

	Jakub

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

end of thread, other threads:[~2019-03-06 18:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-01  7:54 [PATCH] Fix up --enable-checking=fold (PR middle-end/89503) Jakub Jelinek
2019-03-01  8:49 ` Richard Biener
2019-03-01  9:11   ` Jakub Jelinek
2019-03-01  9:18     ` Richard Biener
2019-03-06 18:00     ` Martin Sebor
2019-03-06 18:38       ` Jakub Jelinek

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).