public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/23180] New: Segfault on const initializer with bogus pointer arithmetics
@ 2005-08-01 14:22 falk at debian dot org
  2005-08-01 14:36 ` [Bug c++/23180] [4.1 regression] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: falk at debian dot org @ 2005-08-01 14:22 UTC (permalink / raw)
  To: gcc-bugs

falk@juist:/tmp% cat bug.cc   
void saveLoadEntries(const void *);
void saveOrLoad() {
    struct Track {
        char soundName[15];
    };
    struct SaveLoadEntry {
        int offs;
        int type;
        int size;
    };    
    const SaveLoadEntry trackEntries = {
        ((long) (&((Track *) 42)->soundName[0])) - 42,
        0, 1
    };
    saveLoadEntries(&trackEntries);
}

falk@juist:/tmp% g++ -c bug.cc
bug.cc:15: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

In case anyone wonders, this comes from:
// * To work around a warning in GCC 3.2 (and 3.1 ?) regarding non-POD types[...]
#define OFFS(type,item) (((long)(&((type*)42)->type::item))-42)

This is of course invalid, but it'd be nice if it did what those folks wanted.

-- 
           Summary: Segfault on const initializer with bogus pointer
                    arithmetics
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: falk at debian dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: alphaev68-unknown-linux-gnu
  GCC host triplet: alphaev68-unknown-linux-gnu
GCC target triplet: alphaev68-unknown-linux-gnu


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


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

* [Bug c++/23180] [4.1 regression] Segfault on const initializer with bogus pointer arithmetics
  2005-08-01 14:22 [Bug c++/23180] New: Segfault on const initializer with bogus pointer arithmetics falk at debian dot org
  2005-08-01 14:36 ` [Bug c++/23180] [4.1 regression] " pinskia at gcc dot gnu dot org
@ 2005-08-01 14:36 ` pinskia at gcc dot gnu dot org
  2005-09-09  1:38 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-01 14:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-01 14:35 -------
Confirmed, a regression from 4.0.0.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
  GCC build triplet|alphaev68-unknown-linux-gnu |
   GCC host triplet|alphaev68-unknown-linux-gnu |
 GCC target triplet|alphaev68-unknown-linux-gnu |
   Last reconfirmed|0000-00-00 00:00:00         |2005-08-01 14:35:51
               date|                            |
            Summary|Segfault on const           |[4.1 regression] Segfault on
                   |initializer with bogus      |const initializer with bogus
                   |pointer arithmetics         |pointer arithmetics
   Target Milestone|---                         |4.1.0


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


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

* [Bug c++/23180] [4.1 regression] Segfault on const initializer with bogus pointer arithmetics
  2005-08-01 14:22 [Bug c++/23180] New: Segfault on const initializer with bogus pointer arithmetics falk at debian dot org
@ 2005-08-01 14:36 ` pinskia at gcc dot gnu dot org
  2005-08-01 14:36 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-01 14:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-01 14:36 -------
Here is the backtrace:
#1  0x08423014 in expand_binop (mode=SImode, binoptab=0xb7cb4600, op0=0xb7cac360, 
op1=0xb7cac0c0, target=0x0, unsignedp=1, 
    methods=OPTAB_LIB_WIDEN) at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/optabs.c:1028
#2  0x082f9625 in expand_expr_addr_expr_1 (exp=Variable "exp" is not available.
) at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/expr.c:6310
#3  0x082ec524 in expand_expr_real_1 (exp=0xb7d2b4c0, target=0x0, tmode=SImode, 
modifier=Variable "modifier" is not available.
)
    at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/expr.c:6349
#4  0x082f5cbe in expand_expr_real (exp=0xb7d2b4c0, target=0x0, tmode=VOIDmode, 
modifier=EXPAND_INITIALIZER, alt_rtl=0x0)
    at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/expr.c:6462
#5  0x084b6180 in output_constant (exp=0xb7d2b4c0, size=4, align=32) at expr.h:492
#6  0x084b5308 in output_constructor (exp=0xb7d4f900, size=12, align=32)


-- 


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


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

