public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/37540]  New: [4.4 regression] ICE on __decltype of method call in function template
@ 2008-09-16 12:29 piotr dot rak at gmail dot com
  2008-09-16 12:31 ` [Bug c++/37540] " piotr dot rak at gmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: piotr dot rak at gmail dot com @ 2008-09-16 12:29 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3698 bytes --]

Code:

-----------------------------------

struct A
{
    int g() {return 0;}
};

template <typename T_> 
void f(A a)
{
    __decltype(a.g()) i;
}

int main()
{
}

-----------------------------------

couses segfult with gcc snapshot from 20080912:

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with:
/var/tmp/paludis/sys-devel-gcc-4.4.0_alpha20080912/work/gcc-4.4-20080912/configure
--prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.4.0-alpha20080912
--includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.4.0-alpha20080912/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.4.0-alpha20080912
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.4.0-alpha20080912/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.4.0-alpha20080912/info
--with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.4.0-alpha20080912/include/g++-v4
--host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec
--enable-nls --without-included-gettext --with-system-zlib --disable-checking
--disable-werror --enable-secureplt --disable-multilib --enable-libmudflap
--disable-libssp --enable-cld --disable-libgcj --with-arch=i686
--enable-languages=c,c++ --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu
--with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo
4.4.0_alpha20080912'
Thread model: posix
gcc version 4.4.0-alpha20080912  (experimental) (Gentoo 4.4.0_alpha20080912) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-shared-libgcc' '-mtune=generic'
'-march=i686'
 /usr/libexec/gcc/i686-pc-linux-gnu/4.4.0-alpha20080912/cc1plus -E -quiet -v
-D_GNU_SOURCE ice.cc -mtune=generic -march=i686 -fpch-preprocess -o ice.ii
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/usr/lib/gcc/i686-pc-linux-gnu/4.4.0-alpha20080912/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/i686-pc-linux-gnu/4.4.0-alpha20080912/include/g++-v4

/usr/lib/gcc/i686-pc-linux-gnu/4.4.0-alpha20080912/include/g++-v4/i686-pc-linux-gnu
 /usr/lib/gcc/i686-pc-linux-gnu/4.4.0-alpha20080912/include/g++-v4/backward
 /usr/lib/gcc/i686-pc-linux-gnu/4.4.0-alpha20080912/include
 /usr/lib/gcc/i686-pc-linux-gnu/4.4.0-alpha20080912/include-fixed
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-shared-libgcc' '-mtune=generic'
'-march=i686'
 /usr/libexec/gcc/i686-pc-linux-gnu/4.4.0-alpha20080912/cc1plus -fpreprocessed
ice.ii -quiet -dumpbase ice.cc -mtune=generic -march=i686 -auxbase ice -version
-o ice.s
GNU C++ (Gentoo 4.4.0_alpha20080912) version 4.4.0-alpha20080912 
(experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.4.0-alpha20080912  (experimental), GMP
version 4.2.3, MPFR version 2.3.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 97e4b65c615f80d78fda437bf1278f0b
ice.cc: In function ‘void f(A)’:
ice.cc:10: internal compiler error: Naruszenie ochrony pami&#281;ci
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.gentoo.org/> for instructions.

Compiles fine with gcc-4.3.2.


-- 
           Summary: [4.4 regression] ICE on __decltype of method call in
                    function template
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: piotr dot rak at gmail dot com
 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=37540


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

* [Bug c++/37540] [4.4 regression] ICE on __decltype of method call in function template
  2008-09-16 12:29 [Bug c++/37540] New: [4.4 regression] ICE on __decltype of method call in function template piotr dot rak at gmail dot com
@ 2008-09-16 12:31 ` piotr dot rak at gmail dot com
  2008-09-16 17:10 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: piotr dot rak at gmail dot com @ 2008-09-16 12:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from piotr dot rak at gmail dot com  2008-09-16 12:30 -------
Created an attachment (id=16337)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16337&action=view)
testcase

Attached preprocessed sources.


-- 


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


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

