public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59759] New: internal compiler error: in unify, using std::enable_if on classes
@ 2014-01-10 16:21 gereon.kremer at cs dot rwth-aachen.de
  2014-01-10 16:21 ` [Bug c++/59759] " gereon.kremer at cs dot rwth-aachen.de
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: gereon.kremer at cs dot rwth-aachen.de @ 2014-01-10 16:21 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 3651 bytes --]

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

            Bug ID: 59759
           Summary: internal compiler error: in unify, using
                    std::enable_if on classes
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gereon.kremer at cs dot rwth-aachen.de

Created attachment 31798
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31798&action=edit
Source code

Im using gcc version 4.8.2 20131219 (prerelease) (GCC) on arch linux.
When the attached file is compiled with "g++ Test_GCC.cpp -std=c++11", it
crashes with the following output:

Test_GCC.cpp: In function ‘int main()’:
Test_GCC.cpp:21:7: internal compiler error: in unify, at cp/pt.c:17171
  f(map);
       ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.archlinux.org/> for instructions.
>From gcc-bugs-return-439982-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jan 10 16:21:40 2014
Return-Path: <gcc-bugs-return-439982-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 1495 invoked by alias); 10 Jan 2014 16:21:40 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 1463 invoked by uid 48); 10 Jan 2014 16:21:36 -0000
From: "d.g.gorbachev at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/47889] [4.7 Regression] Segmentation fault in useless_type_conversion_p, at tree-ssa.c:1228
Date: Fri, 10 Jan 2014 16:21:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: lto
X-Bugzilla-Version: 4.6.0
X-Bugzilla-Keywords: ice-on-invalid-code, lto
X-Bugzilla-Severity: normal
X-Bugzilla-Who: d.g.gorbachev at gmail dot com
X-Bugzilla-Status: WAITING
X-Bugzilla-Priority: P4
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.7.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.isobsolete attachments.created
Message-ID: <bug-47889-4-5bRSR8Cdnc@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-47889-4@http.gcc.gnu.org/bugzilla/>
References: <bug-47889-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-01/txt/msg01124.txt.bz2
Content-length: 737

http://gcc.gnu.org/bugzilla/show_bug.cgi?idG889

Dmitry Gorbachev <d.g.gorbachev at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #23485|0                           |1
        is obsolete|                            |

--- Comment #15 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> ---
Created attachment 31799
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id1799&actioníit
Backtrace from checked 4.7.4 build

> 4.7.4, not the prerelease?

The latest 4.7 release is 4.7.3 <http://gcc.gnu.org/gcc-4.7/>, 4.7.4 is still
pre.

I just tried the head of the 4.7 branch (r206505). Segmentation fault.


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

* [Bug c++/59759] internal compiler error: in unify, using std::enable_if on classes
  2014-01-10 16:21 [Bug c++/59759] New: internal compiler error: in unify, using std::enable_if on classes gereon.kremer at cs dot rwth-aachen.de
@ 2014-01-10 16:21 ` gereon.kremer at cs dot rwth-aachen.de
  2014-01-10 16:36 ` mpolacek at gcc dot gnu.org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: gereon.kremer at cs dot rwth-aachen.de @ 2014-01-10 16:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Gereon Kremer <gereon.kremer at cs dot rwth-aachen.de> ---
Created attachment 31800
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31800&action=edit
Preprocessed file


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

* [Bug c++/59759] internal compiler error: in unify, using std::enable_if on classes
  2014-01-10 16:21 [Bug c++/59759] New: internal compiler error: in unify, using std::enable_if on classes gereon.kremer at cs dot rwth-aachen.de
  2014-01-10 16:21 ` [Bug c++/59759] " gereon.kremer at cs dot rwth-aachen.de
@ 2014-01-10 16:36 ` mpolacek at gcc dot gnu.org
  2014-01-10 16:43 ` gereon.kremer at cs dot rwth-aachen.de
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-01-10 16:36 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I'd say a dup of PR59115.


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

* [Bug c++/59759] internal compiler error: in unify, using std::enable_if on classes
  2014-01-10 16:21 [Bug c++/59759] New: internal compiler error: in unify, using std::enable_if on classes gereon.kremer at cs dot rwth-aachen.de
  2014-01-10 16:21 ` [Bug c++/59759] " gereon.kremer at cs dot rwth-aachen.de
  2014-01-10 16:36 ` mpolacek at gcc dot gnu.org
