public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/30852]  New: [4.1/4.2/4.3 regression] Trouble with __builtin_offsetof and volatile
@ 2007-02-18 23:34 reichelt at gcc dot gnu dot org
  2007-02-18 23:34 ` [Bug c++/30852] " reichelt at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-02-18 23:34 UTC (permalink / raw)
  To: gcc-bugs

The following invalid code snippet triggers an ICE since GCC 4.0.0:

=====================================
struct A
{
  static int i;
};

int j = __builtin_offsetof(volatile A, i);
=====================================

bug.cc:6: internal compiler error: in fold_offsetof_1, at c-common.c:6316
Please submit a full bug report, [etc.]


In addition there are diagnostic issues with a similar testcase:

=====================================
struct A
{
  static void foo();
};

int i = __builtin_offsetof(volatile A, foo[0]);
=====================================

bug.cc:6: error: pointer to a function used in arithmetic
bug.cc:6: error: cannot apply 'offsetof' to member function '#'compound_expr'
not supported by dump_decl#<declaration error>'

Testing a patch.


-- 
           Summary: [4.1/4.2/4.3 regression] Trouble with __builtin_offsetof
                    and volatile
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, diagnostic, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: reichelt at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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


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

* [Bug c++/30852] [4.1/4.2/4.3 regression] Trouble with __builtin_offsetof and volatile
  2007-02-18 23:34 [Bug c++/30852] New: [4.1/4.2/4.3 regression] Trouble with __builtin_offsetof and volatile reichelt at gcc dot gnu dot org
@ 2007-02-18 23:34 ` reichelt at gcc dot gnu dot org
  2007-02-19 21:14 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-02-18 23:34 UTC (permalink / raw)
  To: gcc-bugs



-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.1.3


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


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

* [Bug c++/30852] [4.1/4.2/4.3 regression] Trouble with __builtin_offsetof and volatile
  2007-02-18 23:34 [Bug c++/30852] New: [4.1/4.2/4.3 regression] Trouble with __builtin_offsetof and volatile reichelt at gcc dot gnu dot org
  2007-02-18 23:34 ` [Bug c++/30852] " reichelt at gcc dot gnu dot org
@ 2007-02-19 21:14 ` mmitchel at gcc dot gnu dot org
  2007-03-08  7:32 ` reichelt at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-02-19 21:14 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug c++/30852] [4.1/4.2/4.3 regression] Trouble with __builtin_offsetof and volatile
  2007-02-18 23:34 [Bug c++/30852] New: [4.1/4.2/4.3 regression] Trouble with __builtin_offsetof and volatile reichelt at gcc dot gnu dot org
  2007-02-18 23:34 ` [Bug c++/30852] " reichelt at gcc dot gnu dot org
  2007-02-19 21:14 ` mmitchel at gcc dot gnu dot org
@ 2007-03-08  7:32 ` reichelt at gcc dot gnu dot org
  2007-03-08  7:36 ` reichelt at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-03-08  7:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from reichelt at gcc dot gnu dot org  2007-03-08 07:31 -------
Subject: Bug 30852

Author: reichelt
Date: Thu Mar  8 07:31:47 2007
New Revision: 122686

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122686
Log:
        PR c++/30852
        * c-common.c (fold_offsetof_1): Handle COMPOUND_EXPR.

        * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.

        * g++.dg/ext/offsetof1.C: Add cases with volatile.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-common.c
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/ext/offsetof1.C


-- 


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


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

* [Bug c++/30852] [4.1/4.2/4.3 regression] Trouble with __builtin_offsetof and volatile
  2007-02-18 23:34 [Bug c++/30852] New: [4.1/4.2/4.3 regression] Trouble with __builtin_offsetof and volatile reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-03-08  7:32 ` reichelt at gcc dot gnu dot org
@ 2007-03-08  7:36 ` reichelt at gcc dot gnu dot org
  2007-03-08  7:39 ` reichelt at gcc dot gnu dot org
  2007-03-08  7:49 ` reichelt at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-03-08  7:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from reichelt at gcc dot gnu dot org  2007-03-08 07:36 -------
Subject: Bug 30852

Author: reichelt
Date: Thu Mar  8 07:36:17 2007
New Revision: 122687

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122687
Log:
        PR c++/30852
        * c-common.c (fold_offsetof_1): Handle COMPOUND_EXPR.

        * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.

        * g++.dg/ext/offsetof1.C: Add cases with volatile.

Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/c-common.c
    branches/gcc-4_2-branch/gcc/cp/ChangeLog
    branches/gcc-4_2-branch/gcc/cp/semantics.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_2-branch/gcc/testsuite/g++.dg/ext/offsetof1.C


-- 


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


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

* [Bug c++/30852] [4.1/4.2/4.3 regression] Trouble with __builtin_offsetof and volatile
  2007-02-18 23:34 [Bug c++/30852] New: [4.1/4.2/4.3 regression] Trouble with __builtin_offsetof and volatile reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-03-08  7:36 ` reichelt at gcc dot gnu dot org
@ 2007-03-08  7:39 ` reichelt at gcc dot gnu dot org
  2007-03-08  7:49 ` reichelt at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-03-08  7:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from reichelt at gcc dot gnu dot org  2007-03-08 07:39 -------
Subject: Bug 30852

Author: reichelt
Date: Thu Mar  8 07:39:04 2007
New Revision: 122688

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122688
Log:
        PR c++/30852
        * c-common.c (fold_offsetof_1): Handle COMPOUND_EXPR.

        * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.

        * g++.dg/ext/offsetof1.C: Add cases with volatile.

Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/c-common.c
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/semantics.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/ext/offsetof1.C


-- 


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


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

* [Bug c++/30852] [4.1/4.2/4.3 regression] Trouble with __builtin_offsetof and volatile
  2007-02-18 23:34 [Bug c++/30852] New: [4.1/4.2/4.3 regression] Trouble with __builtin_offsetof and volatile reichelt at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-03-08  7:39 ` reichelt at gcc dot gnu dot org
@ 2007-03-08  7:49 ` reichelt at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-03-08  7:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from reichelt at gcc dot gnu dot org  2007-03-08 07:49 -------
Fixed on mainline, 4.2 branch, and 4.1 branch.


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2007-03-08  7:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-18 23:34 [Bug c++/30852] New: [4.1/4.2/4.3 regression] Trouble with __builtin_offsetof and volatile reichelt at gcc dot gnu dot org
2007-02-18 23:34 ` [Bug c++/30852] " reichelt at gcc dot gnu dot org
2007-02-19 21:14 ` mmitchel at gcc dot gnu dot org
2007-03-08  7:32 ` reichelt at gcc dot gnu dot org
2007-03-08  7:36 ` reichelt at gcc dot gnu dot org
2007-03-08  7:39 ` reichelt at gcc dot gnu dot org
2007-03-08  7:49 ` reichelt at gcc dot gnu dot 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).