public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13302] New: Putting a va_list in a struct causes seg fault
@ 2003-12-04 13:33 stuart dot menefy at st dot com
  2003-12-04 15:13 ` [Bug c++/13302] " bangerth at dealii dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: stuart dot menefy at st dot com @ 2003-12-04 13:33 UTC (permalink / raw)
  To: gcc-bugs

This problem was found when building mozilla. Creating a struct which
contains a va_list element (which is actually a __builtin_va_list) causes
the C++ compiler to seg fault.

The problems is not seen when using the C compiler or compiling for sh3
(only sh4). It is preset in gcc 3.0.3, 3.2.1, 3.3.2 and 3.4 snapshot 20030222.
I suspect it was not present in gcc 2.95, but cannot confirm this.

To reproduce:
% /var/tmp/gcc-3.4-20031126/objdir/gcc/xgcc
-B/var/tmp/gcc-3.4-20031126/objdir/gcc/ -O0 nsTextFormatter.ii -m4 -c
nsTextFormatter.ii:4: 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.

% cat nsTextFormatter.ii
typedef __builtin_va_list __gnuc_va_list;
typedef __gnuc_va_list va_list;

struct NumArgState{
    va_list ap;
};

-- 
           Summary: Putting a va_list in a struct causes seg fault
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: stuart dot menefy at st dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: sh4-linux-gnu


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


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

* [Bug c++/13302] Putting a va_list in a struct causes seg fault
  2003-12-04 13:33 [Bug c++/13302] New: Putting a va_list in a struct causes seg fault stuart dot menefy at st dot com
@ 2003-12-04 15:13 ` bangerth at dealii dot org
  2003-12-04 15:15 ` bangerth at dealii dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: bangerth at dealii dot org @ 2003-12-04 15:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2003-12-04 15:13 -------
*** Bug 13303 has been marked as a duplicate of this bug. ***

-- 


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


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

* [Bug c++/13302] Putting a va_list in a struct causes seg fault
  2003-12-04 13:33 [Bug c++/13302] New: Putting a va_list in a struct causes seg fault stuart dot menefy at st dot com
  2003-12-04 15:13 ` [Bug c++/13302] " bangerth at dealii dot org
@ 2003-12-04 15:15 ` bangerth at dealii dot org
  2003-12-04 16:44 ` [Bug target/13302] " pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: bangerth at dealii dot org @ 2003-12-04 15:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2003-12-04 15:15 -------
I can't reproduce this with a more recent snapshot on x86 linux. 
Can you 
a) use with a recent CVS snapshot? 
b) say something whether this is sh specific, i.e. does it not 
   crash on x86 for you? 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug target/13302] Putting a va_list in a struct causes seg fault
  2003-12-04 13:33 [Bug c++/13302] New: Putting a va_list in a struct causes seg fault stuart dot menefy at st dot com
  2003-12-04 15:13 ` [Bug c++/13302] " bangerth at dealii dot org
  2003-12-04 15:15 ` bangerth at dealii dot org
@ 2003-12-04 16:44 ` pinskia at gcc dot gnu dot org
  2003-12-04 19:20 ` stuart dot menefy at st dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-04 16:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-04 16:44 -------
I cannot reproduce it on powerpc-apple-darwin so it is a target bug, will look into to see if 
I can reproduce it on a cross to sh later today.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |target
           Keywords|                            |ice-on-valid-code


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


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

* [Bug target/13302] Putting a va_list in a struct causes seg fault
  2003-12-04 13:33 [Bug c++/13302] New: Putting a va_list in a struct causes seg fault stuart dot menefy at st dot com
                   ` (2 preceding siblings ...)
  2003-12-04 16:44 ` [Bug target/13302] " pinskia at gcc dot gnu dot org
@ 2003-12-04 19:20 ` stuart dot menefy at st dot com
  2003-12-04 19:45 ` [Bug target/13302] [3.3/3.4 Regression] " pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: stuart dot menefy at st dot com @ 2003-12-04 19:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From stuart dot menefy at st dot com  2003-12-04 19:20 -------
I know next to nothing about the guts of gcc, but sh_build_va_list
(gcc/config/sh/sh.c) calls make_node() whereas the other archs call
*lang_hooks.types.make_type(). Could this be relevant?

-- 


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


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

* [Bug target/13302] [3.3/3.4 Regression] Putting a va_list in a struct causes seg fault
  2003-12-04 13:33 [Bug c++/13302] New: Putting a va_list in a struct causes seg fault stuart dot menefy at st dot com
                   ` (3 preceding siblings ...)
  2003-12-04 19:20 ` stuart dot menefy at st dot com
@ 2003-12-04 19:45 ` pinskia at gcc dot gnu dot org
  2003-12-05 13:57 ` amylaar at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-04 19:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-04 19:45 -------
Yes that would be a problem, so this is definitely a target bug.
The fix to most of the other targets were changed by:
<http://gcc.gnu.org/ml/gcc-patches/2002-03/msg01864.html>
Neil did you forgot some targets when you were doing this change?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |neil at daikokuya dot demon
                   |                            |dot co dot uk
             Status|WAITING                     |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-12-04 19:45:43
               date|                            |
            Summary|Putting a va_list in a      |[3.3/3.4 Regression] Putting
                   |struct causes seg fault     |a va_list in a struct causes
                   |                            |seg fault
   Target Milestone|---                         |3.3.3


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


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

