public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/11059] New: empty union optimization ice
@ 2003-06-02  5:04 jelenz@students.wisc.edu
  2003-06-02  5:10 ` [Bug optimization/11059] [3.3/3.4 regression] " pinskia@physics.uc.edu
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jelenz@students.wisc.edu @ 2003-06-02  5:04 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: empty union optimization ice
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jelenz@students.wisc.edu
                CC: gcc-bugs@gcc.gnu.org

I have narrowed the seg fault down to the small file
union uni {};

int main() {
  uni *h;
  h = (uni *)new uni();
}

When compiling that file with optimizations turned on
gcc -O2 seg.cxx
seg.cxx: In function `int main()':
seg.cxx:5: 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.

The error happens on both gcc 3.3 and 3.2.  Compiling without any optimizations
works fine.  Changing the untion to "union uni { int a; };" does not produce the
error.

I am using gcc from Debian GNU/Linux on i386.

gcc -v
Reading specs from /usr/lib/gcc-lib/i386-linux/3.3/specs
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib
--enable-nls --without-included-gettext --enable-__cxa_atexit
--enable-clocale=gnu --enable-debug --enable-java-gc=boehm
--enable-java-awt=xlib --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.3 (Debian)

gcc-3.2 -v
Reading specs from /usr/lib/gcc-lib/i386-linux/3.2.3/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,objc,ada
--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib
--enable-nls --without-included-gettext --enable-__cxa_atexit
--enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.2.3

John



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug optimization/11059] [3.3/3.4 regression] empty union optimization ice
  2003-06-02  5:04 [Bug optimization/11059] New: empty union optimization ice jelenz@students.wisc.edu
@ 2003-06-02  5:10 ` pinskia@physics.uc.edu
  2003-07-07 18:54 ` cvs-commit at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia@physics.uc.edu @ 2003-06-02  5:10 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia@physics.uc.edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|0000-00-00 00:00:00         |2003-06-02 05:09:59
               date|                            |
            Summary|empty union optimization ice|[3.3/3.4 regression] empty
                   |                            |union optimization ice
   Target Milestone|3.4                         |3.3.1


------- Additional Comments From pinskia@physics.uc.edu  2003-06-02 05:09 -------
It worked on 3.0.4 and 2.95.3 but fails on mainline (20030601), 3.3.1 (20030526) and 
3.2.3.



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug optimization/11059] [3.3/3.4 regression] empty union optimization ice
  2003-06-02  5:04 [Bug optimization/11059] New: empty union optimization ice jelenz@students.wisc.edu
  2003-06-02  5:10 ` [Bug optimization/11059] [3.3/3.4 regression] " pinskia@physics.uc.edu
@ 2003-07-07 18:54 ` cvs-commit at gcc dot gnu dot org
  2003-07-11 14:44 ` [Bug optimization/11059] [3.3 " pinskia at physics dot uc dot edu
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-07-07 18:54 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-07-07 18:54 -------
Subject: Bug 11059

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	sayle@gcc.gnu.org	2003-07-07 18:54:28

Modified files:
	gcc            : ChangeLog expr.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/opt: emptyunion.C 

Log message:
	PR optimization/11059
	* expr.c (can_store_by_pieces): Return true if length is zero.
	(store_by_pieces): If length is zero and endp is two, abort,
	othwerise, if length is zero and endp is not two, return "to".
	(clear_by_pieces): Do nothing if length is zero.
	(clear_storage): Do nothing if length is zero.
	(store_constructor): Simplify code when size is zero, or the
	target has already been cleared.  This avoids emitting a
	blockage instruction when initializing empty structures.
	
	* g++.dg/opt/emptyunion.C: New testcase.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.380&r2=2.381
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/expr.c.diff?cvsroot=gcc&r1=1.565&r2=1.566
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2846&r2=1.2847
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/emptyunion.C.diff?cvsroot=gcc&r1=NONE&r2=1.1


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

* [Bug optimization/11059] [3.3 regression] empty union optimization ice
  2003-06-02  5:04 [Bug optimization/11059] New: empty union optimization ice jelenz@students.wisc.edu
  2003-06-02  5:10 ` [Bug optimization/11059] [3.3/3.4 regression] " pinskia@physics.uc.edu
  2003-07-07 18:54 ` cvs-commit at gcc dot gnu dot org
@ 2003-07-11 14:44 ` pinskia at physics dot uc dot edu
  2003-07-13 21:37 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-11 14:44 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
            Summary|[3.3/3.4 regression] empty  |[3.3 regression] empty union
                   |union optimization ice      |optimization ice


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-11 14:44 -------
This is a regression only in 3.3 now.


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

