public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51344] New: cc1plus hangs when compiling
@ 2011-11-29 14:06 koliasvskj at gmail dot com
  2011-11-29 14:33 ` [Bug c++/51344] " keithmarshall at mailinator dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: koliasvskj at gmail dot com @ 2011-11-29 14:06 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51344
           Summary: cc1plus hangs when compiling
    Classification: Unclassified
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: koliasvskj@gmail.com


After trying to compile one of old projects I ran into the situation when
mingw32-g++ silently hanged up. After ah hour of research I refined the whole
situation to this simple test file (evidently the main reason was the erratum;
but it was better to have the compile error and crashed build here then to have
three hours of senseless CPU torturing).

 /////////////////////////////////////////
 // test.cpp 
 class A;

 template <class T>
 class B
 {
 friend __attribute__((cdecl)) A& operator >>(A& a, B& b)
 {
 return a;
 }
 };
 //
 /////////////////////////////////////////

 Compiled with command:
 mingw32-g++ -v test.cpp

 Resulting output:

 Using built-in specs.
 COLLECT_GCC=mingw32-g++
 COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.5.2/lto-wrapper.exe
 Target: mingw32
 Configured with: ../gcc-4.5.2/configure
--enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions
--with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry
--enable-libstdcxx-debug --enable-version-specific-runtime-libs
--disable-werror --build=mingw32 --prefix=/mingw
 Thread model: win32
 gcc version 4.5.2 (GCC) 
 COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=i386' '-march=i386'
 c:/mingw/bin/../libexec/gcc/mingw32/4.5.2/cc1plus.exe -quiet -v -iprefix
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/ appdict.cpp -quiet -dumpbase appdict.cpp
-mtune=i386 -march=i386 -auxbase appdict -version -o
C:\DOCUME~1\9335~1\LOCALS~1\Temp\ccenojSj.s
 GNU C++ (GCC) version 4.5.2 (mingw32)
 compiled by GNU C version 4.5.2, GMP version 5.0.1, MPFR version 2.4.1, MPC
version 0.8.1
 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
 ignoring nonexistent directory
"c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../mingw32/include"
 ignoring duplicate directory
"c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.5.2/include/c++"
 ignoring duplicate directory
"c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.5.2/include/c++/mingw32"
 ignoring duplicate directory
"c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.5.2/include/c++/backward"
 ignoring duplicate directory
"/mingw/lib/gcc/mingw32/4.5.2/../../../../include"
 ignoring duplicate directory "c:/mingw/lib/gcc/../../include"
 ignoring duplicate directory
"c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.5.2/include"
 ignoring duplicate directory
"c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.5.2/include-fixed"
 ignoring nonexistent directory
"c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.5.2/../../../../mingw32/include"
 ignoring duplicate directory "/mingw/include"
 #include "..." search starts here:
 #include <...> search starts here:
 c:\mingw\bin\../lib/gcc/mingw32/4.5.2/include/c++
 c:\mingw\bin\../lib/gcc/mingw32/4.5.2/include/c++/mingw32
 c:\mingw\bin\../lib/gcc/mingw32/4.5.2/include/c++/backward
 c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include
 c:\mingw\bin\../lib/gcc/mingw32/4.5.2/include
 c:\mingw\bin\../lib/gcc/mingw32/4.5.2/include-fixed
 End of search list.
 GNU C++ (GCC) version 4.5.2 (mingw32)
 compiled by GNU C version 4.5.2, GMP version 5.0.1, MPFR version 2.4.1, MPC
version 0.8.1
 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
 Compiler executable checksum: bba7c68567cab1560329ee702fa8a945
 ^C

This bug is a copy from
https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3444236&group_id=2435


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

* [Bug c++/51344] cc1plus hangs when compiling
  2011-11-29 14:06 [Bug c++/51344] New: cc1plus hangs when compiling koliasvskj at gmail dot com
@ 2011-11-29 14:33 ` keithmarshall at mailinator dot com
  2011-12-02 16:10 ` paolo.carlini at oracle dot com
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: keithmarshall at mailinator dot com @ 2011-11-29 14:33 UTC (permalink / raw)
  To: gcc-bugs

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

Keith Marshall <keithmarshall at mailinator dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |keithmarshall at mailinator
                   |                            |dot com

--- Comment #1 from Keith Marshall <keithmarshall at mailinator dot com> 2011-11-29 14:05:24 UTC ---
As noted on the original MinGW bug ticket, this is NOT MinGW specific.  The
OP's test case also causes a compiler hang for me, with Ubuntu's gcc-4.4.5 on
32-bit LinuxMint-10, and also for C. Strauss, with gcc-4.6.1 on an unspecified
64-bit Linux host.


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

* [Bug c++/51344] cc1plus hangs when compiling
  2011-11-29 14:06 [Bug c++/51344] New: cc1plus hangs when compiling koliasvskj at gmail dot com
  2011-11-29 14:33 ` [Bug c++/51344] " keithmarshall at mailinator dot com
