public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/26696]  New: ICE with statement forming unused static member function reference
@ 2006-03-15 14:04 marco at technoboredom dot net
  2006-03-15 14:16 ` [Bug c++/26696] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: marco at technoboredom dot net @ 2006-03-15 14:04 UTC (permalink / raw)
  To: gcc-bugs

Testcase is short enough: 

struct A
{
        static void f() {}
}; 

int main() 
{
        A a; 
        a.f;    
}

Produces a segfault on the line where "a.f" occurs. It should instead issue the
warning "statement is a reference, not call, to function A::f". gcc 4.1.0 (at
least the experimental mingw cross compiler I'm using here) seems to be
affected too.


-- 
           Summary: ICE with statement forming unused static member function
                    reference
           Product: gcc
           Version: 4.0.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: marco at technoboredom dot net
 GCC build triplet: i586-suse-linux
  GCC host triplet: i586-suse-linux
GCC target triplet: i586-suse-linux


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


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

* [Bug c++/26696] [4.0/4.1/4.2 Regression] ICE with statement forming unused static member function reference
  2006-03-15 14:04 [Bug c++/26696] New: ICE with statement forming unused static member function reference marco at technoboredom dot net
@ 2006-03-15 14:16 ` pinskia at gcc dot gnu dot org
  2006-03-15 14:17 ` pinskia at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-15 14:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-03-15 14:16 -------
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
  GCC build triplet|i586-suse-linux             |
   GCC host triplet|i586-suse-linux             |
 GCC target triplet|i586-suse-linux             |
      Known to fail|                            |4.0.3 4.1.0 4.2.0
      Known to work|                            |3.4.0 3.3.3
   Last reconfirmed|0000-00-00 00:00:00         |2006-03-15 14:16:40
               date|                            |
            Summary|ICE with statement forming  |[4.0/4.1/4.2 Regression] ICE
                   |unused static member        |with statement forming
                   |function reference          |unused static member
                   |                            |function reference
   Target Milestone|---                         |4.0.4


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


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

* [Bug c++/26696] [4.0/4.1/4.2 Regression] ICE with statement forming unused static member function reference
  2006-03-15 14:04 [Bug c++/26696] New: ICE with statement forming unused static member function reference marco at technoboredom dot net
  2006-03-15 14:16 ` [Bug c++/26696] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
@ 2006-03-15 14:17 ` pinskia at gcc dot gnu dot org
  2006-06-04 18:07 ` mmitchel at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-15 14:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-03-15 14:17 -------
Here is the ICE when checking is enabled:
t.cc:9: internal compiler error: tree check: expected field_decl, have baselink
in component_ref_field_offset, at expr.c:5757


-- 


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


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

* [Bug c++/26696] [4.0/4.1/4.2 Regression] ICE with statement forming unused static member function reference
  2006-03-15 14:04 [Bug c++/26696] New: ICE with statement forming unused static member function reference marco at technoboredom dot net
  2006-03-15 14:16 ` [Bug c++/26696] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
  2006-03-15 14:17 ` pinskia at gcc dot gnu dot org
@ 2006-06-04 18:07 ` mmitchel at gcc dot gnu dot org
  2006-06-30  1:17 ` dtemirbulatov at gmail dot com
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-06-04 18:07 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug c++/26696] [4.0/4.1/4.2 Regression] ICE with statement forming unused static member function reference
  2006-03-15 14:04 [Bug c++/26696] New: ICE with statement forming unused static member function reference marco at technoboredom dot net
                   ` (2 preceding siblings ...)
  2006-06-04 18:07 ` mmitchel at gcc dot gnu dot org
@ 2006-06-30  1:17 ` dtemirbulatov at gmail dot com
  2006-07-05 10:46 ` dtemirbulatov at gmail dot com
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: dtemirbulatov at gmail dot com @ 2006-06-30  1:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dtemirbulatov at gmail dot com  2006-06-30 01:08 -------
Created an attachment (id=11782)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11782&action=view)
fix

we need to check first operand for FIELD_DECL before gimpilfying COMPONENT_REF


-- 


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


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

* [Bug c++/26696] [4.0/4.1/4.2 Regression] ICE with statement forming unused static member function reference
  2006-03-15 14:04 [Bug c++/26696] New: ICE with statement forming unused static member function reference marco at technoboredom dot net
                   ` (3 preceding siblings ...)
  2006-06-30  1:17 ` dtemirbulatov at gmail dot com
