* [committed] Fix fold_checking after Kenner added more tree checking
@ 2004-06-14 0:42 Andrew Pinski
0 siblings, 0 replies; only message in thread
From: Andrew Pinski @ 2004-06-14 0:42 UTC (permalink / raw)
To: gcc-patches
Serge Belyshev reported this in IRC and I figured out what was
going wrong. When Kenner added some more tree-checking he
had forgot to test with fold-checking also turned on to
see if he had to change anything there. This patch
fixes the two problems which was reported so far,
I have not checked to see if there was any other problems
yet.
I committed this as obvious to get fold-checking further.
Thanks,
Andrew Pinski
ChangeLog:
* fold-const.c (fold_checksum_tree <case 't'>): Only
look at TREE_VALUES if the EXPR is an ENUMERAL_TYPE.
Only look at TYPE_MIN_VALUE and TYPE_MAX_VALUE if
EXPR is an INTEGERAL_TYPE or a scalar float type.
Patch:
Index: fold-const.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v
retrieving revision 1.394
diff -u -p -r1.394 fold-const.c
--- fold-const.c 12 Jun 2004 19:41:49 -0000 1.394
+++ fold-const.c 13 Jun 2004 22:08:22 -0000
@@ -8731,13 +8731,18 @@ fold_checksum_tree (tree expr, struct md
fold_checksum_tree (DECL_VINDEX (expr), ctx, ht);
break;
case 't':
- fold_checksum_tree (TYPE_VALUES (expr), ctx, ht);
+ if (TREE_CODE (expr) == ENUMERAL_TYPE)
+ fold_checksum_tree (TYPE_VALUES (expr), ctx, ht);
fold_checksum_tree (TYPE_SIZE (expr), ctx, ht);
fold_checksum_tree (TYPE_SIZE_UNIT (expr), ctx, ht);
fold_checksum_tree (TYPE_ATTRIBUTES (expr), ctx, ht);
fold_checksum_tree (TYPE_NAME (expr), ctx, ht);
- fold_checksum_tree (TYPE_MIN_VALUE (expr), ctx, ht);
- fold_checksum_tree (TYPE_MAX_VALUE (expr), ctx, ht);
+ if (INTEGRAL_TYPE_P (expr)
+ || SCALAR_FLOAT_TYPE_P (expr))
+ {
+ fold_checksum_tree (TYPE_MIN_VALUE (expr), ctx, ht);
+ fold_checksum_tree (TYPE_MAX_VALUE (expr), ctx, ht);
+ }
fold_checksum_tree (TYPE_MAIN_VARIANT (expr), ctx, ht);
fold_checksum_tree (TYPE_BINFO (expr), ctx, ht);
fold_checksum_tree (TYPE_CONTEXT (expr), ctx, ht);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-06-13 22:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-14 0:42 [committed] Fix fold_checking after Kenner added more tree checking Andrew Pinski
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).