@ 2014-01-10 16:43 ` gereon.kremer at cs dot rwth-aachen.de
  2014-01-15 10:30 ` gereon.kremer at cs dot rwth-aachen.de
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: gereon.kremer at cs dot rwth-aachen.de @ 2014-01-10 16:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Gereon Kremer <gereon.kremer at cs dot rwth-aachen.de> ---
(In reply to Marek Polacek from comment #2)
> I'd say a dup of PR59115.

I checked the following code from PR59115 that should also trigger this bug:

template<typename T, float = 0, int = 0, typename U = int> void foo(T, U) {}
void bar()
{
  foo(0, 0);
}

This does not trigger an ICE for me, but produces the following, hence it does
not seem like a duplicate to me...

Test_GCC.cpp:15:30: error: ‘float’ is not a valid type for a template non-type
parameter
 template<typename T, float = 0, int = 0, typename U = int> void foo(T, U) {}
                              ^
Test_GCC.cpp:19: confused by earlier errors, bailing out
>From gcc-bugs-return-439991-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jan 10 16:44:17 2014
Return-Path: <gcc-bugs-return-439991-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 19765 invoked by alias); 10 Jan 2014 16:44:17 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 19330 invoked by uid 48); 10 Jan 2014 16:44:12 -0000
From: "jvdelisle at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libfortran/59727] [4.7/4.8/4.9 Regression] reading from character string returns end of file
Date: Fri, 10 Jan 2014 16:44:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libfortran
X-Bugzilla-Version: 4.6.2
X-Bugzilla-Keywords: rejects-valid
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jvdelisle at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-59727-4-aMBtUNz1Jp@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59727-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59727-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-01/txt/msg01133.txt.bz2
Content-length: 1402

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY727

Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jvdelisle at gcc dot gnu.org

--- Comment #4 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
The following also runs without error.

My initial thought is that the content of the string after the 20th char is
undefined and this results in undefined behavior.  As Steve notes, any junk can
be in there.

C TEST READING FROM CHARACTER STRING
      CHARACTER*144 LINE
C
      LINE(1:20)=' 12,30.0,10.5,0     '
C CRASHES AT RUN-TIME UNLESS THE FOLLOWING LINE IS UNCOMMENTED
C     LINE(30:30)=CHAR(10)
      READ (LINE(1:20),*) I1,R1,R2,I2
      WRITE (*,1000) I1,R1,R2,I2
 1000 FORMAT (I4,2F10.2,I4)
      END

I think the original code is invalid because of the undefined string. Prior to
the patch mentioned in Comment 1, the run-time library did not "read" or
interpret an EOF character.

Tracing the error shows that the error occurs in finish_list_read where we do
an eat_line which gives the error.  If we want to accept the behavior, we
probably could have a unique eat_line for internal character units.

I am not sure we want to accept the behavior yet and I don't think we should
call it a regression.


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

* [Bug c++/59759] internal compiler error: in unify, using std::enable_if on classes
  2014-01-10 16:21 [Bug c++/59759] New: internal compiler error: in unify, using std::enable_if on classes gereon.kremer at cs dot rwth-aachen.de
                   ` (2 preceding siblings ...)
  2014-01-10 16:43 ` gereon.kremer at cs dot rwth-aachen.de
@ 2014-01-15 10:30 ` gereon.kremer at cs dot rwth-aachen.de
  2014-04-10 14:55 ` paolo.carlini at oracle dot com
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: gereon.kremer at cs dot rwth-aachen.de @ 2014-01-15 10:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Gereon Kremer <gereon.kremer at cs dot rwth-aachen.de> ---
Created attachment 31838
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31838&action=edit
Reduced example


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

* [Bug c++/59759] internal compiler error: in unify, using std::enable_if on classes
  2014-01-10 16:21 [Bug c++/59759] New: internal compiler error: in unify, using std::enable_if on classes gereon.kremer at cs dot rwth-aachen.de
                   ` (3 preceding siblings ...)
  2014-01-15 10:30 ` gereon.kremer at cs dot rwth-aachen.de
