public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/50114] New: ICE on invalid code in pop_binding, at cp/name-lookup.c:382
@ 2011-08-18  8:26 doko at gcc dot gnu.org
  2011-08-19  9:41 ` [Bug c++/50114] " paolo.carlini at oracle dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: doko at gcc dot gnu.org @ 2011-08-18  8:26 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50114
           Summary: ICE on invalid code in pop_binding, at
                    cp/name-lookup.c:382
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: doko@gcc.gnu.org


Created attachment 25045
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25045
preprocessed source

fails with current 4.5 and 4.6 branches, and trunk.

$ g++ -std=c++0x -c bp_b.ii 
src/bp/bp_b.cc: In lambda function:
src/bp/bp_b.cc:538:33: error: invalid conversion from
'tt_bookprxor::open_newfeeds()::x2feed*' to 'int' [-fpermissive]
src/bp/bp_b.cc:539:25: error: base operand of '->' is not a pointer
src/bp/bp_b.cc:540:24: error: 'x2feeds_i' was not declared in this scope
src/bp/bp_b.cc:540:58: error: return-statement with a value, in function
returning 'void' [-fpermissive]
src/bp/bp_b.cc:545:9: warning: name lookup of 'x2feed_i' changed [enabled by
default]
src/bp/bp_b.cc:534:46: warning:   matches this 'x2feed_i' under ISO standard
rules [enabled by default]
src/bp/bp_b.cc:538:22: warning:   matches this 'x2feed_i' under old rules
[enabled by default]
src/bp/bp_b.cc:545:55: error: cannot convert 'tt::feedhdlr*' to
'circlist<tt::feedhdlr*>*' in assignment
src/bp/bp_b.cc:547:5: internal compiler error: in pop_binding, at
cp/name-lookup.c:382
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-snapshot/README.Bugs> for instructions.


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

* [Bug c++/50114] ICE on invalid code in pop_binding, at cp/name-lookup.c:382
  2011-08-18  8:26 [Bug c++/50114] New: ICE on invalid code in pop_binding, at cp/name-lookup.c:382 doko at gcc dot gnu.org
@ 2011-08-19  9:41 ` paolo.carlini at oracle dot com
  2011-08-20 19:13 ` feedback at launchpad dot net
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-08-19  9:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-08-19 09:18:00 UTC ---
You know what I'm going to ask... ;)


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

* [Bug c++/50114] ICE on invalid code in pop_binding, at cp/name-lookup.c:382
  2011-08-18  8:26 [Bug c++/50114] New: ICE on invalid code in pop_binding, at cp/name-lookup.c:382 doko at gcc dot gnu.org
  2011-08-19  9:41 ` [Bug c++/50114] " paolo.carlini at oracle dot com
@ 2011-08-20 19:13 ` feedback at launchpad dot net
  2011-08-21  7:55 ` paolo.carlini at oracle dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: feedback at launchpad dot net @ 2011-08-20 19:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Launchpad <feedback at launchpad dot net> 2011-08-20 19:04:30 UTC ---
jas mann added the following comment to Launchpad bug report 827806:


Sorry, I don't know, but I can venture some guesses:
Q. Why did I code in such a manner as to foil parsing of the source? 
A. Careless, or worse? The error was obvious of course so in that respect a
crash was as good as a diagnostic.
Q. You want the preprocessor output?
A. It's gone. I thought perhaps the bug reporting script grabbed it.
Q. Why didn't I attach the preprocessor output to the bug report?
A. I guess it wasn't immediately obvious how, and I was in a rush. 
Q: What was the code that caused the problem?
A. I don't remember. I corrected it at the time. I should have saved it and
should a similar situation arise in the future I will do so.

Here's the lambda in which the indicated errors used to be if that's any help.
It iterates through a circular list of circular lists.

