public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/61964] [4.8/4.9/4.10 regression] krb5 database propagation enters infinite loop; reduced test case
Date: Thu, 31 Jul 2014 12:20:00 -0000	[thread overview]
Message-ID: <bug-61964-4-HA9awTueay@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61964-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61964

vries at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vries at gcc dot gnu.org

--- Comment #8 from vries at gcc dot gnu.org ---
Using this patch on the example from the description field, I can modify the
example on the command line:
...
$ diff -u bug-orig.c bug-mod.c 
--- bug-orig.c    2014-07-31 14:00:50.663275717 +0200
+++ bug-mod.c    2014-07-31 14:01:49.403276412 +0200
@@ -11,7 +11,7 @@
   struct node *n = head->first;
   struct head *h = &heads[k];

-  if (n->prev == (void *)h)
+  if (FORCE n->prev == (void *)h)
     h->first = n->next;
   else
     n->prev->next = n->next;
...

1. -DFORCE="" gives the original
2. -DFORCE="1 ||" forces the condition to true
3. -DFORCE="0 &&" forces the confition to false

In this experiment, we don't use tree-tail-merge:
...
$ gcc -DFORCE="1 ||" bug-mod.c -O2 -fno-strict-aliasing -fno-tree-tail-merge &&
./a.out ; echo $?
0
$ gcc -DFORCE="1 ||" bug-mod.c -O2 -fstrict-aliasing -fno-tree-tail-merge &&
./a.out ; echo $?
0
$ gcc -DFORCE="0 &&" bug-mod.c -O2 -fno-strict-aliasing -fno-tree-tail-merge &&
./a.out ; echo $?
0
$ gcc -DFORCE="0 &&" bug-mod.c -O2 -fstrict-aliasing -fno-tree-tail-merge &&
./a.out ; echo $?
1
...

The last result seems to suggest that the example is not type-safe.

My understanding is that the problem is in the line:
  n->prev->next = n->next;
where we effectively do:
  /* ((struct node*)&heads[2])->next = node.next */
which is type-unsafe.


  parent reply	other threads:[~2014-07-31 12:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30 13:21 [Bug tree-optimization/61964] New: [4.8 " andersk at mit dot edu
2014-07-30 14:31 ` [Bug tree-optimization/61964] " ghudson at mit dot edu
2014-07-30 20:21 ` andersk at mit dot edu
2014-07-31  4:20 ` andersk at mit dot edu
2014-07-31  9:29 ` mikpelinux at gmail dot com
2014-07-31  9:48 ` schwab@linux-m68k.org
2014-07-31 10:05 ` [Bug tree-optimization/61964] [4.8/4.9/4.10 " rguenth at gcc dot gnu.org
2014-07-31 12:20 ` vries at gcc dot gnu.org [this message]
2014-07-31 12:24 ` rguenther at suse dot de
2014-07-31 14:07 ` rguenth at gcc dot gnu.org
2014-07-31 14:10 ` [Bug tree-optimization/61964] [4.8/4.9 " rguenth at gcc dot gnu.org
2014-07-31 17:09 ` vries at gcc dot gnu.org
2014-08-01  7:32 ` rguenth at gcc dot gnu.org
2014-08-01  7:36 ` rguenth at gcc dot gnu.org
2014-08-01  7:40 ` rguenth at gcc dot gnu.org
2014-08-01  8:17 ` rguenth at gcc dot gnu.org
2014-08-01  8:18 ` andersk at mit dot edu
2014-08-04  0:25 ` vries at gcc dot gnu.org
2014-08-18  8:38 ` vries at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-61964-4-HA9awTueay@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).