* [Bug c++/23180] [4.1 regression] Segfault on const initializer with bogus pointer arithmetics
  2005-08-01 14:22 [Bug c++/23180] New: Segfault on const initializer with bogus pointer arithmetics falk at debian dot org
  2005-08-01 14:36 ` [Bug c++/23180] [4.1 regression] " pinskia at gcc dot gnu dot org
  2005-08-01 14:36 ` pinskia at gcc dot gnu dot org
@ 2005-09-09  1:38 ` cvs-commit at gcc dot gnu dot org
  2005-09-09  1:39 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-09-09  1:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-09-09 01:37 -------
Subject: Bug 23180

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jconner@gcc.gnu.org	2005-09-09 01:37:31

Modified files:
	gcc            : ChangeLog expr.c 

Log message:
	PR c++/23180
	* expr.c (expand_expr_addr_expr_1): Don't invoke
	expand_simple_binop for EXPAND_INITIALIZER.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9921&r2=2.9922
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/expr.c.diff?cvsroot=gcc&r1=1.815&r2=1.816



-- 


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


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

* [Bug c++/23180] [4.1 regression] Segfault on const initializer with bogus pointer arithmetics
  2005-08-01 14:22 [Bug c++/23180] New: Segfault on const initializer with bogus pointer arithmetics falk at debian dot org
                   ` (2 preceding siblings ...)
  2005-09-09  1:38 ` cvs-commit at gcc dot gnu dot org
@ 2005-09-09  1:39 ` cvs-commit at gcc dot gnu dot org
  2005-09-09  3:13 ` pinskia at gcc dot gnu dot org
  2005-09-14  0:25 ` cvs-commit at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-09-09  1:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-09-09 01:39 -------
Subject: Bug 23180

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jconner@gcc.gnu.org	2005-09-09 01:39:36

Modified files:
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/init: pr23180-1.C pr23180-2.C 

Log message:
	PR c++/23180
	* g++.dg/init/pr23180-1.C: New test.
	* g++.dg/init/pr23180-2.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.6034&r2=1.6035
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/pr23180-1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/pr23180-2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug c++/23180] [4.1 regression] Segfault on const initializer with bogus pointer arithmetics
  2005-08-01 14:22 [Bug c++/23180] New: Segfault on const initializer with bogus pointer arithmetics falk at debian dot org
                   ` (3 preceding siblings ...)
  2005-09-09  1:39 ` cvs-commit at gcc dot gnu dot org
@ 2005-09-09  3:13 ` pinskia at gcc dot gnu dot org
  2005-09-14  0:25 ` cvs-commit at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-09  3:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-09 03:13 -------
Fixed.

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


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


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

* [Bug c++/23180] [4.1 regression] Segfault on const initializer with bogus pointer arithmetics
  2005-08-01 14:22 [Bug c++/23180] New: Segfault on const initializer with bogus pointer arithmetics falk at debian dot org
                   ` (4 preceding siblings ...)
  2005-09-09  3:13 ` pinskia at gcc dot gnu dot org
@ 2005-09-14  0:25 ` cvs-commit at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-09-14  0:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-09-14 00:25 -------
Subject: Bug 23180

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jconner@gcc.gnu.org	2005-09-14 00:25:02

Modified files:
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/init: struct2.C struct3.C 

Log message:
	PR c++/23180
	* g++.dg/init/struct2.C: New test.
	* g++.dg/init/struct3.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.6061&r2=1.6062
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/struct2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/struct3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

end of thread, other threads:[~2005-09-14  0:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-01 14:22 [Bug c++/23180] New: Segfault on const initializer with bogus pointer arithmetics falk at debian dot org
2005-08-01 14:36 ` [Bug c++/23180] [4.1 regression] " pinskia at gcc dot gnu dot org
2005-08-01 14:36 ` pinskia at gcc dot gnu dot org
2005-09-09  1:38 ` cvs-commit at gcc dot gnu dot org
2005-09-09  1:39 ` cvs-commit at gcc dot gnu dot org
2005-09-09  3:13 ` pinskia at gcc dot gnu dot org
2005-09-14  0:25 ` cvs-commit 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).