* [PATCH] Fix --enable-checking=fold bootstrap (PR bootstrap/71071)
@ 2016-05-13 17:22 Jakub Jelinek
2016-05-13 19:54 ` Richard Biener
0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2016-05-13 17:22 UTC (permalink / raw)
To: Richard Biener; +Cc: gcc-patches
Hi!
Since a recent change, TYPE_ALIAS_SET of types can change during folding.
This patch arranges for it not to be checksummed.
Bootstrapped/regtested on x86_64-linux and i686-linux (normal bootstrap)
and built (nonbootstrap) + regtested the
--enable-checking=yes,extra,fold,rtl version (previously it wouldn't build
even libgcc).
Ok for trunk?
2016-05-13 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/71071
* fold-const.c (fold_checksum_tree): Allow modification
of TYPE_ALIAS_SET during folding.
* gcc.dg/pr71071.c: New test.
--- gcc/fold-const.c.jj 2016-05-13 13:58:12.381020172 +0200
+++ gcc/fold-const.c 2016-05-13 14:22:51.724912335 +0200
@@ -12130,7 +12130,8 @@ fold_checksum_tree (const_tree expr, str
|| TYPE_REFERENCE_TO (expr)
|| TYPE_CACHED_VALUES_P (expr)
|| TYPE_CONTAINS_PLACEHOLDER_INTERNAL (expr)
- || TYPE_NEXT_VARIANT (expr)))
+ || TYPE_NEXT_VARIANT (expr)
+ || TYPE_ALIAS_SET_KNOWN_P (expr)))
{
/* Allow these fields to be modified. */
tree tmp;
@@ -12140,6 +12141,7 @@ fold_checksum_tree (const_tree expr, str
TYPE_POINTER_TO (tmp) = NULL;
TYPE_REFERENCE_TO (tmp) = NULL;
TYPE_NEXT_VARIANT (tmp) = NULL;
+ TYPE_ALIAS_SET (tmp) = -1;
if (TYPE_CACHED_VALUES_P (tmp))
{
TYPE_CACHED_VALUES_P (tmp) = 0;
--- gcc/testsuite/gcc.dg/pr71071.c.jj 2016-05-13 14:23:39.528278177 +0200
+++ gcc/testsuite/gcc.dg/pr71071.c 2016-05-13 14:22:08.000000000 +0200
@@ -0,0 +1,12 @@
+/* PR bootstrap/71071 */
+/* { dg-do compile } *
+/* { dg-options "-O2" } */
+
+struct S { unsigned b : 1; } a;
+
+void
+foo ()
+{
+ if (a.b)
+ ;
+}
Jakub
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix --enable-checking=fold bootstrap (PR bootstrap/71071)
2016-05-13 17:22 [PATCH] Fix --enable-checking=fold bootstrap (PR bootstrap/71071) Jakub Jelinek
@ 2016-05-13 19:54 ` Richard Biener
0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2016-05-13 19:54 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: gcc-patches
On May 13, 2016 7:22:37 PM GMT+02:00, Jakub Jelinek <jakub@redhat.com> wrote:
>Hi!
>
>Since a recent change, TYPE_ALIAS_SET of types can change during
>folding.
>This patch arranges for it not to be checksummed.
>
>Bootstrapped/regtested on x86_64-linux and i686-linux (normal
>bootstrap)
>and built (nonbootstrap) + regtested the
>--enable-checking=yes,extra,fold,rtl version (previously it wouldn't
>build
>even libgcc).
>
>Ok for trunk?
OK.
Richard.
>2016-05-13 Jakub Jelinek <jakub@redhat.com>
>
> PR bootstrap/71071
> * fold-const.c (fold_checksum_tree): Allow modification
> of TYPE_ALIAS_SET during folding.
>
> * gcc.dg/pr71071.c: New test.
>
>--- gcc/fold-const.c.jj 2016-05-13 13:58:12.381020172 +0200
>+++ gcc/fold-const.c 2016-05-13 14:22:51.724912335 +0200
>@@ -12130,7 +12130,8 @@ fold_checksum_tree (const_tree expr, str
> || TYPE_REFERENCE_TO (expr)
> || TYPE_CACHED_VALUES_P (expr)
> || TYPE_CONTAINS_PLACEHOLDER_INTERNAL (expr)
>- || TYPE_NEXT_VARIANT (expr)))
>+ || TYPE_NEXT_VARIANT (expr)
>+ || TYPE_ALIAS_SET_KNOWN_P (expr)))
> {
> /* Allow these fields to be modified. */
> tree tmp;
>@@ -12140,6 +12141,7 @@ fold_checksum_tree (const_tree expr, str
> TYPE_POINTER_TO (tmp) = NULL;
> TYPE_REFERENCE_TO (tmp) = NULL;
> TYPE_NEXT_VARIANT (tmp) = NULL;
>+ TYPE_ALIAS_SET (tmp) = -1;
> if (TYPE_CACHED_VALUES_P (tmp))
> {
> TYPE_CACHED_VALUES_P (tmp) = 0;
>--- gcc/testsuite/gcc.dg/pr71071.c.jj 2016-05-13 14:23:39.528278177
>+0200
>+++ gcc/testsuite/gcc.dg/pr71071.c 2016-05-13 14:22:08.000000000 +0200
>@@ -0,0 +1,12 @@
>+/* PR bootstrap/71071 */
>+/* { dg-do compile } *
>+/* { dg-options "-O2" } */
>+
>+struct S { unsigned b : 1; } a;
>+
>+void
>+foo ()
>+{
>+ if (a.b)
>+ ;
>+}
>
> Jakub
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-13 19:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-13 17:22 [PATCH] Fix --enable-checking=fold bootstrap (PR bootstrap/71071) Jakub Jelinek
2016-05-13 19:54 ` Richard Biener
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).