@ 2011-12-02 16:10 ` paolo.carlini at oracle dot com
  2011-12-02 18:58 ` koliasvskj at gmail dot com
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-12-02 16:10 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-12-02
     Ever Confirmed|0                           |1

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-12-02 16:09:06 UTC ---
But apparently this issue is very old, I can reproduce with 4.3.x too! Out of
curiosity, which release series worked for you?


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

* [Bug c++/51344] cc1plus hangs when compiling
  2011-11-29 14:06 [Bug c++/51344] New: cc1plus hangs when compiling koliasvskj at gmail dot com
  2011-11-29 14:33 ` [Bug c++/51344] " keithmarshall at mailinator dot com
  2011-12-02 16:10 ` paolo.carlini at oracle dot com
@ 2011-12-02 18:58 ` koliasvskj at gmail dot com
  2012-01-17 11:24 ` ktietz at gcc dot gnu.org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: koliasvskj at gmail dot com @ 2011-12-02 18:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Nickolay Cherney <koliasvskj at gmail dot com> 2011-12-02 18:58:05 UTC ---
(In reply to comment #2)
> But apparently this issue is very old, I can reproduce with 4.3.x too! Out of
> curiosity, which release series worked for you?

It's pretty hard to remember. I guess something about 3.x. I was not at that
project those times but the people which were they quit long time ago. Now it
is semi-forgotten legacy I ought to port some parts from (and this made me a
good few of unexpected troubles).


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

* [Bug c++/51344] cc1plus hangs when compiling
  2011-11-29 14:06 [Bug c++/51344] New: cc1plus hangs when compiling koliasvskj at gmail dot com
                   ` (2 preceding siblings ...)
  2011-12-02 18:58 ` koliasvskj at gmail dot com
@ 2012-01-17 11:24 ` ktietz at gcc dot gnu.org
  2012-01-18 20:27 ` [Bug c++/51344] [4.4/4.5/4.6/4.7 regression] " jason at gcc dot gnu.org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ktietz at gcc dot gnu.org @ 2012-01-17 11:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Kai Tietz <ktietz at gcc dot gnu.org> 2012-01-17 11:09:13 UTC ---
I investigated a bit and the cause for the endless loop is, that the
attribute-list for this decl is pointing to itself.  So in loops for ever in
private_lookup_attribute.

I get following backtrace in gdb for it

#0  0x0068853f in private_lookup_attribute (attr_name=0x100e1c8 "gnu_inline",
    attr_len=10, list=0x7ee3ce58) at ../../gcc/gcc/tree.c:5254
#1  0x00446308 in start_preparsed_function (decl1=0x7ee71880, attrs=0x0,
    flags=3) at ../../gcc/gcc/tree.h:4592
#2  0x0051d4b8 in cp_parser_type_specifier (parser=0x7ee80ce8,
    flags=<value optimized out>, decl_specs=0x5a4ca8c,
    is_declaration=1 '\001', declares_class_or_enum=0x5a4ca44,
    is_cv_qualifier=0x5a4ca4b "") at ../../gcc/gcc/cp/parser.c:21675
#3  0x00530f82 in cp_parser_decl_specifier_seq (parser=0x7ee80ce8, flags=1,
    decl_specs=0x5a4ca8c, declares_class_or_enum=0x5a4cae4)
    at ../../gcc/gcc/cp/parser.c:10696