@ 2006-07-05 10:46 ` dtemirbulatov at gmail dot com
  2006-07-05 18:26 ` dtemirbulatov at gmail dot com
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: dtemirbulatov at gmail dot com @ 2006-07-05 10:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dtemirbulatov at gmail dot com  2006-07-05 10:46 -------
>fix
>
>we need to check first operand for FIELD_DECL before gimpilfying COMPONENT_REF
this is a wrong fix, it caused some regressions 


-- 


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


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

* [Bug c++/26696] [4.0/4.1/4.2 Regression] ICE with statement forming unused static member function reference
  2006-03-15 14:04 [Bug c++/26696] New: ICE with statement forming unused static member function reference marco at technoboredom dot net
                   ` (4 preceding siblings ...)
  2006-07-05 10:46 ` dtemirbulatov at gmail dot com
@ 2006-07-05 18:26 ` dtemirbulatov at gmail dot com
  2006-09-06  0:48 ` jason at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: dtemirbulatov at gmail dot com @ 2006-07-05 18:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from dtemirbulatov at gmail dot com  2006-07-05 18:26 -------
> It should instead issue the warning "statement is a reference, not call, to function A::f"

gcc producing the warnig, if you using -Wall flag


-- 


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


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

* [Bug c++/26696] [4.0/4.1/4.2 Regression] ICE with statement forming unused static member function reference
  2006-03-15 14:04 [Bug c++/26696] New: ICE with statement forming unused static member function reference marco at technoboredom dot net
                   ` (5 preceding siblings ...)
  2006-07-05 18:26 ` dtemirbulatov at gmail dot com
@ 2006-09-06  0:48 ` jason at gcc dot gnu dot org
  2006-09-06 17:06 ` jason at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jason at gcc dot gnu dot org @ 2006-09-06  0:48 UTC (permalink / raw)
  To: gcc-bugs



-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jason at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-05-21 20:56:11         |2006-09-06 00:48:25
               date|                            |


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


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

* [Bug c++/26696] [4.0/4.1/4.2 Regression] ICE with statement forming unused static member function reference
  2006-03-15 14:04 [Bug c++/26696] New: ICE with statement forming unused static member function reference marco at technoboredom dot net
                   ` (6 preceding siblings ...)
  2006-09-06  0:48 ` jason at gcc dot gnu dot org