auto log_serviceorder = [&]() {
    const char* F = "%2d. %c[%d] %s id=%d\n";
    $LOG(log, BP, TTINF, "service order for %d feeds follows:\n", feedcount);
    for(int i=0; i < feedcount; i++) {
        circlist<tt::feedhdlr*>::node* feednode =
feedgroups.next()->content.next();   
        tt::feedhdlr* feed = feednode->content;
        $LOG(log,BP,TTINF,F, i,
feed->venue(),feednode->id,feed->name(),feed->id());
    }
} ;



> Date: Fri, 19 Aug 2011 09:18:00 +0000
> From: 827806@bugs.launchpad.net
> To: dotmarker@hotmail.com
> Subject: [Bug 827806] 
> 
> You know what I'm going to ask... ;)
> 
> -- 
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/827806
> 
> Title:
>   cc1plus bails can't handle situation
> 
> Status in The GNU Compiler Collection:
>   New
> Status in “gcc-4.5” package in Ubuntu:
>   Confirmed
> Status in “gcc-4.6” package in Ubuntu:
>   Confirmed
> 
> Bug description:
>   src/bp/bp_b.cc: In lambda function:
>   src/bp/bp_b.cc:538:33: error: invalid conversion from ‘tt_bookprxor::open_newfeeds()::x2feed*’ to ‘int’
>   src/bp/bp_b.cc:539:25: error: base operand of ‘->’ is not a pointer
>   src/bp/bp_b.cc:540:24: error: ‘x2feeds_i’ was not declared in this scope
>   src/bp/bp_b.cc:540:58: error: return-statement with a value, in function returning 'void'
>   src/bp/bp_b.cc:545:9: warning: name lookup of ‘x2feed_i’ changed
>   src/bp/bp_b.cc:534:46: warning:   matches this ‘x2feed_i’ under ISO standard rules
>   src/bp/bp_b.cc:538:22: warning:   matches this ‘x2feed_i’ under old rules
>   src/bp/bp_b.cc:545:55: error: cannot convert ‘tt::feedhdlr*’ to ‘circlist<tt::feedhdlr*>*’ in assignment
>   src/bp/bp_b.cc:546: confused by earlier errors, bailing out
>   Preprocessed source stored into /tmp/ccR2q49G.out file, please attach this to your bugreport.
> 
>   ProblemType: Crash
>   DistroRelease: Ubuntu 11.04
>   Package: g++-4.5 4.5.2-8ubuntu4
>   ProcVersionSignature: Ubuntu 2.6.38-10.46-generic 2.6.38.7
>   Uname: Linux 2.6.38-10-generic x86_64
>   NonfreeKernelModules: nvidia
>   Architecture: amd64
>   Date: Tue Aug 16 23:24:26 2011
>   ExecutablePath: /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/cc1plus
>   InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
>   SourcePackage: gcc-4.5
>   UpgradeStatus: Upgraded to natty on 2011-05-29 (79 days ago)
> 
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/gcc/+bug/827806/+subscriptions


-- 
http://launchpad.net/bugs/827806


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

* [Bug c++/50114] ICE on invalid code in pop_binding, at cp/name-lookup.c:382
  2011-08-18  8:26 [Bug c++/50114] New: ICE on invalid code in pop_binding, at cp/name-lookup.c:382 doko at gcc dot gnu.org
  2011-08-19  9:41 ` [Bug c++/50114] " paolo.carlini at oracle dot com
  2011-08-20 19:13 ` feedback at launchpad dot net
@ 2011-08-21  7:55 ` paolo.carlini at oracle dot com
  2011-08-25  2:01 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-08-21  7:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-08-20 23:17:42 UTC ---
I was winking at Matthias... As he knows well, a reduced testcase (say, below
100 lines) would help a lot, if/when you can.


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

* [Bug c++/50114] ICE on invalid code in pop_binding, at cp/name-lookup.c:382
  2011-08-18  8:26 [Bug c++/50114] New: ICE on invalid code in pop_binding, at cp/name-lookup.c:382 doko at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-08-21  7:55 ` paolo.carlini at oracle dot com