#4  0x00537588 in cp_parser_single_declaration (parser=0x7ee80ce8,
    checks=0x0, member_p=0 '\0', explicit_specialization_p=0 '\0',
    friend_p=0x5a4cb4b "") at ../../gcc/gcc/cp/parser.c:21271
#5  0x00537a23 in cp_parser_template_declaration_after_export (
    parser=0x7ee80ce8, member_p=30 '\036') at ../../gcc/gcc/cp/parser.c:21157
#6  0x00541749 in cp_parser_declaration (parser=0x7ee80ce8)
    at ../../gcc/gcc/cp/parser.c:10160


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

* [Bug c++/51344] [4.4/4.5/4.6/4.7 regression] cc1plus hangs when compiling
  2011-11-29 14:06 [Bug c++/51344] New: cc1plus hangs when compiling koliasvskj at gmail dot com
                   ` (3 preceding siblings ...)
  2012-01-17 11:24 ` ktietz at gcc dot gnu.org
@ 2012-01-18 20:27 ` jason at gcc dot gnu.org
  2012-01-19 13:56 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2012-01-18 20:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org
      Known to work|                            |4.2.5
            Summary|cc1plus hangs when          |[4.4/4.5/4.6/4.7
                   |compiling                   |regression] cc1plus hangs
                   |                            |when compiling
      Known to fail|                            |4.3.6, 4.4.7, 4.5.4, 4.6.3,
                   |                            |4.7.0

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2012-01-18 20:06:48 UTC ---
The testcase compiles in 4.2; I think that is because we silently ignored the
attribute.


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

* [Bug c++/51344] [4.4/4.5/4.6/4.7 regression] cc1plus hangs when compiling
  2011-11-29 14:06 [Bug c++/51344] New: cc1plus hangs when compiling koliasvskj at gmail dot com
                   ` (4 preceding siblings ...)
  2012-01-18 20:27 ` [Bug c++/51344] [4.4/4.5/4.6/4.7 regression] " jason at gcc dot gnu.org
@ 2012-01-19 13:56 ` rguenth at gcc dot gnu.org
  2012-01-19 22:29 ` ktietz at gcc dot gnu.org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-01-19 13:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
           Priority|P3                          |P2
   Target Milestone|---                         |4.4.7


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

* [Bug c++/51344] [4.4/4.5/4.6/4.7 regression] cc1plus hangs when compiling
  2011-11-29 14:06 [Bug c++/51344] New: cc1plus hangs when compiling koliasvskj at gmail dot com
                   ` (5 preceding siblings ...)
  2012-01-19 13:56 ` rguenth at gcc dot gnu.org
@ 2012-01-19 22:29 ` ktietz at gcc dot gnu.org
  2012-01-19 23:04 ` ktietz at gcc dot gnu.org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ktietz at gcc dot gnu.org @ 2012-01-19 22:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Kai Tietz <ktietz at gcc dot gnu.org> 2012-01-19 22:15:30 UTC ---
Author: ktietz
Date: Thu Jan 19 22:15:26 2012
New Revision: 183313

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183313
Log:
2012-01-19  Kai Tietz  <ktietz@redhat.com>

        PR c++/51344
        * decl2.c (save_template_attributes): Use merge_attributes
        instead of chaining up via TREE_CHAIN.

2012-01-19  Kai Tietz  <ktietz@redhat.com>

        * g++.dg/torture/pr51344.C: New test.


Added:
    trunk/gcc/testsuite/g++.dg/torture/pr51344.C   (with props)
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl2.c
    trunk/gcc/testsuite/ChangeLog

Propchange: trunk/gcc/testsuite/g++.dg/torture/pr51344.C
            ('svn:eol-style' added)

Propchange: trunk/gcc/testsuite/g++.dg/torture/pr51344.C
            ('svn:mime-type' added)


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

* [Bug c++/51344] [4.4/4.5/4.6/4.7 regression] cc1plus hangs when compiling
  2011-11-29 14:06 [Bug c++/51344] New: cc1plus hangs when compiling koliasvskj at gmail dot com
                   ` (6 preceding siblings ...)
  2012-01-19 22:29 ` ktietz at gcc dot gnu.org
@ 2012-01-19 23:04 ` ktietz at gcc dot gnu.org
  2012-01-19 23:09 ` ktietz at gcc dot gnu.org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ktietz at gcc dot gnu.org @ 2012-01-19 23:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Kai Tietz <ktietz at gcc dot gnu.org> 2012-01-19 22:34:35 UTC ---
Author: ktietz
Date: Thu Jan 19 22:34:29 2012
New Revision: 183315

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183315
Log:
        Backport from trunk
        PR c++/51344
        * decl2.c (save_template_attributes): Use merge_attributes
        instead of chaining up via TREE_CHAIN.

        * g++.dg/torture/pr51344.C: New test.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/torture/pr51344.C   (with
props)
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/decl2.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog

Propchange: branches/gcc-4_6-branch/gcc/testsuite/g++.dg/torture/pr51344.C
            ('svn:eol-style' added)

Propchange: branches/gcc-4_6-branch/gcc/testsuite/g++.dg/torture/pr51344.C
            ('svn:mime-type' added)


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

* [Bug c++/51344] [4.4/4.5/4.6/4.7 regression] cc1plus hangs when compiling
  2011-11-29 14:06 [Bug c++/51344] New: cc1plus hangs when compiling koliasvskj at gmail dot com
                   ` (7 preceding siblings ...)
  2012-01-19 23:04 ` ktietz at gcc dot gnu.org
@ 2012-01-19 23:09 ` ktietz at gcc dot gnu.org
  2012-01-19 23:13 ` ktietz at gcc dot gnu.org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ktietz at gcc dot gnu.org @ 2012-01-19 23:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Kai Tietz <ktietz at gcc dot gnu.org> 2012-01-19 22:57:39 UTC ---
Author: ktietz
Date: Thu Jan 19 22:57:31 2012
New Revision: 183318

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183318
Log:
        Backmerged from trunk
        PR c++/51344
        * decl2.c (save_template_attributes): Use merge_attributes
        instead of chaining up via TREE_CHAIN.

        * g++.dg/torture/pr51344.C: New test.


Added:
    branches/gcc-4_5-branch/gcc/testsuite/g++.dg/torture/pr51344.C
Modified:
    branches/gcc-4_5-branch/gcc/cp/ChangeLog
    branches/gcc-4_5-branch/gcc/cp/decl2.c
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/51344] [4.4/4.5/4.6/4.7 regression] cc1plus hangs when compiling
  2011-11-29 14:06 [Bug c++/51344] New: cc1plus hangs when compiling koliasvskj at gmail dot com
                   ` (8 preceding siblings ...)
  2012-01-19 23:09 ` ktietz at gcc dot gnu.org
@ 2012-01-19 23:13 ` ktietz at gcc dot gnu.org
  2012-01-19 23:16 ` ktietz at gcc dot gnu.org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ktietz at gcc dot gnu.org @ 2012-01-19 23:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Kai Tietz <ktietz at gcc dot gnu.org> 2012-01-19 23:07:09 UTC ---
Author: ktietz
Date: Thu Jan 19 23:07:01 2012
New Revision: 183319

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183319
Log:
        Backmerged from trunk
        PR c++/51344
        * decl2.c (save_template_attributes): Use merge_attributes
        instead of chaining up via TREE_CHAIN.

        * g++.dg/torture/pr51344.C: New test.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr51344.C
Modified:
    branches/gcc-4_4-branch/gcc/cp/ChangeLog
    branches/gcc-4_4-branch/gcc/cp/decl2.c
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/51344] [4.4/4.5/4.6/4.7 regression] cc1plus hangs when compiling
  2011-11-29 14:06 [Bug c++/51344] New: cc1plus hangs when compiling koliasvskj at gmail dot com
                   ` (9 preceding siblings ...)
  2012-01-19 23:13 ` ktietz at gcc dot gnu.org
@ 2012-01-19 23:16 ` ktietz at gcc dot gnu.org
  2021-04-29 18:42 ` cvs-commit at gcc dot gnu.org
  2022-01-27 21:55 ` cvs-commit at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: ktietz at gcc dot gnu.org @ 2012-01-19 23:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #10 from Kai Tietz <ktietz at gcc dot gnu.org> 2012-01-19 23:09:04 UTC ---