* [Bug c++/37540] [4.4 regression] ICE on __decltype of method call in function template
  2008-09-16 12:29 [Bug c++/37540] New: [4.4 regression] ICE on __decltype of method call in function template piotr dot rak at gmail dot com
  2008-09-16 12:31 ` [Bug c++/37540] " piotr dot rak at gmail dot com
@ 2008-09-16 17:10 ` pinskia at gcc dot gnu dot org
  2008-09-17 10:29 ` jakub at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-09-16 17:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2008-09-16 17:09 -------
ICEs in finish_decltype_type.

Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-valid-code
      Known to fail|                            |4.4.0
      Known to work|                            |4.3.0
   Last reconfirmed|0000-00-00 00:00:00         |2008-09-16 17:09:22
               date|                            |
   Target Milestone|---                         |4.4.0


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


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

* [Bug c++/37540] [4.4 regression] ICE on __decltype of method call in function template
  2008-09-16 12:29 [Bug c++/37540] New: [4.4 regression] ICE on __decltype of method call in function template piotr dot rak at gmail dot com
  2008-09-16 12:31 ` [Bug c++/37540] " piotr dot rak at gmail dot com
  2008-09-16 17:10 ` pinskia at gcc dot gnu dot org
@ 2008-09-17 10:29 ` jakub at gcc dot gnu dot org
  2008-09-24 13:53 ` dgregor at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-09-17 10:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2008-09-17 10:28 -------
Caused by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=138843
Any reason why you look at CALL_EXPR_FN's type instead of just TREE_TYPE
(expr)?
In this case TREE_TYPE (expr) is int, but CALL_EXPR_FN is COMPONENT_REF with
NULL TREE_TYPE, created by:
5692  if (processing_template_decl && call != error_mark_node)
5693    call = (build_min_non_dep_call_list
5694    (call,
5695     build_min_nt (COMPONENT_REF, orig_instance, orig_fns, NULL_TREE),
5696     orig_args));


-- 

jakub at gcc dot gnu dot org changed:

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


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


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

* [Bug c++/37540] [4.4 regression] ICE on __decltype of method call in function template
  2008-09-16 12:29 [Bug c++/37540] New: [4.4 regression] ICE on __decltype of method call in function template piotr dot rak at gmail dot com
                   ` (2 preceding siblings ...)
  2008-09-17 10:29 ` jakub at gcc dot gnu dot org
@ 2008-09-24 13:53 ` dgregor at gcc dot gnu dot org
  2008-10-21 16:39 ` jakub at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dgregor at gcc dot gnu dot org @ 2008-09-24 13:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dgregor at gcc dot gnu dot org  2008-09-24 13:51 -------
We need to look at CALL_EXPR_FN's type because the decltype of a call retrieves
the return type of the the function called, which may be a REFERENCE_TYPE. The
type of the expression will have stripped away that reference.


-- 


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


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

* [Bug c++/37540] [4.4 regression] ICE on __decltype of method call in function template
  2008-09-16 12:29 [Bug c++/37540] New: [4.4 regression] ICE on __decltype of method call in function template piotr dot rak at gmail dot com
                   ` (3 preceding siblings ...)
  2008-09-24 13:53 ` dgregor at gcc dot gnu dot org
@ 2008-10-21 16:39 ` jakub at gcc dot gnu dot org
  2008-10-22  3:47 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-10-21 16:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2008-10-21 16:38 -------
Created an attachment (id=16521)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16521&action=view)
gcc44-pr37540.patch

Fix.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/37540] [4.4 regression] ICE on __decltype of method call in function template
  2008-09-16 12:29 [Bug c++/37540] New: [4.4 regression] ICE on __decltype of method call in function template piotr dot rak at gmail dot com
                   ` (4 preceding siblings ...)
  2008-10-21 16:39 ` jakub at gcc dot gnu dot org
