public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Bogdan Harjoc <harjoc@gmail.com>
Cc: <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Avoid infinite loop with duplicate anonymous union fields
Date: Fri, 27 Jul 2018 17:02:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.20.1807271700570.15481@digraph.polyomino.org.uk> (raw)
In-Reply-To: <CAF4+tmoDjG6qb9bo8CRaszsv7wfRctk6gfNzxTC9WvXFN3zvcg@mail.gmail.com>

On Fri, 27 Jul 2018, Bogdan Harjoc wrote:

> If a struct contains an anonymous union and both have a field with the
> same name, detect_field_duplicates_hash() will replace one of them
> with NULL. If compilation doesn't stop immediately, it may later call
> lookup_field() on the union, which falsely assumes the union's
> LANG_SPECIFIC array is sorted, and may loop indefinitely because of
> this.
> 
> Reproduced on amd64 since gcc-5, on ubuntu-18.04 and gentoo.
> 
> The patch falls back to iterating via DECL_CHAIN if there was an error
> earlier during compilation.

The patch should also add a testcase to the testsuite (which fails before 
and passes after the patch).

> I ran the gcc testsuite with the result (the FAIL seems unrelated to the patch):
> 
> FAIL: gcc.dg/cpp/_Pragma3.c (test for excess errors)

You should use contrib/gcc_update --touch to get timestamps in the right 
order when checking out.  This failure is a symptom of badly ordered 
timestamps.

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2018-07-27 17:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-27 10:27 Bogdan Harjoc
2018-07-27 17:02 ` Joseph Myers [this message]
2018-07-31  9:56   ` Bogdan Harjoc
2018-07-31 17:45     ` Richard Sandiford
2018-07-31 19:43     ` Joseph Myers
2018-07-31 22:03       ` Bogdan Harjoc
2018-07-31 22:20         ` Joseph Myers
2018-08-01 14:26           ` Bogdan Harjoc
2018-08-03 15:26             ` Joseph Myers

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=alpine.DEB.2.20.1807271700570.15481@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=harjoc@gmail.com \
    /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).