@ 2014-04-10 14:55 ` paolo.carlini at oracle dot com
  2014-09-26 14:40 ` gereon.kremer at cs dot rwth-aachen.de
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-04-10 14:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|gereon.kremer at cs dot rwth-aache |
                   |n.de                        |

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Indeed, this isn't a Dup, but note that the experiment in Comment 3 doesn't
tell us much: "confused by earlier errors, bailing out" is an ICE for a
compiler built with checks enabled.


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

* [Bug c++/59759] internal compiler error: in unify, using std::enable_if on classes
  2014-01-10 16:21 [Bug c++/59759] New: internal compiler error: in unify, using std::enable_if on classes gereon.kremer at cs dot rwth-aachen.de
                   ` (4 preceding siblings ...)
  2014-04-10 14:55 ` paolo.carlini at oracle dot com
@ 2014-09-26 14:40 ` gereon.kremer at cs dot rwth-aachen.de
  2014-09-26 15:02 ` trippels at gcc dot gnu.org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: gereon.kremer at cs dot rwth-aachen.de @ 2014-09-26 14:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59759

--- Comment #6 from Gereon Kremer <gereon.kremer at cs dot rwth-aachen.de> ---
Any news here?

The problem persists with version g++ (GCC) 4.9.1 20140903 (prerelease).


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

* [Bug c++/59759] internal compiler error: in unify, using std::enable_if on classes
  2014-01-10 16:21 [Bug c++/59759] New: internal compiler error: in unify, using std::enable_if on classes gereon.kremer at cs dot rwth-aachen.de
                   ` (5 preceding siblings ...)
  2014-09-26 14:40 ` gereon.kremer at cs dot rwth-aachen.de
@ 2014-09-26 15:02 ` trippels at gcc dot gnu.org
  2014-09-30 13:26 ` trippels at gcc dot gnu.org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-09-26 15:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59759

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-09-26
                 CC|                            |trippels at gcc dot gnu.org
   Target Milestone|---                         |4.8.4
     Ever confirmed|0                           |1
      Known to fail|                            |4.8.3, 4.9.1, 5.0

--- Comment #7 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
markus@x4 tmp % cat test3.ii
namespace std {
template <typename _Tp>
struct B {
  static constexpr _Tp value = 0;
};
typedef B<int> false_type;
struct C : false_type {};
template <typename>
struct is_integral : C {};
template <int, typename _Tp>
struct enable_if {
  typedef _Tp type;
};
}
enum class enabled;
constexpr enabled dummy{};
template <typename T, typename std::enable_if<std::is_integral<T>::value,
                                              enabled>::type = dummy>
class A;
template <typename T>
void f(A<T>*) {
  A<int>* map;
  f(map);
}

markus@x4 tmp % g++ -c -std=c++11 test3.ii
test3.ii: In substitution of ‘template<class T> void f(A<T>*) [with T =
<missing>]’:
test3.ii:23:8:   required from here
test3.ii:23:8: internal compiler error: in unify, at cp/pt.c:18392
   f(map);
        ^
0x606105 unify
        ../../gcc/gcc/cp/pt.c:18392
0x6067a4 unify
        ../../gcc/gcc/cp/pt.c:18234
0x51d9b8 try_class_unification
        ../../gcc/gcc/cp/pt.c:17248
0x605b77 unify
        ../../gcc/gcc/cp/pt.c:18271
0x605d5c unify
        ../../gcc/gcc/cp/pt.c:18138
0x6093f4 unify_one_argument
        ../../gcc/gcc/cp/pt.c:16657
0x60baea type_unification_real
        ../../gcc/gcc/cp/pt.c:16728
0x614aac fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, bool, bool)
        ../../gcc/gcc/cp/pt.c:16164
0x5843e9 add_template_candidate_real
        ../../gcc/gcc/cp/call.c:3025
0x584e5c add_template_candidate
        ../../gcc/gcc/cp/call.c:3122
0x584e5c add_candidates
        ../../gcc/gcc/cp/call.c:5253
0x587413 perform_overload_resolution
        ../../gcc/gcc/cp/call.c:3971
0x5897da build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, bool, int)
        ../../gcc/gcc/cp/call.c:4048
