public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/35326]  New: [4.2/4.3/4.4 regression] ICE with stray digraph token
@ 2008-02-23 19:07 reichelt at gcc dot gnu dot org
  2008-02-23 19:07 ` [Bug c++/35326] " reichelt at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-02-23 19:07 UTC (permalink / raw)
  To: gcc-bugs

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

====================================================
%:%:;
====================================================

bug.cc:1: error: stray '%:%:' in program
bug.cc:1: internal compiler error: vector VEC(fs_p,base) index domain error, in
restore_input_file_stack at toplev.c:1021
Please submit a full bug report, [etc.]

The C frontend doesn't have this problem. Also the version without digraphs
is rejected correctly:

====================================================
##;
====================================================

bug.cc:1: error: stray '##' in program


-- 
           Summary: [4.2/4.3/4.4 regression] ICE with stray digraph token
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, error-recovery, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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


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

* [Bug c++/35326] [4.2/4.3/4.4 regression] ICE with stray digraph token
  2008-02-23 19:07 [Bug c++/35326] New: [4.2/4.3/4.4 regression] ICE with stray digraph token reichelt at gcc dot gnu dot org
@ 2008-02-23 19:07 ` reichelt at gcc dot gnu dot org
  2008-02-24 22:07 ` rguenth at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-02-23 19:07 UTC (permalink / raw)
  To: gcc-bugs



-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.2.4


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


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

* [Bug c++/35326] [4.2/4.3/4.4 regression] ICE with stray digraph token
  2008-02-23 19:07 [Bug c++/35326] New: [4.2/4.3/4.4 regression] ICE with stray digraph token reichelt at gcc dot gnu dot org
  2008-02-23 19:07 ` [Bug c++/35326] " reichelt at gcc dot gnu dot org
@ 2008-02-24 22:07 ` rguenth at gcc dot gnu dot org
  2008-03-02 21:24 ` [Bug preprocessor/35326] " reichelt at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-02-24 22:07 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Priority|P3                          |P5
   Last reconfirmed|0000-00-00 00:00:00         |2008-02-24 22:06:41
               date|                            |


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


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

* [Bug preprocessor/35326] [4.2/4.3/4.4 regression] ICE with stray digraph token
  2008-02-23 19:07 [Bug c++/35326] New: [4.2/4.3/4.4 regression] ICE with stray digraph token reichelt at gcc dot gnu dot org
  2008-02-23 19:07 ` [Bug c++/35326] " reichelt at gcc dot gnu dot org
  2008-02-24 22:07 ` rguenth at gcc dot gnu dot org
@ 2008-03-02 21:24 ` reichelt at gcc dot gnu dot org
  2008-03-13 15:54 ` tromey at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-03-02 21:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from reichelt at gcc dot gnu dot org  2008-03-02 21:23 -------
The ICE with "%:%:;" disappeared on mainline.
However, the following code snippet still triggers a segfault:

=======
%:%:
=======

This happens with the C and C++ frontend.
Looks like it's the preprocessor's fault.


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |preprocessor


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


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

* [Bug preprocessor/35326] [4.2/4.3/4.4 regression] ICE with stray digraph token
  2008-02-23 19:07 [Bug c++/35326] New: [4.2/4.3/4.4 regression] ICE with stray digraph token reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-03-02 21:24 ` [Bug preprocessor/35326] " reichelt at gcc dot gnu dot org
@ 2008-03-13 15:54 ` tromey at gcc dot gnu dot org
  2008-03-14  7:45 ` reichelt at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at gcc dot gnu dot org @ 2008-03-13 15:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from tromey at gcc dot gnu dot org  2008-03-13 15:53 -------
I tried this but was unable to see the ICE.
I used trunk, both gcc and g++.
What options did you use?  Anything special?

If you still see an ICE, could you perhaps append a stack trace from cc1?
That might help.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at gcc dot gnu dot
                   |                            |org


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


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

* [Bug preprocessor/35326] [4.2/4.3/4.4 regression] ICE with stray digraph token
  2008-02-23 19:07 [Bug c++/35326] New: [4.2/4.3/4.4 regression] ICE with stray digraph token reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-03-13 15:54 ` tromey at gcc dot gnu dot org
@ 2008-03-14  7:45 ` reichelt at gcc dot gnu dot org
  2008-04-05 13:31 ` tromey at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-03-14  7:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from reichelt at gcc dot gnu dot org  2008-03-14 07:44 -------
I still see the ICE on 4.2 branch, 4.3 branch and mainline (i686-pc-linux-gnu).
Here's the backtrace from mainline (4.3 branch and 4.2 branch crash in the same
position, and valgrind reports an invalid read at that position):

