public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "amker at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/50608] [4.6/4.7 regression] cannot apply 'offsetof' to a non-constant address
Date: Tue, 12 Jun 2012 03:11:00 -0000	[thread overview]
Message-ID: <bug-50608-4-DC6qBIPeLg@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-50608-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50608

--- Comment #9 from amker at gcc dot gnu.org 2012-06-12 03:11:03 UTC ---
Author: amker
Date: Tue Jun 12 03:10:55 2012
New Revision: 188418

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188418
Log:
    Backport r180986 from mainline
    2011-11-04  Eric Botcazou  <ebotcazou@adacore.com>

    PR c++/50608
    * c-common.c (c_fully_fold_internal) <ADDR_EXPR>: Call fold_offsetof_1.
    (fold_offsetof_1): Make global.  Remove STOP_REF argument and adjust.
    <INDIRECT_REF>: Return the argument.
    <ARRAY_REF>: Remove special code for negative offset.
    Call fold_build_pointer_plus instead of size_binop.
    (fold_offsetof): Remove STOP_REF argument and adjust.
    * c-common.h (fold_offsetof_1): Declare.
    (fold_offsetof): Remove STOP_REF argument.

    PR c++/50608
    * c-parser.c (c_parser_postfix_expression) <RID_OFFSETOF>: Adjust call
    to fold_offsetof.
    * c-typeck.c (build_unary_op) <ADDR_EXPR>: Call fold_offsetof_1.

    * g++.dg/other/offsetof7.C: New test.

    PR c++/50608
    * semantics.c (finish_offsetof): Adjust call to fold_offsetof.
    * typeck.c (cp_build_addr_expr_1): Call fold_offsetof_1.


Added:
    branches/ARM/embedded-4_6-branch/gcc/c-family/ChangeLog.arm
    branches/ARM/embedded-4_6-branch/gcc/cp/ChangeLog.arm
    branches/ARM/embedded-4_6-branch/gcc/testsuite/g++.dg/other/offsetof7.C
Modified:
    branches/ARM/embedded-4_6-branch/gcc/ChangeLog.arm
    branches/ARM/embedded-4_6-branch/gcc/c-family/c-common.c
    branches/ARM/embedded-4_6-branch/gcc/c-family/c-common.h
    branches/ARM/embedded-4_6-branch/gcc/c-parser.c
    branches/ARM/embedded-4_6-branch/gcc/c-typeck.c
    branches/ARM/embedded-4_6-branch/gcc/cp/semantics.c
    branches/ARM/embedded-4_6-branch/gcc/cp/typeck.c
    branches/ARM/embedded-4_6-branch/gcc/testsuite/ChangeLog.arm


      parent reply	other threads:[~2012-06-12  3:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-03 23:41 [Bug c++/50608] New: cannot apply 'offsetof' to a non constant address dberger at oubliette dot org
2011-10-03 23:42 ` [Bug c++/50608] " dberger at oubliette dot org
2011-10-04  9:34 ` [Bug c++/50608] [4.6/4.7 Regression] " paolo.carlini at oracle dot com
2011-10-10 11:29 ` rguenth at gcc dot gnu.org
2011-10-10 15:23 ` rguenth at gcc dot gnu.org
2011-10-11  9:09 ` mikpe at it dot uu.se
2011-10-11  9:49 ` ebotcazou at gcc dot gnu.org
2011-10-26 17:16 ` [Bug c++/50608] [4.6/4.7 regression] cannot apply 'offsetof' to a non-constant address jakub at gcc dot gnu.org
2011-11-04 21:46 ` ebotcazou at gcc dot gnu.org
2011-11-04 21:50 ` ebotcazou at gcc dot gnu.org
2011-11-04 21:53 ` ebotcazou at gcc dot gnu.org
2012-06-12  3:11 ` amker at gcc dot gnu.org [this message]

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-50608-4-DC6qBIPeLg@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).