@ 2011-08-25  2:01 ` pinskia at gcc dot gnu.org
  2011-08-25  3:03 ` [Bug c++/50114] ICE with declaration inside for statement pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-08-25  2:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-08-25 01:49:51 UTC ---
Reducing.


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

* [Bug c++/50114] ICE with declaration inside for statement
  2011-08-18  8:26 [Bug c++/50114] New: ICE on invalid code in pop_binding, at cp/name-lookup.c:382 doko at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-08-25  2:01 ` pinskia at gcc dot gnu.org
@ 2011-08-25  3:03 ` pinskia at gcc dot gnu.org
  2011-08-30 19:32 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-08-25  3:03 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|diagnostic                  |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-08-25
                 CC|                            |jason at gcc dot gnu.org
            Summary|ICE on invalid code in      |ICE with declaration inside
                   |pop_binding, at             |for statement
                   |cp/name-lookup.c:382        |
     Ever Confirmed|0                           |1

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-08-25 02:00:47 UTC ---
Here is one which is an ICE on valid code:
int open()
{
  int *x2feed_i = 0;
  auto insert_feed = [&](unsigned char venue, int* newfeed) 
  {
     for(int x2feed_i = 1; 0; ) ;
     x2feed_i = newfeed;
  }
}

The only reason why the original was invalid was the invalid use of x2feed_i
inside the loop as I think the int should have been auto.


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

* [Bug c++/50114] ICE with declaration inside for statement
  2011-08-18  8:26 [Bug c++/50114] New: ICE on invalid code in pop_binding, at cp/name-lookup.c:382 doko at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-08-25  3:03 ` [Bug c++/50114] ICE with declaration inside for statement pinskia at gcc dot gnu.org
@ 2011-08-30 19:32 ` jason at gcc dot gnu.org
  2011-08-30 21:37 ` jason at gcc dot gnu.org
  2011-08-30 22:10 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2011-08-30 19:32 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |
   Target Milestone|---                         |4.7.0


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

* [Bug c++/50114] ICE with declaration inside for statement
  2011-08-18  8:26 [Bug c++/50114] New: ICE on invalid code in pop_binding, at cp/name-lookup.c:382 doko at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-08-30 19:32 ` jason at gcc dot gnu.org
@ 2011-08-30 21:37 ` jason at gcc dot gnu.org
  2011-08-30 22:10 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2011-08-30 21:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2011-08-30 21:27:23 UTC ---
Author: jason
Date: Tue Aug 30 21:27:18 2011
New Revision: 178338

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178338
Log:
    PR c++/50114
    * decl.c (poplevel): Disable for scope compatibility hack
    in C++11 mode.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-for.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/ext/forscope2.C


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

* [Bug c++/50114] ICE with declaration inside for statement
  2011-08-18  8:26 [Bug c++/50114] New: ICE on invalid code in pop_binding, at cp/name-lookup.c:382 doko at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2011-08-30 21:37 ` jason at gcc dot gnu.org
@ 2011-08-30 22:10 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2011-08-30 22:10 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

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

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2011-08-30 21:49:00 UTC ---
Fixed for 4.7.


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

end of thread, other threads:[~2011-08-30 21:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-18  8:26 [Bug c++/50114] New: ICE on invalid code in pop_binding, at cp/name-lookup.c:382 doko at gcc dot gnu.org
2011-08-19  9:41 ` [Bug c++/50114] " paolo.carlini at oracle dot com
2011-08-20 19:13 ` feedback at launchpad dot net
2011-08-21  7:55 ` paolo.carlini at oracle dot com
2011-08-25  2:01 ` pinskia at gcc dot gnu.org
2011-08-25  3:03 ` [Bug c++/50114] ICE with declaration inside for statement pinskia at gcc dot gnu.org
2011-08-30 19:32 ` jason at gcc dot gnu.org
2011-08-30 21:37 ` jason at gcc dot gnu.org
2011-08-30 22:10 ` jason at gcc dot gnu.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).