public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/23125] New: OpenBSD's zic.c causes g++ but not gcc to segfault
@ 2005-07-29 3:25 flash at pobox dot com
2005-07-29 3:50 ` [Bug c++/23125] " flash at pobox dot com
` (11 more replies)
0 siblings, 12 replies; 14+ messages in thread
From: flash at pobox dot com @ 2005-07-29 3:25 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 4313 bytes --]
The OpenBSD file zic.c causes g++ 4.0.1 to segfault, though plain gcc 4.0.1 does not. The plainest
way to reproduce this is to get the OpenBSD version from
<http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/lib/libc/time/zic.c?rev=1.24&content-
type=text/plain>, but I'll attach a Delta-reduced version of our modified copy. g++ 3.3.4 rejects it
without crashing, but with "confused by earlier errors, bailing out," so this is presumably invalid code,
though it seems to be a popular file. (Perhaps I should add OpenBSD to section I of my article :-)
I'm not sure if this is the same as my two other segfault bugs: Running the --enable-checking
version under GDB fails to catch the segfault, so I couldn't get a stacktrace. (I'm trying to build an --
enable-checking=all version, but it's taken more than twenty-four hours so far.)
Session:
74> /opt/gcc401chk/bin/g++ -v ../cpp/bugfiles/GCC_bugfiles/error/105198_zic_min.c
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --enable-checking --prefix=/opt/gcc401chk --enable-languages=c,c+
+
Thread model: posix
gcc version 4.0.1
/opt/gcc401chk/libexec/gcc/i686-pc-linux-gnu/4.0.1/cc1plus -quiet -v -D_GNU_SOURCE ../cpp/
bugfiles/GCC_bugfiles/error/105198_zic_min.c -quiet -dumpbase 105198_zic_min.c -
mtune=pentiumpro -auxbase 105198_zic_min -version -o /tmp/ccGy60bj.s
ignoring nonexistent directory "/opt/gcc401chk/lib/gcc/i686-pc-linux-gnu/4.0.1/../../../../i686-pc-
linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/opt/gcc401chk/lib/gcc/i686-pc-linux-gnu/4.0.1/../../../../include/c++/4.0.1
/opt/gcc401chk/lib/gcc/i686-pc-linux-gnu/4.0.1/../../../../include/c++/4.0.1/i686-pc-linux-gnu
/opt/gcc401chk/lib/gcc/i686-pc-linux-gnu/4.0.1/../../../../include/c++/4.0.1/backward
/usr/local/include
/opt/gcc401chk/include
/opt/gcc401chk/lib/gcc/i686-pc-linux-gnu/4.0.1/include
/usr/include
End of search list.
GNU C++ version 4.0.1 (i686-pc-linux-gnu)
compiled by GNU C version 3.3.4 (pre 3.3.5 20040809).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
../cpp/bugfiles/GCC_bugfiles/error/105198_zic_min.c:1: error: expected unqualified-id before {
token
../cpp/bugfiles/GCC_bugfiles/error/105198_zic_min.c:31: error: expected unqualified-id before {
token
../cpp/bugfiles/GCC_bugfiles/error/105198_zic_min.c:36: error: expected unqualified-id before {
token
../cpp/bugfiles/GCC_bugfiles/error/105198_zic_min.c:37: 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.
Delta-reduced file:
{
if (sscanf(cp, scheck(cp, "%d"), &year) != 1) {
}
while (j != year) {
if (year > j) {
}
}
while (j != month) {
}
{
if (strcmp(cp, "") == 0) { /* infile() turns "-" into "" */
}
}
for (i = 0; i < zonecount; ++i) {
if (zp->z_nrules == 0) {
if (usestart) {
if (useuntil) {
if (k < 0 || jtime < ktime) {
}
}
if (usestart) {
if (ktime < starttime) {
}
}
}
}
if (usestart) {
}
}
}
{
(timecnt == 1 && attypes[0].at < min_time)) {
}
}
int a;
{
}
register const char * bp;
PalmSource bug 105198.
--
Summary: OpenBSD's zic.c causes g++ but not gcc to segfault
Product: gcc
Version: 4.0.1
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: flash at pobox 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: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23125
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/23125] OpenBSD's zic.c causes g++ but not gcc to segfault
2005-07-29 3:25 [Bug c++/23125] New: OpenBSD's zic.c causes g++ but not gcc to segfault flash at pobox dot com
@ 2005-07-29 3:50 ` flash at pobox dot com
2005-07-29 5:04 ` flash at pobox dot com
` (10 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: flash at pobox dot com @ 2005-07-29 3:50 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From flash at pobox dot com 2005-07-29 03:25 -------
Created an attachment (id=9384)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9384&action=view)
Delta-reduced version of zic.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23125
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/23125] OpenBSD's zic.c causes g++ but not gcc to segfault
2005-07-29 3:25 [Bug c++/23125] New: OpenBSD's zic.c causes g++ but not gcc to segfault flash at pobox dot com
2005-07-29 3:50 ` [Bug c++/23125] " flash at pobox dot com
@ 2005-07-29 5:04 ` flash at pobox dot com
2005-07-29 5:35 ` [Bug c++/23125] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: flash at pobox dot com @ 2005-07-29 5:04 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From flash at pobox dot com 2005-07-29 04:34 -------
Error message from an --enable-checking=all build:
/Projects/PlatformTools/compilerChain/tests/cpp/bugfiles/GCC_bugfiles/error
/105198_zic_min.c:37: internal compiler error: RTL check: expected elt 0 type
'e' or 'u', have 'i' (rtx reg) in assemble_variable, at varasm.c:1588
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23125
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/23125] [4.0/4.1 Regression] OpenBSD's zic.c causes g++ but not gcc to segfault
2005-07-29 3:25 [Bug c++/23125] New: OpenBSD's zic.c causes g++ but not gcc to segfault flash at pobox dot com
2005-07-29 3:50 ` [Bug c++/23125] " flash at pobox dot com
2005-07-29 5:04 ` flash at pobox dot com
@ 2005-07-29 5:35 ` pinskia at gcc dot gnu dot org
2005-09-10 3:29 ` pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-29 5:35 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-29 05:32 -------
Reduced testcase:
int a;
register const char * bp;
---- end ----
At least for 4.0.0 and above.
I think there might be a couple different bugs here but I don't know for sure.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |error-recovery, ice-on-
| |invalid-code
Last reconfirmed|0000-00-00 00:00:00 |2005-07-29 05:32:04
date| |
Summary|OpenBSD's zic.c causes g++ |[4.0/4.1 Regression]
|but not gcc to segfault |OpenBSD's zic.c causes g++
| |but not gcc to segfault
Target Milestone|--- |4.0.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23125
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/23125] [4.0/4.1 Regression] OpenBSD's zic.c causes g++ but not gcc to segfault
2005-07-29 3:25 [Bug c++/23125] New: OpenBSD's zic.c causes g++ but not gcc to segfault flash at pobox dot com
` (2 preceding siblings ...)
2005-07-29 5:35 ` [Bug c++/23125] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-09-10 3:29 ` pinskia at gcc dot gnu dot org
2005-09-10 3:30 ` [Bug middle-end/23125] " pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-10 3:29 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-10 03:29 -------
(In reply to comment #3)
> I think there might be a couple different bugs here but I don't know for sure.
And I think I know who caused it. Me as bp is no longer a real variable but one declared as a register.
I will take a look at this soon.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Severity|minor |normal
Keywords|error-recovery |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23125
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/23125] [4.0/4.1 Regression] OpenBSD's zic.c causes g++ but not gcc to segfault
2005-07-29 3:25 [Bug c++/23125] New: OpenBSD's zic.c causes g++ but not gcc to segfault flash at pobox dot com
` (3 preceding siblings ...)
2005-09-10 3:29 ` pinskia at gcc dot gnu dot org
@ 2005-09-10 3:30 ` pinskia at gcc dot gnu dot org
2005-09-10 4:41 ` pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-10 3:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-10 03:30 -------
This is a middle-end problem too and actually causes it be accepted in C also.
--
What |Removed |Added
----------------------------------------------------------------------------
Component|c++ |middle-end
GCC build triplet|i686-pc-linux-gnu |
GCC host triplet|i686-pc-linux-gnu |
Keywords| |accepts-invalid
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23125
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/23125] [4.0/4.1 Regression] OpenBSD's zic.c causes g++ but not gcc to segfault
2005-07-29 3:25 [Bug c++/23125] New: OpenBSD's zic.c causes g++ but not gcc to segfault flash at pobox dot com
` (4 preceding siblings ...)
2005-09-10 3:30 ` [Bug middle-end/23125] " pinskia at gcc dot gnu dot org
@ 2005-09-10 4:41 ` pinskia at gcc dot gnu dot org
2005-09-10 4:56 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-10 4:41 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-10 04:41 -------
Testcase for all targets I can find:
/* { dg-options "" } */
/* { dg-do compile } */
register int r0; /* { dg-error "register name not specified" } */
register int bp; /* { dg-error "register name not specified" } */
register int sp; /* { dg-error "register name not specified" } */
register int r30; /* { dg-error "register name not specified" } */
register int toc; /* { dg-error "register name not specified" } */
register int d0; /* { dg-error "register name not specified" } */
register int a0; /* { dg-error "register name not specified" } */
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23125
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/23125] [4.0/4.1 Regression] OpenBSD's zic.c causes g++ but not gcc to segfault
2005-07-29 3:25 [Bug c++/23125] New: OpenBSD's zic.c causes g++ but not gcc to segfault flash at pobox dot com
` (5 preceding siblings ...)
2005-09-10 4:41 ` pinskia at gcc dot gnu dot org
@ 2005-09-10 4:56 ` pinskia at gcc dot gnu dot org
2005-09-10 20:34 ` geoffk at geoffk dot org
` (4 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-10 4:56 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-10 04:56 -------
This was introduced by:
2004-08-04 Geoffrey Keating <geoffk@apple.com>
PR 14516
* c-common.c (c_expand_decl): Don't special-case static VAR_DECLs.
* c-common.h (make_rtl_for_local_static): Delete.
* c-decl.c (shadow_tag_warned): Clean up comment.
(finish_decl): Clean up spacing. Use set_user_assembler_name when
appropriate. Don't pass asmspec to rest_of_decl_compilation.
* c-semantics.c (make_rtl_for_local_static): Delete.
* expr.c (init_block_move_fn): Use set_user_assembler_name.
(init_block_clear_fn): Likewise.
* passes.c (rest_of_decl_compilation): Remove asmspec parameter,
expect it to be in DECL_ASSEMBLER_NAME. Update callers in many files.
* toplev.h (rest_of_decl_compilation): Remove asmspec parameter.
* tree.h (make_decl_rtl): Remove second parameter.
(set_user_assembler_name): New.
* varasm.c (set_user_assembler_name): New.
(make_decl_rtl): Remove second parameter. Update callers in many
files.
So it is little harder to fix than I had previous thought as there is no way to know if user set the decl
name or if it was just the name of the decl. The front-ends have to be fixed to call
set_user_assembler_name all the time and then make_decl_rtl needs to be updated for that but I don't
have the time to test that patch.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |geoffk at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23125
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/23125] [4.0/4.1 Regression] OpenBSD's zic.c causes g++ but not gcc to segfault
2005-07-29 3:25 [Bug c++/23125] New: OpenBSD's zic.c causes g++ but not gcc to segfault flash at pobox dot com
` (6 preceding siblings ...)
2005-09-10 4:56 ` pinskia at gcc dot gnu dot org
@ 2005-09-10 20:34 ` geoffk at geoffk dot org
2005-09-11 15:40 ` Andrew Pinski
2005-09-11 15:40 ` pinskia at physics dot uc dot edu
` (3 subsequent siblings)
11 siblings, 1 reply; 14+ messages in thread
From: geoffk at geoffk dot org @ 2005-09-10 20:34 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From geoffk at geoffk dot org 2005-09-10 20:34 -------
Subject: Re: [4.0/4.1 Regression] OpenBSD's zic.c causes g++ but not gcc to segfault
On 09/09/2005, at 9:56 PM, pinskia at gcc dot gnu dot org wrote:
> So it is little harder to fix than I had previous thought as there
> is no way to know if user set the decl
> name or if it was just the name of the decl. The front-ends have
> to be fixed to call
> set_user_assembler_name all the time and then make_decl_rtl needs
> to be updated for that but I don't
> have the time to test that patch.
You should be able to tell if the user set the name because it will
start with a '*'.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23125
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/23125] [4.0/4.1 Regression] OpenBSD's zic.c causes g++ but not gcc to segfault
2005-07-29 3:25 [Bug c++/23125] New: OpenBSD's zic.c causes g++ but not gcc to segfault flash at pobox dot com
` (7 preceding siblings ...)
2005-09-10 20:34 ` geoffk at geoffk dot org
@ 2005-09-11 15:40 ` pinskia at physics dot uc dot edu
2005-09-14 6:32 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: pinskia at physics dot uc dot edu @ 2005-09-11 15:40 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at physics dot uc dot edu 2005-09-11 15:40 -------
Subject: Re: [4.0/4.1 Regression] OpenBSD's zic.c causes g++ but not gcc to segfault
On Sep 10, 2005, at 4:34 PM, geoffk at geoffk dot org wrote:
> You should be able to tell if the user set the name because it will
> start with a '*'.
Except currently, we do:
else if (C_DECL_REGISTER (decl))
change_decl_assembler_name (decl, get_identifier (asmspec));
else
set_user_assembler_name (decl, asmspec);
-- Pinski
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23125
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Bug middle-end/23125] [4.0/4.1 Regression] OpenBSD's zic.c causes g++ but not gcc to segfault
2005-09-10 20:34 ` geoffk at geoffk dot org
@ 2005-09-11 15:40 ` Andrew Pinski
0 siblings, 0 replies; 14+ messages in thread
From: Andrew Pinski @ 2005-09-11 15:40 UTC (permalink / raw)
To: gcc-bugzilla; +Cc: gcc-bugs
On Sep 10, 2005, at 4:34 PM, geoffk at geoffk dot org wrote:
> You should be able to tell if the user set the name because it will
> start with a '*'.
Except currently, we do:
else if (C_DECL_REGISTER (decl))
change_decl_assembler_name (decl, get_identifier (asmspec));
else
set_user_assembler_name (decl, asmspec);
-- Pinski
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/23125] [4.0/4.1 Regression] OpenBSD's zic.c causes g++ but not gcc to segfault
2005-07-29 3:25 [Bug c++/23125] New: OpenBSD's zic.c causes g++ but not gcc to segfault flash at pobox dot com
` (8 preceding siblings ...)
2005-09-11 15:40 ` pinskia at physics dot uc dot edu
@ 2005-09-14 6:32 ` pinskia at gcc dot gnu dot org
2005-09-16 19:39 ` mrs at apple dot com
2005-09-27 16:25 ` mmitchel at gcc dot gnu dot org
11 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-14 6:32 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-14 06:31 -------
I Have a fix which I will posting in the morning.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pinskia at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23125
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/23125] [4.0/4.1 Regression] OpenBSD's zic.c causes g++ but not gcc to segfault
2005-07-29 3:25 [Bug c++/23125] New: OpenBSD's zic.c causes g++ but not gcc to segfault flash at pobox dot com
` (9 preceding siblings ...)
2005-09-14 6:32 ` pinskia at gcc dot gnu dot org
@ 2005-09-16 19:39 ` mrs at apple dot com
2005-09-27 16:25 ` mmitchel at gcc dot gnu dot org
11 siblings, 0 replies; 14+ messages in thread
From: mrs at apple dot com @ 2005-09-16 19:39 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mrs at apple dot com 2005-09-16 19:39 -------
radr://3934846
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23125
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/23125] [4.0/4.1 Regression] OpenBSD's zic.c causes g++ but not gcc to segfault
2005-07-29 3:25 [Bug c++/23125] New: OpenBSD's zic.c causes g++ but not gcc to segfault flash at pobox dot com
` (10 preceding siblings ...)
2005-09-16 19:39 ` mrs at apple dot com
@ 2005-09-27 16:25 ` mmitchel at gcc dot gnu dot org
11 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 16:25 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.0.2 |4.0.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23125
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2005-09-27 16:25 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-29 3:25 [Bug c++/23125] New: OpenBSD's zic.c causes g++ but not gcc to segfault flash at pobox dot com
2005-07-29 3:50 ` [Bug c++/23125] " flash at pobox dot com
2005-07-29 5:04 ` flash at pobox dot com
2005-07-29 5:35 ` [Bug c++/23125] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-09-10 3:29 ` pinskia at gcc dot gnu dot org
2005-09-10 3:30 ` [Bug middle-end/23125] " pinskia at gcc dot gnu dot org
2005-09-10 4:41 ` pinskia at gcc dot gnu dot org
2005-09-10 4:56 ` pinskia at gcc dot gnu dot org
2005-09-10 20:34 ` geoffk at geoffk dot org
2005-09-11 15:40 ` Andrew Pinski
2005-09-11 15:40 ` pinskia at physics dot uc dot edu
2005-09-14 6:32 ` pinskia at gcc dot gnu dot org
2005-09-16 19:39 ` mrs at apple dot com
2005-09-27 16:25 ` mmitchel 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).