0x7032ac finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ../../gcc/gcc/cp/semantics.c:2366
0x688c55 cp_parser_postfix_expression
        ../../gcc/gcc/cp/parser.c:6232
0x68bb09 cp_parser_unary_expression
        ../../gcc/gcc/cp/parser.c:7293
0x68c744 cp_parser_binary_expression
        ../../gcc/gcc/cp/parser.c:8035
0x68ccd9 cp_parser_assignment_expression
        ../../gcc/gcc/cp/parser.c:8278
0x68f4c4 cp_parser_expression
        ../../gcc/gcc/cp/parser.c:8440
0x68fcfc cp_parser_expression_statement
        ../../gcc/gcc/cp/parser.c:9828
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
>From gcc-bugs-return-462645-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 26 15:27:02 2014
Return-Path: <gcc-bugs-return-462645-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 15861 invoked by alias); 26 Sep 2014 15:27:01 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 15763 invoked by uid 48); 26 Sep 2014 15:26:54 -0000
From: "jamborm at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/63375] [4.8/4.9/5 Regression] reordering of reads across fences
Date: Fri, 26 Sep 2014 15:27:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.9.1
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jamborm at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.8.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-63375-4-6h11iZxzRS@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63375-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63375-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-09/txt/msg02479.txt.bz2
Content-length: 959

https://gcc.gnu.org/bugzilla/show_bug.cgi?idc375

--- Comment #4 from Martin Jambor <jamborm at gcc dot gnu.org> ---
SRA is indeed quite guilty, the following patch fixes it:

diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 8259dba..fb24114 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -1064,6 +1064,11 @@ build_access_from_expr_1 (tree expr, gimple stmt, bool
write)
                               "component.");
       return NULL;
     }
+  if (TREE_THIS_VOLATILE (expr))
+    {
+      disqualify_base_of_expr (expr, "part of a volatile reference.");
+      return NULL;
+    }

   switch (TREE_CODE (expr))
     {

Nevertheless, it is apparently not the only culprit.  Even on trunk
with -fno-tree-sra we produce exactly the same assembly output.  From
a brief look at the dumps it seems that RTL fwprop1 is the pass moving
the load, however I have not had a look if it is its fault or if
expansion looses the volatility information somehow.


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

* [Bug c++/59759] internal compiler error: in unify, using std::enable_if on classes
  2014-01-10 16:21 [Bug c++/59759] New: internal compiler error: in unify, using std::enable_if on classes gereon.kremer at cs dot rwth-aachen.de
                   ` (6 preceding siblings ...)
  2014-09-26 15:02 ` trippels at gcc dot gnu.org
@ 2014-09-30 13:26 ` trippels at gcc dot gnu.org
  2014-11-26 15:09 ` gereon.kremer at cs dot rwth-aachen.de
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-09-30 13:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59759

--- Comment #9 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #8)
> If this isn't a regression (which it doesn't seem to be) then setting Target
> Milestone to 4.8.4 doesn't seem appropriate.

Feel free to adjust.


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

* [Bug c++/59759] internal compiler error: in unify, using std::enable_if on classes
  2014-01-10 16:21 [Bug c++/59759] New: internal compiler error: in unify, using std::enable_if on classes gereon.kremer at cs dot rwth-aachen.de
                   ` (7 preceding siblings ...)
  2014-09-30 13:26 ` trippels at gcc dot gnu.org
@ 2014-11-26 15:09 ` gereon.kremer at cs dot rwth-aachen.de
  2014-11-26 15:13 ` trippels at gcc dot gnu.org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: gereon.kremer at cs dot rwth-aachen.de @ 2014-11-26 15:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59759

--- Comment #10 from Gereon Kremer <gereon.kremer at cs dot rwth-aachen.de> ---
Any news?

The problem persists for the following versions:

- 4.8.3, error at line 17225
- 4.9.1, error at line 18149
- 4.9.2, error at line 18149


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

* [Bug c++/59759] internal compiler error: in unify, using std::enable_if on classes
  2014-01-10 16:21 [Bug c++/59759] New: internal compiler error: in unify, using std::enable_if on classes gereon.kremer at cs dot rwth-aachen.de
                   ` (8 preceding siblings ...)
  2014-11-26 15:09 ` gereon.kremer at cs dot rwth-aachen.de
