public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/62030] New: wrong code due to aliasing issue
@ 2014-08-06  5:08 pinskia at gcc dot gnu.org
  2014-08-06  5:29 ` [Bug rtl-optimization/62030] wrong code due to ifcvt merging two stores which have different aliasing sets pinskia at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-08-06  5:08 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 62030
           Summary: wrong code due to aliasing issue
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Keywords: alias, wrong-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
            Blocks: 61964
            Target: mipsisa64-elf

With a slightly modified version of the testcase for PR 61964 (I have an
optimization pass which does the optimization but I can confirm it with an
upstream GCC with the modified source), I get the failure on mipsisa64-elf.
Here is the testcase:
/* { dg-do run } */

extern void abort (void);

struct node { struct node *next, *prev; } node;
struct head { struct node *first; } heads[5];
int k = 2;
struct head *head = &heads[2];

static int __attribute__((noinline))
foo()
{
  node.prev = (void *)head;
  head->first = &node;

  struct node *n = head->first;
  struct head *h = &heads[k];
  struct node *next = n->next;

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

  n->next = h->first;
  return n->next == &node;
}

int main()
{
  if (foo ())
    abort ();
  return 0;
}

Compile with -O2 -march=octeon to see the failure.

CE1 is where the combining of the two stores happen.


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

end of thread, other threads:[~2014-08-18  8:38 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-06  5:08 [Bug rtl-optimization/62030] New: wrong code due to aliasing issue pinskia at gcc dot gnu.org
2014-08-06  5:29 ` [Bug rtl-optimization/62030] wrong code due to ifcvt merging two stores which have different aliasing sets pinskia at gcc dot gnu.org
2014-08-06  6:58 ` vries at gcc dot gnu.org
2014-08-06  7:03 ` pinskia at gcc dot gnu.org
2014-08-06  7:43 ` vries at gcc dot gnu.org
2014-08-06  9:36 ` vries at gcc dot gnu.org
2014-08-08 11:34 ` vries at gcc dot gnu.org
2014-08-08 11:39 ` vries at gcc dot gnu.org
2014-08-14 16:14 ` vries at gcc dot gnu.org
2014-08-14 17:49 ` vries at gcc dot gnu.org
2014-08-15 21:24 ` vries at gcc dot gnu.org
2014-08-16 17:38 ` vries at gcc dot gnu.org
2014-08-18  8:38 ` vries at gcc dot gnu.org

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