Fixed.


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

* [Bug c++/51344] [4.4/4.5/4.6/4.7 regression] cc1plus hangs when compiling
  2011-11-29 14:06 [Bug c++/51344] New: cc1plus hangs when compiling koliasvskj at gmail dot com
                   ` (10 preceding siblings ...)
  2012-01-19 23:16 ` ktietz at gcc dot gnu.org
@ 2021-04-29 18:42 ` cvs-commit at gcc dot gnu.org
  2022-01-27 21:55 ` cvs-commit at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-29 18:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:a0fdff3cf33f72848d3f894272431a5d49fe6a16

commit r12-299-ga0fdff3cf33f72848d3f894272431a5d49fe6a16
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Feb 5 10:36:49 2021 -0500

    c++: Fix friend attributes [PR51344]

    51344 was a problem with calling save_template_attributes twice for the
same
    friend function: once from do_friend and once from grokmethod.  The 2012
    patch for the bug avoided creating an infinite loop when this happens, but
    it's better to avoid the duplication in the first place.  This also
restores
    the dependent attributes to the beginning of the attribute list, as
    originally intended.  And then apply_late_template_attributes can avoid
    copying the non-dependent attributes.

    gcc/cp/ChangeLog:

            PR c++/51344
            * decl2.c (grokfield): Call cplus_decl_attributes for friend.
            (save_template_attributes): Use chainon.
            * friend.c (do_friend): Remove attrlist parm.
            * cp-tree.h (do_friend): Adjust.
            * class.c (add_implicitly_declared_members): Adjust.
            * decl.c (grokdeclarator): Adjust.
            * pt.c (apply_late_template_attributes): Optimize.

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