@ 2014-11-26 15:13 ` trippels at gcc dot gnu.org
  2014-12-22 20:57 ` ktietz at gcc dot gnu.org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-11-26 15:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59759

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.4                       |---


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

* [Bug c++/59759] internal compiler error: in unify, using std::enable_if on classes
  2014-01-10 16:21 [Bug c++/59759] New: internal compiler error: in unify, using std::enable_if on classes gereon.kremer at cs dot rwth-aachen.de
                   ` (9 preceding siblings ...)
  2014-11-26 15:13 ` trippels at gcc dot gnu.org
@ 2014-12-22 20:57 ` ktietz at gcc dot gnu.org
  2015-05-26 11:44 ` gereon.kremer at cs dot rwth-aachen.de
  2015-05-26 12:07 ` ktietz at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: ktietz at gcc dot gnu.org @ 2014-12-22 20:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59759

Kai Tietz <ktietz at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ktietz at gcc dot gnu.org

--- Comment #11 from Kai Tietz <ktietz at gcc dot gnu.org> ---
Hmm, I think this might be not the thing wanted here.  But infact having a
VAR_DECL can be caused by prior errors introducing them.  So we might simple
want to treat VAR_DECL in unify via unify_template_argument_mismatch.

ChangeLog

2014-12-22  Kai Tietz  <ktietz@redhat.com>

    PR c++/59759
    * pt.c (unify): Don't ICE on VAR_DECL.


Regression tested on x86_64-w64-mingw32.  Ok for apply?

Regards,
Kai

Index: pt.c
===================================================================
--- pt.c        (Revision 219014)
+++ pt.c        (Arbeitskopie)
@@ -18490,11 +18490,12 @@ unify (tree tparms, tree targs, tree parm, tree ar

     case VAR_DECL:
       /* A non-type template parameter that is a variable should be a
-        an integral constant, in which case, it whould have been
+        an integral constant, in which case, it should have been
         folded into its (constant) value. So we should not be getting
-        a variable here.  */
-      gcc_unreachable ();
+        a variable here out-side of an error-case.  */

+      return unify_template_argument_mismatch (explain_p, parm, arg);
+
     case TYPE_ARGUMENT_PACK:
     case NONTYPE_ARGUMENT_PACK:
       return unify (tparms, targs, ARGUMENT_PACK_ARGS (parm),


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

* [Bug c++/59759] internal compiler error: in unify, using std::enable_if on classes
  2014-01-10 16:21 [Bug c++/59759] New: internal compiler error: in unify, using std::enable_if on classes gereon.kremer at cs dot rwth-aachen.de
                   ` (10 preceding siblings ...)
  2014-12-22 20:57 ` ktietz at gcc dot gnu.org
@ 2015-05-26 11:44 ` gereon.kremer at cs dot rwth-aachen.de
  2015-05-26 12:07 ` ktietz at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: gereon.kremer at cs dot rwth-aachen.de @ 2015-05-26 11:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59759

--- Comment #12 from Gereon Kremer <gereon.kremer at cs dot rwth-aachen.de> ---
And once again.
I just upgraded to gcc 5.1.0

Sure enough, it's not fixed...

Test_GCC.cpp: In substitution of ‘template<class T> void f(const A<T>*) [with T
= <missing>]’:
Test_GCC.cpp:25:7:   required from here
Test_GCC.cpp:25:7: internal compiler error: in unify, at cp/pt.c:18571
  f(map);
>From gcc-bugs-return-487282-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue May 26 11:50:11 2015
Return-Path: <gcc-bugs-return-487282-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 69398 invoked by alias); 26 May 2015 11:50:11 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 69187 invoked by uid 48); 26 May 2015 11:49:52 -0000
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/66289] New: [5/6 Regression] "error: ambiguous template instantiation" with partial specialization defined in terms of alias template
Date: Tue, 26 May 2015 11:50:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords: rejects-valid
X-Bugzilla-Severity: normal
X-Bugzilla-Who: redi at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-66289-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-05/txt/msg02122.txt.bz2
Content-length: 1708

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66289

            Bug ID: 66289
           Summary: [5/6 Regression] "error: ambiguous template
                    instantiation" with partial specialization defined in
                    terms of alias template
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

5.1 and later incorrectly reject this, but it should compile because
foo<shared_ptr<A<T>>> is more specialized than foo<shared_ptr<T>>:


template<typename T> struct A {};

template<typename T> struct shared_ptr { };
template<typename T> using APtr = shared_ptr<A<T>>;

template<typename T> struct foo;
template<typename T> struct foo<shared_ptr<T>> { };
template<typename T> struct foo<APtr<T>> { };

foo<shared_ptr<A<int>>> aa;



amb.cc:10:25: error: ambiguous template instantiation for ‘struct
foo<shared_ptr<A<int> > >’
 foo<shared_ptr<A<int>>> aa;
                          ^
amb.cc:7:29: note: candidates are: template<class T> struct foo<shared_ptr<T> >
[with T = A<int>]
 template<typename T> struct foo<shared_ptr<T>> { };
                              ^
amb.cc:8:29: note:                 template<class T> struct foo<APtr<T> > [with
T = int]
 template<typename T> struct foo<APtr<T>> { };
                              ^
amb.cc:10:25: error: aggregate ‘foo<shared_ptr<A<int> > > aa’ has incomplete
type and cannot be defined
 foo<shared_ptr<A<int>>> aa;
                          ^
>From gcc-bugs-return-487283-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue May 26 11:51:28 2015
Return-Path: <gcc-bugs-return-487283-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 71940 invoked by alias); 26 May 2015 11:51:28 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 70004 invoked by uid 48); 26 May 2015 11:51:10 -0000
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/66289] [5/6 Regression] "error: ambiguous template instantiation" with partial specialization defined in terms of alias template
Date: Tue, 26 May 2015 11:51:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords: rejects-valid
X-Bugzilla-Severity: normal
X-Bugzilla-Who: redi at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cf_known_to_work everconfirmed cf_known_to_fail
Message-ID: <bug-66289-4-FwrF64xVJI@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66289-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66289-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-05/txt/msg02123.txt.bz2
Content-length: 523

https://gcc.gnu.org/bugzilla/show_bug.cgi?idf289

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-05-26
      Known to work|                            |4.8.3, 4.9.2
     Ever confirmed|0                           |1
      Known to fail|                            |5.1.0, 6.0


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

* [Bug c++/59759] internal compiler error: in unify, using std::enable_if on classes
  2014-01-10 16:21 [Bug c++/59759] New: internal compiler error: in unify, using std::enable_if on classes gereon.kremer at cs dot rwth-aachen.de
                   ` (11 preceding siblings ...)
  2015-05-26 11:44 ` gereon.kremer at cs dot rwth-aachen.de
@ 2015-05-26 12:07 ` ktietz at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: ktietz at gcc dot gnu.org @ 2015-05-26 12:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59759