@ 2006-09-06 17:06 ` jason at gcc dot gnu dot org
  2006-09-07 22:27 ` [Bug c++/26696] [4.0/4.1 " jason at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jason at gcc dot gnu dot org @ 2006-09-06 17:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jason at gcc dot gnu dot org  2006-09-06 17:06 -------
Subject: Bug 26696

Author: jason
Date: Wed Sep  6 17:06:00 2006
New Revision: 116724

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116724
Log:
        PR c++/26696
        * cvt.c (convert_to_void): Replace a subexpression with no side
        effects with void_zero_node.
        * tree.c (is_overloaded_fn): Look through COMPONENT_REF.
        (get_first_fn): Ditto.
        * decl.c (grokdeclarator): No need to look through COMPONENT_REF.

Added:
    trunk/gcc/testsuite/g++.dg/warn/noeffect8.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cvt.c
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/tree.c
    trunk/gcc/testsuite/g++.dg/other/component1.C


-- 


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


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

* [Bug c++/26696] [4.0/4.1 Regression] ICE with statement forming unused static member function reference
  2006-03-15 14:04 [Bug c++/26696] New: ICE with statement forming unused static member function reference marco at technoboredom dot net
                   ` (7 preceding siblings ...)
  2006-09-06 17:06 ` jason at gcc dot gnu dot org
@ 2006-09-07 22:27 ` jason at gcc dot gnu dot org
  2006-09-07 22:38 ` jason at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jason at gcc dot gnu dot org @ 2006-09-07 22:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jason at gcc dot gnu dot org  2006-09-07 22:27 -------
Subject: Bug 26696

Author: jason
Date: Thu Sep  7 22:27:01 2006
New Revision: 116763

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116763
Log:
        PR c++/26195
        * decl.c (make_rtl_for_nonlocal_decl),
        (start_preparsed_function): Don't use lbasename on
        input_filename when calling get_fileinfo.
        * semantics.c (begin_class_definition): Likewise.
        * lex.c (cxx_make_type): Likewise.
        (handle_pragma_interface): Call get_fileinfo on input_filename,
        not on the parameter to the directive.

        PR c++/26696
        * cvt.c (convert_to_void): Replace a subexpression with no side
        effects with void_zero_node.
        * tree.c (is_overloaded_fn): Look through COMPONENT_REF.
        (get_first_fn): Ditto.
        * decl.c (grokdeclarator): No need to look through COMPONENT_REF.

        PR c++/26571
        * parser.c (cp_parser_diagnose_invalid_type_name): Handle the case
        where the name is a type used incorrectly.

        PR c++/26671
        * typeck.c (maybe_warn_about_returning_address_of_local): Look
        through COMPONENT_REF and ARRAY_REF.

        PR c++/26102
        * name-lookup.c (do_class_using_decl): Try to find the base even
        if bases_dependent_p.
        * pt.c (type_dependent_expression_p): A USING_DECL is dependent.

        PR c++/19809
        * pt.c (tsubst_friend_function): Set DECL_INITIAL before pushdecl.

Modified:
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/cvt.c
    branches/gcc-4_1-branch/gcc/cp/decl.c
    branches/gcc-4_1-branch/gcc/cp/lex.c
    branches/gcc-4_1-branch/gcc/cp/name-lookup.c
    branches/gcc-4_1-branch/gcc/cp/parser.c
    branches/gcc-4_1-branch/gcc/cp/pt.c
    branches/gcc-4_1-branch/gcc/cp/semantics.c
    branches/gcc-4_1-branch/gcc/cp/tree.c
    branches/gcc-4_1-branch/gcc/cp/typeck.c


-- 


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


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

* [Bug c++/26696] [4.0/4.1 Regression] ICE with statement forming unused static member function reference
  2006-03-15 14:04 [Bug c++/26696] New: ICE with statement forming unused static member function reference marco at technoboredom dot net
                   ` (8 preceding siblings ...)
  2006-09-07 22:27 ` [Bug c++/26696] [4.0/4.1 " jason at gcc dot gnu dot org
@ 2006-09-07 22:38 ` jason at gcc dot gnu dot org
  2006-09-07 23:05 ` jason at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jason at gcc dot gnu dot org @ 2006-09-07 22:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jason at gcc dot gnu dot org  2006-09-07 22:38 -------
Subject: Bug 26696

Author: jason
Date: Thu Sep  7 22:38:03 2006
New Revision: 116764

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116764
Log:
        PR c++/26195
        * decl.c (make_rtl_for_nonlocal_decl),
        (start_preparsed_function): Don't use lbasename on
        input_filename when calling get_fileinfo.
        * semantics.c (begin_class_definition): Likewise.
        * lex.c (cxx_make_type): Likewise.
        (handle_pragma_interface): Call get_fileinfo on input_filename,
        not on the parameter to the directive.

        PR c++/26696
        * cvt.c (convert_to_void): Replace a subexpression with no side
        effects with void_zero_node.
        * tree.c (is_overloaded_fn): Look through COMPONENT_REF.
        (get_first_fn): Ditto.
        * decl.c (grokdeclarator): No need to look through COMPONENT_REF.

        PR c++/26571
        * parser.c (cp_parser_diagnose_invalid_type_name): Handle the case
        where the name is a type used incorrectly.

        PR c++/26671
        * typeck.c (maybe_warn_about_returning_address_of_local): Look
        through COMPONENT_REF and ARRAY_REF.

        PR c++/19809
        * pt.c (tsubst_friend_function): Set DECL_INITIAL before pushdecl.

Modified:
    branches/gcc-4_0-branch/gcc/cp/ChangeLog
    branches/gcc-4_0-branch/gcc/cp/cvt.c
    branches/gcc-4_0-branch/gcc/cp/decl.c
    branches/gcc-4_0-branch/gcc/cp/lex.c
    branches/gcc-4_0-branch/gcc/cp/parser.c
    branches/gcc-4_0-branch/gcc/cp/pt.c
    branches/gcc-4_0-branch/gcc/cp/semantics.c
    branches/gcc-4_0-branch/gcc/cp/tree.c
    branches/gcc-4_0-branch/gcc/cp/typeck.c


-- 


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


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

* [Bug c++/26696] [4.0/4.1 Regression] ICE with statement forming unused static member function reference
  2006-03-15 14:04 [Bug c++/26696] New: ICE with statement forming unused static member function reference marco at technoboredom dot net
                   ` (9 preceding siblings ...)
  2006-09-07 22:38 ` jason at gcc dot gnu dot org
@ 2006-09-07 23:05 ` jason at gcc dot gnu dot org
  2006-09-08 23:33 ` [Bug c++/26696] [4.0/4.1/4.2 " reichelt at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jason at gcc dot gnu dot org @ 2006-09-07 23:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jason at gcc dot gnu dot org  2006-09-07 23:05 -------
Fixed


-- 

jason at gcc dot gnu dot org changed:

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


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


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

* [Bug c++/26696] [4.0/4.1/4.2 Regression] ICE with statement forming unused static member function reference
  2006-03-15 14:04 [Bug c++/26696] New: ICE with statement forming unused static member function reference marco at technoboredom dot net
                   ` (10 preceding siblings ...)
  2006-09-07 23:05 ` jason at gcc dot gnu dot org
@ 2006-09-08 23:33 ` reichelt at gcc dot gnu dot org
  2006-09-08 23:45 ` pinskia at gcc dot gnu dot org
  2006-09-09 10:47 ` reichelt at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-09-08 23:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from reichelt at gcc dot gnu dot org  2006-09-08 23:33 -------
The fix is incomplete. The following testcase still fails:

==========================
struct A
{
  static void foo();
};

void bar()
{
  A().foo;
}
==========================


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |
            Summary|[4.0/4.1 Regression] ICE    |[4.0/4.1/4.2 Regression] ICE
                   |with statement forming      |with statement forming
                   |unused static member        |unused static member
                   |function reference          |function reference


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


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

* [Bug c++/26696] [4.0/4.1/4.2 Regression] ICE with statement forming unused static member function reference
  2006-03-15 14:04 [Bug c++/26696] New: ICE with statement forming unused static member function reference marco at technoboredom dot net
                   ` (11 preceding siblings ...)
  2006-09-08 23:33 ` [Bug c++/26696] [4.0/4.1/4.2 " reichelt at gcc dot gnu dot org
@ 2006-09-08 23:45 ` pinskia at gcc dot gnu dot org
  2006-09-09 10:47 ` reichelt at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-08 23:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from pinskia at gcc dot gnu dot org  2006-09-08 23:45 -------
(In reply to comment #10)
> The fix is incomplete. The following testcase still fails:

Can you file a new bug report since the orginal testcase here was fixed, even
though your testcase is very closely related it really should be filed
seperately.


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

* [Bug c++/26696] [4.0/4.1/4.2 Regression] ICE with statement forming unused static member function reference
  2006-03-15 14:04 [Bug c++/26696] New: ICE with statement forming unused static member function reference marco at technoboredom dot net
                   ` (12 preceding siblings ...)
  2006-09-08 23:45 ` pinskia at gcc dot gnu dot org
@ 2006-09-09 10:47 ` reichelt at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-09-09 10:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from reichelt at gcc dot gnu dot org  2006-09-09 10:47 -------
The problem from comment #10 is now tracked in PR 28996.


-- 


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


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

end of thread, other threads:[~2006-09-09 10:47 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-15 14:04 [Bug c++/26696] New: ICE with statement forming unused static member function reference marco at technoboredom dot net
2006-03-15 14:16 ` [Bug c++/26696] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
2006-03-15 14:17 ` pinskia at gcc dot gnu dot org
2006-06-04 18:07 ` mmitchel at gcc dot gnu dot org
2006-06-30  1:17 ` dtemirbulatov at gmail dot com
2006-07-05 10:46 ` dtemirbulatov at gmail dot com
2006-07-05 18:26 ` dtemirbulatov at gmail dot com
2006-09-06  0:48 ` jason at gcc dot gnu dot org
2006-09-06 17:06 ` jason at gcc dot gnu dot org
2006-09-07 22:27 ` [Bug c++/26696] [4.0/4.1 " jason at gcc dot gnu dot org
2006-09-07 22:38 ` jason at gcc dot gnu dot org
2006-09-07 23:05 ` jason at gcc dot gnu dot org
2006-09-08 23:33 ` [Bug c++/26696] [4.0/4.1/4.2 " reichelt at gcc dot gnu dot org
2006-09-08 23:45 ` pinskia at gcc dot gnu dot org
2006-09-09 10:47 ` reichelt 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).