* [Bug c++/51344] [4.4/4.5/4.6/4.7 regression] cc1plus hangs when compiling
  2011-11-29 14:06 [Bug c++/51344] New: cc1plus hangs when compiling koliasvskj at gmail dot com
                   ` (11 preceding siblings ...)
  2021-04-29 18:42 ` cvs-commit at gcc dot gnu.org
@ 2022-01-27 21:55 ` cvs-commit at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-27 21:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:66b86171188dcb61d2d0e0a4a98a7467e58a84a7

commit r12-6904-g66b86171188dcb61d2d0e0a4a98a7467e58a84a7
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Jan 27 16:12:18 2022 -0500

    c++: dependent and non-dependent attributes [PR104245]

    A flaw in my patch for PR51344 was that cplus_decl_attributes calls
    decl_attributes after save_template_attributes, which messes up the
ordering
    that save_template_attributes set up.  Fixed by splitting
    save_template_attributes around the call to decl_attributes.

            PR c++/104245
            PR c++/51344

    gcc/cp/ChangeLog:

            * decl2.cc (save_template_attributes): Take late attrs as parm.
            (cplus_decl_attributes): Call it after decl_attributes,
            splice_template_attributes before.

    gcc/testsuite/ChangeLog:

            * g++.dg/lto/alignas1_0.C: New test.

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

end of thread, other threads:[~2022-01-27 21:55 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-29 14:06 [Bug c++/51344] New: cc1plus hangs when compiling koliasvskj at gmail dot com
2011-11-29 14:33 ` [Bug c++/51344] " keithmarshall at mailinator dot com
2011-12-02 16:10 ` paolo.carlini at oracle dot com
2011-12-02 18:58 ` koliasvskj at gmail dot com
2012-01-17 11:24 ` ktietz at gcc dot gnu.org
2012-01-18 20:27 ` [Bug c++/51344] [4.4/4.5/4.6/4.7 regression] " jason at gcc dot gnu.org
2012-01-19 13:56 ` rguenth at gcc dot gnu.org
2012-01-19 22:29 ` ktietz at gcc dot gnu.org
2012-01-19 23:04 ` ktietz at gcc dot gnu.org
2012-01-19 23:09 ` ktietz at gcc dot gnu.org
2012-01-19 23:13 ` ktietz at gcc dot gnu.org
2012-01-19 23:16 ` ktietz at gcc dot gnu.org
2021-04-29 18:42 ` cvs-commit at gcc dot gnu.org
2022-01-27 21:55 ` cvs-commit 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).