Kai Tietz <ktietz at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #13 from Kai Tietz <ktietz at gcc dot gnu.org> ---
Is patch in comment #11 ok for apply to branch/trunk?


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

end of thread, other threads:[~2015-05-26 12:07 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-10 16:21 [Bug c++/59759] New: internal compiler error: in unify, using std::enable_if on classes gereon.kremer at cs dot rwth-aachen.de
2014-01-10 16:21 ` [Bug c++/59759] " gereon.kremer at cs dot rwth-aachen.de
2014-01-10 16:36 ` mpolacek at gcc dot gnu.org
2014-01-10 16:43 ` gereon.kremer at cs dot rwth-aachen.de
2014-01-15 10:30 ` gereon.kremer at cs dot rwth-aachen.de
2014-04-10 14:55 ` paolo.carlini at oracle dot com
2014-09-26 14:40 ` gereon.kremer at cs dot rwth-aachen.de
2014-09-26 15:02 ` trippels at gcc dot gnu.org
2014-09-30 13:26 ` trippels at gcc dot gnu.org
2014-11-26 15:09 ` gereon.kremer at cs dot rwth-aachen.de
2014-11-26 15:13 ` trippels at gcc dot gnu.org
2014-12-22 20:57 ` ktietz at gcc dot gnu.org
2015-05-26 11:44 ` gereon.kremer at cs dot rwth-aachen.de
2015-05-26 12:07 ` ktietz 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).