public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53839] New: [4.7/4.8 Regresion] [C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391
@ 2012-07-03 13:22 redi at gcc dot gnu.org
  2012-07-25  9:31 ` [Bug c++/53839] [4.7/4.8 Regression] " paolo.carlini at oracle dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2012-07-03 13:22 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53839
           Summary: [4.7/4.8 Regresion] [C++11] internal compiler error:
                    in adjust_temp_type, at cp/semantics.c:6391
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: redi@gcc.gnu.org


#include <chrono>

namespace c = std::chrono;

struct X { long x; };

X f(const c::time_point<c::system_clock, c::microseconds>& tp)
{
    return { (tp - tp).count() };
}

void g()
{
    c::time_point<c::system_clock, c::microseconds> tp;
    f(tp);
}

ICE with 4.7.1 and 4.8-20120701 snapshot, the snapshot output is

ice.cc: In function 'X f(const
std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long
int, std::ratio<1l, 1000000l> > >&)':
ice.cc:9:20:   in constexpr expansion of
'std::chrono::operator-<std::chrono::system_clock, std::chrono::duration<long
int, std::ratio<1l, 1000000l> >, std::chrono::duration<long int, std::ratio<1l,
1000000l> > >((* & tp), (* & tp))'
/home/jwakely/gcc/4.x/include/c++/4.8.0/chrono:629:41:   in constexpr expansion
of '(& __lhs)->std::chrono::time_point<_Clock,
_Dur>::time_since_epoch<std::chrono::system_clock, std::chrono::duration<long
int, std::ratio<1l, 1000000l> > >()'
ice.cc:9:32: internal compiler error: in adjust_temp_type, at
cp/semantics.c:6396
     return { (tp - tp).count() };
                                ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


Compiles OK with 4.6.3 or if the expression is changed to not use a temporary:

    auto x = tp - tp;
    return { x.count() };


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

* [Bug c++/53839] [4.7/4.8 Regression] [C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391
  2012-07-03 13:22 [Bug c++/53839] New: [4.7/4.8 Regresion] [C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391 redi at gcc dot gnu.org
@ 2012-07-25  9:31 ` paolo.carlini at oracle dot com
  2012-08-16 11:04 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-07-25  9:31 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-07-25
                 CC|                            |hjl at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-07-25 09:31:03 UTC ---
Confirmed. H.J. can you find which change broke this? Thanks.


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

* [Bug c++/53839] [4.7/4.8 Regression] [C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391
  2012-07-03 13:22 [Bug c++/53839] New: [4.7/4.8 Regresion] [C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391 redi at gcc dot gnu.org
  2012-07-25  9:31 ` [Bug c++/53839] [4.7/4.8 Regression] " paolo.carlini at oracle dot com
@ 2012-08-16 11:04 ` rguenth at gcc dot gnu.org
  2012-08-16 13:46 ` hjl.tools at gmail dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-08-16 11:04 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.7.2


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

* [Bug c++/53839] [4.7/4.8 Regression] [C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391
  2012-07-03 13:22 [Bug c++/53839] New: [4.7/4.8 Regresion] [C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391 redi at gcc dot gnu.org
  2012-07-25  9:31 ` [Bug c++/53839] [4.7/4.8 Regression] " paolo.carlini at oracle dot com
  2012-08-16 11:04 ` rguenth at gcc dot gnu.org
@ 2012-08-16 13:46 ` hjl.tools at gmail dot com
  2012-08-16 14:45 ` paolo.carlini at oracle dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: hjl.tools at gmail dot com @ 2012-08-16 13:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> 2012-08-16 13:46:24 UTC ---
It was triggered by revision 176549:

http://gcc.gnu.org/ml/gcc-cvs/2011-07/msg00816.html

But ICE is always there.


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

* [Bug c++/53839] [4.7/4.8 Regression] [C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391
  2012-07-03 13:22 [Bug c++/53839] New: [4.7/4.8 Regresion] [C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391 redi at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-08-16 13:46 ` hjl.tools at gmail dot com
@ 2012-08-16 14:45 ` paolo.carlini at oracle dot com
  2012-08-16 14:59 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-08-16 14:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-08-16 14:45:03 UTC ---
I see. Jonathan, I guess a reduced testcase not including anything would be
very useful anyway (even if the ICE is very old)


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

* [Bug c++/53839] [4.7/4.8 Regression] [C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391
  2012-07-03 13:22 [Bug c++/53839] New: [4.7/4.8 Regresion] [C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391 redi at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-08-16 14:45 ` paolo.carlini at oracle dot com
@ 2012-08-16 14:59 ` redi at gcc dot gnu.org
  2012-09-07  9:31 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2012-08-16 14:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-08-16 14:58:53 UTC ---
I'll see what I can do.


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

* [Bug c++/53839] [4.7/4.8 Regression] [C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391
  2012-07-03 13:22 [Bug c++/53839] New: [4.7/4.8 Regresion] [C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391 redi at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-08-16 14:59 ` redi at gcc dot gnu.org
@ 2012-09-07  9:31 ` rguenth at gcc dot gnu.org
  2012-09-13 15:14 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-07  9:31 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

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


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

* [Bug c++/53839] [4.7/4.8 Regression] [C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391
  2012-07-03 13:22 [Bug c++/53839] New: [4.7/4.8 Regresion] [C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391 redi at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2012-09-07  9:31 ` rguenth at gcc dot gnu.org
@ 2012-09-13 15:14 ` jason at gcc dot gnu.org
  2012-09-13 15:15 ` jason at gcc dot gnu.org
  2012-09-13 15:30 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2012-09-13 15:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2012-09-13 15:14:18 UTC ---
Author: jason
Date: Thu Sep 13 15:14:08 2012
New Revision: 191263

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191263
Log:
    PR c++/53839
    * semantics.c (cxx_eval_indirect_ref): If we aren't looking for an
    address, make sure the value is constant.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-temp1.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/53839] [4.7/4.8 Regression] [C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391
  2012-07-03 13:22 [Bug c++/53839] New: [4.7/4.8 Regresion] [C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391 redi at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2012-09-13 15:14 ` jason at gcc dot gnu.org
@ 2012-09-13 15:15 ` jason at gcc dot gnu.org
  2012-09-13 15:30 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2012-09-13 15:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2012-09-13 15:14:18 UTC ---
Author: jason
Date: Thu Sep 13 15:14:08 2012
New Revision: 191263

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191263
Log:
    PR c++/53839
    * semantics.c (cxx_eval_indirect_ref): If we aren't looking for an
    address, make sure the value is constant.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-temp1.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2012-09-13 15:15:22 UTC ---
Author: jason
Date: Thu Sep 13 15:15:06 2012
New Revision: 191266

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191266
Log:
    PR c++/53839
    * semantics.c (cxx_eval_indirect_ref): If we aren't looking for an
    address, make sure the value is constant.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/cpp0x/constexpr-temp1.C
Modified:
    branches/gcc-4_7-branch/gcc/cp/ChangeLog
    branches/gcc-4_7-branch/gcc/cp/semantics.c
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/53839] [4.7/4.8 Regression] [C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391
  2012-07-03 13:22 [Bug c++/53839] New: [4.7/4.8 Regresion] [C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391 redi at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2012-09-13 15:15 ` jason at gcc dot gnu.org
@ 2012-09-13 15:30 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2012-09-13 15:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jason at gcc dot gnu.org
         Resolution|                            |FIXED

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2012-09-13 15:30:14 UTC ---
Fixed for 4.7.2.


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

end of thread, other threads:[~2012-09-13 15:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-03 13:22 [Bug c++/53839] New: [4.7/4.8 Regresion] [C++11] internal compiler error: in adjust_temp_type, at cp/semantics.c:6391 redi at gcc dot gnu.org
2012-07-25  9:31 ` [Bug c++/53839] [4.7/4.8 Regression] " paolo.carlini at oracle dot com
2012-08-16 11:04 ` rguenth at gcc dot gnu.org
2012-08-16 13:46 ` hjl.tools at gmail dot com
2012-08-16 14:45 ` paolo.carlini at oracle dot com
2012-08-16 14:59 ` redi at gcc dot gnu.org
2012-09-07  9:31 ` rguenth at gcc dot gnu.org
2012-09-13 15:14 ` jason at gcc dot gnu.org
2012-09-13 15:15 ` jason at gcc dot gnu.org
2012-09-13 15:30 ` 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).