* [Bug target/13302] [3.3/3.4 Regression] Putting a va_list in a struct causes seg fault
  2003-12-04 13:33 [Bug c++/13302] New: Putting a va_list in a struct causes seg fault stuart dot menefy at st dot com
                   ` (4 preceding siblings ...)
  2003-12-04 19:45 ` [Bug target/13302] [3.3/3.4 Regression] " pinskia at gcc dot gnu dot org
@ 2003-12-05 13:57 ` amylaar at gcc dot gnu dot org
  2003-12-05 15:48 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2003-12-05 13:57 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2003-12-04 19:45:43         |2003-12-05 13:57:40
               date|                            |


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


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

* [Bug target/13302] [3.3/3.4 Regression] Putting a va_list in a struct causes seg fault
  2003-12-04 13:33 [Bug c++/13302] New: Putting a va_list in a struct causes seg fault stuart dot menefy at st dot com
                   ` (5 preceding siblings ...)
  2003-12-05 13:57 ` amylaar at gcc dot gnu dot org
@ 2003-12-05 15:48 ` cvs-commit at gcc dot gnu dot org
  2003-12-05 15:56 ` cvs-commit at gcc dot gnu dot org
  2003-12-05 15:58 ` amylaar at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-12-05 15:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-12-05 15:48 -------
Subject: Bug 13302

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	amylaar@gcc.gnu.org	2003-12-05 15:48:37

Modified files:
	gcc            : ChangeLog 
	gcc/config/sh  : sh.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/other: struct-va_list.C 

Log message:
	2003-12-05  Stuart Menefy <stuart.menefy@st.com>
	J"orn Rennecke <joern.rennecke@superh.com>
	
	PR target/13302
	gcc:
	* sh.c (sh_build_builtin_va_list): Use (*lang_hooks.types.make_type).
	testsuite:
	* g++.dg/other/struct-va_list.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.1929&r2=2.1930
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sh/sh.c.diff?cvsroot=gcc&r1=1.240&r2=1.241
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3231&r2=1.3232
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/other/struct-va_list.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug target/13302] [3.3/3.4 Regression] Putting a va_list in a struct causes seg fault
  2003-12-04 13:33 [Bug c++/13302] New: Putting a va_list in a struct causes seg fault stuart dot menefy at st dot com
                   ` (6 preceding siblings ...)
  2003-12-05 15:48 ` cvs-commit at gcc dot gnu dot org
@ 2003-12-05 15:56 ` cvs-commit at gcc dot gnu dot org
  2003-12-05 15:58 ` amylaar at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-12-05 15:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-12-05 15:56 -------
Subject: Bug 13302

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	amylaar@gcc.gnu.org	2003-12-05 15:56:37

Modified files:
	gcc            : ChangeLog 
	gcc/config/sh  : sh.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/other: struct-va_list.C 

Log message:
	2003-12-05  Stuart Menefy <stuart.menefy@st.com>
	J"orn Rennecke <joern.rennecke@superh.com>
	
	PR target/13302
	gcc:
	* sh.c (sh_build_builtin_va_list): Use (*lang_hooks.types.make_type).
	testsuite:
	* g++.dg/other/struct-va_list.C: New test.

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.827&r2=1.16114.2.828
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sh/sh.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.188.2.6&r2=1.188.2.7
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.323&r2=1.2261.2.324
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/other/struct-va_list.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1



-- 


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


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

* [Bug target/13302] [3.3/3.4 Regression] Putting a va_list in a struct causes seg fault
  2003-12-04 13:33 [Bug c++/13302] New: Putting a va_list in a struct causes seg fault stuart dot menefy at st dot com
                   ` (7 preceding siblings ...)
  2003-12-05 15:56 ` cvs-commit at gcc dot gnu dot org
@ 2003-12-05 15:58 ` amylaar at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2003-12-05 15:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From amylaar at gcc dot gnu dot org  2003-12-05 15:58 -------
Applied patch to mainline and to 3.3 branch.

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


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


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

end of thread, other threads:[~2003-12-05 15:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-04 13:33 [Bug c++/13302] New: Putting a va_list in a struct causes seg fault stuart dot menefy at st dot com
2003-12-04 15:13 ` [Bug c++/13302] " bangerth at dealii dot org
2003-12-04 15:15 ` bangerth at dealii dot org
2003-12-04 16:44 ` [Bug target/13302] " pinskia at gcc dot gnu dot org
2003-12-04 19:20 ` stuart dot menefy at st dot com
2003-12-04 19:45 ` [Bug target/13302] [3.3/3.4 Regression] " pinskia at gcc dot gnu dot org
2003-12-05 13:57 ` amylaar at gcc dot gnu dot org
2003-12-05 15:48 ` cvs-commit at gcc dot gnu dot org
2003-12-05 15:56 ` cvs-commit at gcc dot gnu dot org
2003-12-05 15:58 ` amylaar 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).