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

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).