#0  0x08784cdd in _cpp_lex_direct (pfile=0x89a5070)
    at ../../gcc/libcpp/lex.c:897
Program received signal SIGSEGV, Segmentation fault.
0x08784cdd in _cpp_lex_direct (pfile=0x89a5070) at ../../gcc/libcpp/lex.c:897
897       if (buffer->need_line)
(gdb) bt
#0  0x08784cdd in _cpp_lex_direct (pfile=0x89a5070)
    at ../../gcc/libcpp/lex.c:897
#1  0x087858bd in _cpp_lex_token (pfile=0x89a5070)
    at ../../gcc/libcpp/lex.c:781
#2  0x08787b78 in cpp_get_token (pfile=0x89a5070)
    at ../../gcc/libcpp/macro.c:1190
#3  0x08788d24 in cpp_get_token_with_location (pfile=0x89a5070, loc=0xb7d9bf74)
    at ../../gcc/libcpp/macro.c:1271
#4  0x0804ccc0 in c_lex_with_flags (value=0xb7d9bf70, loc=0xb7d9bf74, 
    cpp_flags=0x0, lex_flags=0) at ../../gcc/gcc/c-lex.c:304
#5  0x080c60cb in c_lex_one_token (parser=0xb7d9bf6c, token=0xb7d9bf6c)
    at ../../gcc/gcc/c-parser.c:311
#6  0x080c6b40 in c_parser_skip_to_end_of_block_or_statement (
    parser=0xb7d9bf6c) at ../../gcc/gcc/c-parser.c:416
#7  0x080d157b in c_parser_declaration_or_fndef (parser=0xb7d9bf6c, 
    fndef_ok=1 '\001', empty_ok=0 '\0', nested=0 '\0', 
    start_attr_ok=<value optimized out>) at ../../gcc/gcc/c-parser.c:1263
#8  0x080d24a6 in c_parser_external_declaration (parser=0xb7d9bf6c)
    at ../../gcc/gcc/c-parser.c:1180
#9  0x080d324f in c_parse_file () at ../../gcc/gcc/c-parser.c:1082
#10 0x080b84b5 in c_common_parse_file (set_yydebug=0)
    at ../../gcc/gcc/c-opts.c:1280
#11 0x08351574 in toplev_main (argc=3, argv=0xbfa6b774)

Apparently pfile->buffer is 0.

I didn't use any special options, just plain "cc1 -quiet".


-- 


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


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

* [Bug preprocessor/35326] [4.2/4.3/4.4 regression] ICE with stray digraph token
  2008-02-23 19:07 [Bug c++/35326] New: [4.2/4.3/4.4 regression] ICE with stray digraph token reichelt at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-03-14  7:45 ` reichelt at gcc dot gnu dot org
@ 2008-04-05 13:31 ` tromey at gcc dot gnu dot org
  2008-04-10  6:17 ` reichelt at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at gcc dot gnu dot org @ 2008-04-05 13:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from tromey at gcc dot gnu dot org  2008-04-05 13:30 -------
With trunk I still can't reproduce this.
I ran valgrind on cc1 and cc1plus, and see no reports.
Here's the command line I'm using:

valgrind
/home/tromey/gnu/Trunk/install/libexec/gcc/i686-pc-linux-gnu/4.4.0/cc1plus
-quiet -v -D_GNU_SOURCE pr35326.c -quiet -dumpbase pr35326.c -mtune=generic
-auxbase pr35326 -version -o /tmp/out.s


-- 


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


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

* [Bug preprocessor/35326] [4.2/4.3/4.4 regression] ICE with stray digraph token
  2008-02-23 19:07 [Bug c++/35326] New: [4.2/4.3/4.4 regression] ICE with stray digraph token reichelt at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-04-05 13:31 ` tromey at gcc dot gnu dot org
@ 2008-04-10  6:17 ` reichelt at gcc dot gnu dot org
  2008-05-19 20:47 ` jsm28 at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-04-10  6:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from reichelt at gcc dot gnu dot org  2008-04-10 06:16 -------
I can still reproduce it with trunk, 4.3 branch and 4.2 branch from 2008-04-07.
I can't reproduce it on x86_64, though (no segfault, no valgrind error).

Did you try adding random characters before %:%: ?
Maybe this changes memory layout so much that you see the segfault, too.

Concerning comment #3: I cannot imagine that pfile->buffer was 0 from the
beginning. It looks as if something trampled on the memory later. (I'd have
to check that, though.) That would also explain the totally different error
in the original report (and why you don't run into trouble with the same
testcase).


