public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/97236] [10/11 Regression] g:e93428a8b056aed83a7678 triggers vlc miscompile
Date: Tue, 29 Sep 2020 13:46:26 +0000	[thread overview]
Message-ID: <bug-97236-4-SR9GLcC19P@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-97236-4@http.gcc.gnu.org/bugzilla/>

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
typedef unsigned char __uint8_t;
typedef __uint8_t uint8_t;
typedef struct plane_t {
  uint8_t *p_pixels;
  int i_lines;
  int i_pitch;
} plane_t;

typedef struct {
  plane_t p[5];
} picture_t;

#define N 4

void __attribute__((noipa))
picture_Clone(picture_t *picture, picture_t *res)
{
  for (int i = 0; i < N; i++) {
    res->p[i].p_pixels = picture->p[i].p_pixels;
    res->p[i].i_lines = picture->p[i].i_lines;
    res->p[i].i_pitch = picture->p[i].i_pitch;
  }
}

int
main()
{
  picture_t aaa, bbb;
  uint8_t pixels[10] = {1, 1, 1, 1, 1, 1, 1, 1};

  for (unsigned i = 0; i < N; i++)
    aaa.p[i].p_pixels = pixels;

  picture_Clone (&aaa, &bbb);

  uint8_t c;
  for (unsigned i = 0; i < N; i++)
    c += bbb.p[i].p_pixels[0];

  if (c != N)
    __builtin_abort ();
  return 0;
}

ends up with a NULL pointer in bb.p[1].p_pixels

  parent reply	other threads:[~2020-09-29 13:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-29  7:12 [Bug tree-optimization/97236] New: " rguenth at gcc dot gnu.org
2020-09-29  7:13 ` [Bug tree-optimization/97236] " rguenth at gcc dot gnu.org
2020-09-29 13:05 ` marxin at gcc dot gnu.org
2020-09-29 13:05 ` marxin at gcc dot gnu.org
2020-09-29 13:06 ` marxin at gcc dot gnu.org
2020-09-29 13:46 ` rguenth at gcc dot gnu.org [this message]
2020-09-29 14:14 ` rguenth at gcc dot gnu.org
2020-09-30  9:20 ` rguenth at gcc dot gnu.org
2020-10-01 13:58 ` cvs-commit at gcc dot gnu.org
2020-10-01 13:59 ` [Bug tree-optimization/97236] [10 " rguenth at gcc dot gnu.org
2020-10-06 11:42 ` cvs-commit at gcc dot gnu.org
2020-10-06 12:20 ` rguenth at gcc dot gnu.org
2021-02-03  8:25 ` rguenth at gcc dot gnu.org
2021-02-03  8:26 ` [Bug tree-optimization/97236] [8/9 " rguenth at gcc dot gnu.org
2021-02-05 15:43 ` cvs-commit at gcc dot gnu.org
2021-02-05 15:44 ` ktkachov at gcc dot gnu.org
2021-02-05 15:45 ` [Bug tree-optimization/97236] [8 " ktkachov at gcc dot gnu.org
2021-02-08 10:33 ` cvs-commit at gcc dot gnu.org
2021-02-08 10:43 ` rguenth at gcc dot gnu.org
2021-03-04  8:06 ` marxin at gcc dot gnu.org
2021-04-19  6:31 ` rguenth 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-97236-4-SR9GLcC19P@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).