@ 2008-10-22  3:47 ` mmitchel at gcc dot gnu dot org
  2008-11-19  8:44 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2008-10-22  3:47 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


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

* [Bug c++/37540] [4.4 regression] ICE on __decltype of method call in function template
  2008-09-16 12:29 [Bug c++/37540] New: [4.4 regression] ICE on __decltype of method call in function template piotr dot rak at gmail dot com
                   ` (5 preceding siblings ...)
  2008-10-22  3:47 ` mmitchel at gcc dot gnu dot org
@ 2008-11-19  8:44 ` jakub at gcc dot gnu dot org
  2008-11-19 21:58 ` jason at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-11-19  8:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jakub at gcc dot gnu dot org  2008-11-19 08:42 -------
Jason, how could we avoid creating the type dependent CALL_EXPR_FN?
It is created by build_new_method_call, but for templates both args and
instance
are going through build_non_dependent_expr which modifies them.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu dot org
         AssignedTo|jakub at gcc dot gnu dot org|unassigned at gcc dot gnu
                   |                            |dot org
             Status|ASSIGNED                    |NEW


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


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

* [Bug c++/37540] [4.4 regression] ICE on __decltype of method call in function template
  2008-09-16 12:29 [Bug c++/37540] New: [4.4 regression] ICE on __decltype of method call in function template piotr dot rak at gmail dot com
                   ` (6 preceding siblings ...)
  2008-11-19  8:44 ` jakub at gcc dot gnu dot org
@ 2008-11-19 21:58 ` jason at gcc dot gnu dot org
  2008-11-20 18:43 ` jason at gcc dot gnu dot org
  2008-11-20 18:43 ` jason at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-11-19 21:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jason at gcc dot gnu dot org  2008-11-19 21:56 -------
I'll poke at this.


-- 

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|2008-09-16 17:09:22         |2008-11-19 21:56:40
               date|                            |


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


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

* [Bug c++/37540] [4.4 regression] ICE on __decltype of method call in function template
  2008-09-16 12:29 [Bug c++/37540] New: [4.4 regression] ICE on __decltype of method call in function template piotr dot rak at gmail dot com
                   ` (7 preceding siblings ...)
  2008-11-19 21:58 ` jason at gcc dot gnu dot org
@ 2008-11-20 18:43 ` jason at gcc dot gnu dot org
  2008-11-20 18:43 ` jason at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-11-20 18:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jason at gcc dot gnu dot org  2008-11-20 18:42 -------
Subject: Bug 37540

Author: jason
Date: Thu Nov 20 18:40:52 2008
New Revision: 142054

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142054
Log:
        PR c++/37540
        * call.c (build_over_call): Take the address of the function even
        in a template.
        (build_new_method_call): Remember the type of the called function
        in a template.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/decltype14.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/call.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/37540] [4.4 regression] ICE on __decltype of method call in function template
  2008-09-16 12:29 [Bug c++/37540] New: [4.4 regression] ICE on __decltype of method call in function template piotr dot rak at gmail dot com
                   ` (8 preceding siblings ...)
  2008-11-20 18:43 ` jason at gcc dot gnu dot org
@ 2008-11-20 18:43 ` jason at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-11-20 18:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jason at gcc dot gnu dot org  2008-11-20 18:42 -------
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=37540


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

end of thread, other threads:[~2008-11-20 18:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-16 12:29 [Bug c++/37540] New: [4.4 regression] ICE on __decltype of method call in function template piotr dot rak at gmail dot com
2008-09-16 12:31 ` [Bug c++/37540] " piotr dot rak at gmail dot com
2008-09-16 17:10 ` pinskia at gcc dot gnu dot org
2008-09-17 10:29 ` jakub at gcc dot gnu dot org
2008-09-24 13:53 ` dgregor at gcc dot gnu dot org
2008-10-21 16:39 ` jakub at gcc dot gnu dot org
2008-10-22  3:47 ` mmitchel at gcc dot gnu dot org
2008-11-19  8:44 ` jakub at gcc dot gnu dot org
2008-11-19 21:58 ` jason at gcc dot gnu dot org
2008-11-20 18:43 ` jason at gcc dot gnu dot org
2008-11-20 18:43 ` jason 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).