-- 


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


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

* [Bug preprocessor/35326] [4.2/4.3/4.4 regression] ICE with stray digraph token
  2008-02-23 19:07 [Bug c++/35326] New: [4.2/4.3/4.4 regression] ICE with stray digraph token reichelt at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2008-04-10  6:17 ` reichelt at gcc dot gnu dot org
@ 2008-05-19 20:47 ` jsm28 at gcc dot gnu dot org
  2008-11-11 21:06 ` [Bug preprocessor/35326] [4.2/4.3 " reichelt at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-05-19 20:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jsm28 at gcc dot gnu dot org  2008-05-19 20:25 -------
4.2.4 is being released, changing milestones to 4.2.5.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.2.4                       |4.2.5


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


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

* [Bug preprocessor/35326] [4.2/4.3 regression] ICE with stray digraph token
  2008-02-23 19:07 [Bug c++/35326] New: [4.2/4.3/4.4 regression] ICE with stray digraph token reichelt at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2008-05-19 20:47 ` jsm28 at gcc dot gnu dot org
@ 2008-11-11 21:06 ` reichelt at gcc dot gnu dot org
  2009-03-31 20:22 ` [Bug preprocessor/35326] [4.3 " jsm28 at gcc dot gnu dot org
  2009-04-22 15:25 ` rguenth at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-11-11 21:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from reichelt at gcc dot gnu dot org  2008-11-11 21:04 -------
The bug disappeared on mainline.

The crash with the C frontend disappeared much later than the one with the C++
frontend. Therefore, I don't think that the bug has been really fixed, we are
just
lucky that it doesn't trigger segfaults anymore.


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.2/4.3/4.4 regression] ICE|[4.2/4.3 regression] ICE
                   |with stray digraph token    |with stray digraph token


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


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

* [Bug preprocessor/35326] [4.3 regression] ICE with stray digraph token
  2008-02-23 19:07 [Bug c++/35326] New: [4.2/4.3/4.4 regression] ICE with stray digraph token reichelt at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2008-11-11 21:06 ` [Bug preprocessor/35326] [4.2/4.3 " reichelt at gcc dot gnu dot org
@ 2009-03-31 20:22 ` jsm28 at gcc dot gnu dot org
  2009-04-22 15:25 ` rguenth at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-31 20:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jsm28 at gcc dot gnu dot org  2009-03-31 20:21 -------
Closing 4.2 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.2/4.3 regression] ICE    |[4.3 regression] ICE with
                   |with stray digraph token    |stray digraph token
   Target Milestone|4.2.5                       |4.3.4


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


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

* [Bug preprocessor/35326] [4.3 regression] ICE with stray digraph token
  2008-02-23 19:07 [Bug c++/35326] New: [4.2/4.3/4.4 regression] ICE with stray digraph token reichelt at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2009-03-31 20:22 ` [Bug preprocessor/35326] [4.3 " jsm28 at gcc dot gnu dot org
@ 2009-04-22 15:25 ` rguenth at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-04-22 15:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from rguenth at gcc dot gnu dot org  2009-04-22 15:25 -------
WONTFIX for 4.3.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to fail|                            |4.3.3
      Known to work|                            |4.4.0
         Resolution|                            |FIXED
   Target Milestone|4.3.4                       |4.4.0


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


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

end of thread, other threads:[~2009-04-22 15:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-23 19:07 [Bug c++/35326] New: [4.2/4.3/4.4 regression] ICE with stray digraph token reichelt at gcc dot gnu dot org
2008-02-23 19:07 ` [Bug c++/35326] " reichelt at gcc dot gnu dot org
2008-02-24 22:07 ` rguenth at gcc dot gnu dot org
2008-03-02 21:24 ` [Bug preprocessor/35326] " reichelt at gcc dot gnu dot org
2008-03-13 15:54 ` tromey at gcc dot gnu dot org
2008-03-14  7:45 ` reichelt at gcc dot gnu dot org
2008-04-05 13:31 ` tromey at gcc dot gnu dot org
2008-04-10  6:17 ` reichelt at gcc dot gnu dot org
2008-05-19 20:47 ` jsm28 at gcc dot gnu dot org
2008-11-11 21:06 ` [Bug preprocessor/35326] [4.2/4.3 " reichelt at gcc dot gnu dot org
2009-03-31 20:22 ` [Bug preprocessor/35326] [4.3 " jsm28 at gcc dot gnu dot org
2009-04-22 15:25 ` rguenth 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).