* [Bug optimization/11059] [3.3 regression] empty union optimization ice
  2003-06-02  5:04 [Bug optimization/11059] New: empty union optimization ice jelenz@students.wisc.edu
                   ` (2 preceding siblings ...)
  2003-07-11 14:44 ` [Bug optimization/11059] [3.3 " pinskia at physics dot uc dot edu
@ 2003-07-13 21:37 ` cvs-commit at gcc dot gnu dot org
  2003-07-13 21:40 ` pinskia at physics dot uc dot edu
  2003-07-16 11:42 ` 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 @ 2003-07-13 21:37 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-07-13 21:37 -------
Subject: Bug 11059

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	sayle@gcc.gnu.org	2003-07-13 21:37:49

Modified files:
	gcc            : ChangeLog expr.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/opt: emptyunion.C 

Log message:
	PR optimization/11059
	* expr.c (can_store_by_pieces): Return true if length is zero.
	(store_by_pieces): Do nothing if length is zero.
	(clear_by_pieces): Do nothing if length is zero.
	(clear_storage): Do nothing if length is zero.
	(store_constructor): Simplify code when size is zero, or the
	target has already been cleared.  This avoids emitting a
	blockage instruction when initializing empty structures.
	
	* g++.dg/opt/emptyunion.C: New testcase.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.653&r2=1.16114.2.654
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/expr.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.498.2.18&r2=1.498.2.19
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.228&r2=1.2261.2.229
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/emptyunion.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.6.1


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

* [Bug optimization/11059] [3.3 regression] empty union optimization ice
  2003-06-02  5:04 [Bug optimization/11059] New: empty union optimization ice jelenz@students.wisc.edu
                   ` (3 preceding siblings ...)
  2003-07-13 21:37 ` cvs-commit at gcc dot gnu dot org
@ 2003-07-13 21:40 ` pinskia at physics dot uc dot edu
  2003-07-16 11:42 ` cvs-commit at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-13 21:40 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

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


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-13 21:40 -------
Fixed by the above patch in 3.3.1 and the mainline.


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

* [Bug optimization/11059] [3.3 regression] empty union optimization ice
  2003-06-02  5:04 [Bug optimization/11059] New: empty union optimization ice jelenz@students.wisc.edu
                   ` (4 preceding siblings ...)
  2003-07-13 21:40 ` pinskia at physics dot uc dot edu
@ 2003-07-16 11:42 ` 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 @ 2003-07-16 11:42 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-07-16 11:42 -------
Subject: Bug 11059

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_2-rhl8-branch
Changes by:	jakub@gcc.gnu.org	2003-07-16 11:42:39

Modified files:
	gcc            : ChangeLog expr.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/opt: emptyunion.C 

Log message:
	2003-07-07  Roger Sayle  <roger@eyesopen.com>
	
	PR optimization/11059
	* expr.c (can_store_by_pieces): Return true if length is zero.
	(store_by_pieces): If length is zero and endp is two, abort,
	othwerise, if length is zero and endp is not two, return "to".
	(clear_by_pieces): Do nothing if length is zero.
	(clear_storage): Do nothing if length is zero.
	(store_constructor): Simplify code when size is zero, or the
	target has already been cleared.  This avoids emitting a
	blockage instruction when initializing empty structures.
	
	2003-07-07  Roger Sayle  <roger@eyesopen.com>
	
	PR optimization/11059
	* g++.dg/opt/emptyunion.C: New testcase.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.13152.2.657.2.27.2.143&r2=1.13152.2.657.2.27.2.144
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/expr.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.423.2.19.4.1.2.16&r2=1.423.2.19.4.1.2.17
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.1672.2.166.2.8.2.57&r2=1.1672.2.166.2.8.2.58
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/emptyunion.C.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=NONE&r2=1.1.8.1


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

end of thread, other threads:[~2003-07-16 11:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-02  5:04 [Bug optimization/11059] New: empty union optimization ice jelenz@students.wisc.edu
2003-06-02  5:10 ` [Bug optimization/11059] [3.3/3.4 regression] " pinskia@physics.uc.edu
2003-07-07 18:54 ` cvs-commit at gcc dot gnu dot org
2003-07-11 14:44 ` [Bug optimization/11059] [3.3 " pinskia at physics dot uc dot edu
2003-07-13 21:37 ` cvs-commit at gcc dot gnu dot org
2003-07-13 21:40 ` pinskia at physics dot uc dot edu
2003-07-16 11:42 ` 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).