public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/46862] New: ICE on std::decimal::decimal32 without any fields
@ 2010-12-09 11:20 jakub at gcc dot gnu.org
  2010-12-09 11:25 ` [Bug c++/46862] " jakub at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-12-09 11:20 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: ICE on std::decimal::decimal32 without any fields
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org


int foo ();
static __typeof (foo) bar __attribute__ ((__weakref__ ("foo")));
namespace std
{
  namespace decimal
  {
    class decimal32;
    template <class> struct S { };
    template <> struct S <decimal32> { static const bool value = true; };
    template <class> class T { };
    class decimal32 : public T <decimal32> { };
  }
}

ICEs during mangling, as first_field returns NULL.


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

* [Bug c++/46862] ICE on std::decimal::decimal32 without any fields
  2010-12-09 11:20 [Bug c++/46862] New: ICE on std::decimal::decimal32 without any fields jakub at gcc dot gnu.org
@ 2010-12-09 11:25 ` jakub at gcc dot gnu.org
  2010-12-09 18:42 ` janis at gcc dot gnu.org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-12-09 11:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-12-09 11:25:08 UTC ---
Not sure if we should error out if a TYPE_TRANSPARENT_AGGR doesn't in the end
have any fields, or simply mangle them normally if first_field returns NULL,
but we shouldn't ICE on it.


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

* [Bug c++/46862] ICE on std::decimal::decimal32 without any fields
  2010-12-09 11:20 [Bug c++/46862] New: ICE on std::decimal::decimal32 without any fields jakub at gcc dot gnu.org
  2010-12-09 11:25 ` [Bug c++/46862] " jakub at gcc dot gnu.org
@ 2010-12-09 18:42 ` janis at gcc dot gnu.org
  2010-12-09 18:46 ` jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: janis at gcc dot gnu.org @ 2010-12-09 18:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Janis Johnson <janis at gcc dot gnu.org> 2010-12-09 18:42:13 UTC ---
TYPE_TRANSPARENT_AGGR is set in begin_class_definition in semantics.c for the
classes std::decimal::decimal{32|64|128}. It assumes that they are defined as
in the GNU Standard C++ Library. That code should probably ICE with a good
message if there is no first field or if the first field doesn't have an
expected type.  If that sounds appropriate I can write a patch.

The C++ compiler would have to know details of other implementations of the
decimal classes in order to pass them as the underlying scalar types.


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

* [Bug c++/46862] ICE on std::decimal::decimal32 without any fields
  2010-12-09 11:20 [Bug c++/46862] New: ICE on std::decimal::decimal32 without any fields jakub at gcc dot gnu.org
  2010-12-09 11:25 ` [Bug c++/46862] " jakub at gcc dot gnu.org
  2010-12-09 18:42 ` janis at gcc dot gnu.org
@ 2010-12-09 18:46 ` jakub at gcc dot gnu.org
  2010-12-09 18:50 ` janis at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-12-09 18:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-12-09 18:46:28 UTC ---
This got reported to us in https://bugzilla.redhat.com/show_bug.cgi?id=657606
but no details about whether it was pristine or modified libdecnumber and which
version thereof.

GCC shouldn't ICE even on invalid input (especially when it doesn't say that it
is invalid), so some form of error message would be useful.


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

* [Bug c++/46862] ICE on std::decimal::decimal32 without any fields
  2010-12-09 11:20 [Bug c++/46862] New: ICE on std::decimal::decimal32 without any fields jakub at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2010-12-09 18:46 ` jakub at gcc dot gnu.org
@ 2010-12-09 18:50 ` janis at gcc dot gnu.org
  2010-12-15  4:00 ` janis at gcc dot gnu.org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: janis at gcc dot gnu.org @ 2010-12-09 18:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Janis Johnson <janis at gcc dot gnu.org> 2010-12-09 18:50:13 UTC ---
This doesn't have anything to do with libdecnumber, it's about how
std::decimal::decimalxx are defined in libstdc++.

Instead of an ICE with a nice message it would be more appropriate to issue a
warning (error?) that GCC can't pass the class the same as the associated
scalar type as required by the ABI, and don't set TYPE_TRANSPARENT_AGGR.


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

* [Bug c++/46862] ICE on std::decimal::decimal32 without any fields
  2010-12-09 11:20 [Bug c++/46862] New: ICE on std::decimal::decimal32 without any fields jakub at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2010-12-09 18:50 ` janis at gcc dot gnu.org
@ 2010-12-15  4:00 ` janis at gcc dot gnu.org
  2011-08-22 10:43 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: janis at gcc dot gnu.org @ 2010-12-15  4:00 UTC (permalink / raw)
  To: gcc-bugs

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

Janis Johnson <janis at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2010.12.15 04:00:43
     Ever Confirmed|0                           |1

--- Comment #5 from Janis Johnson <janis at gcc dot gnu.org> 2010-12-15 04:00:43 UTC ---
I'm working on a fix.


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

* [Bug c++/46862] ICE on std::decimal::decimal32 without any fields
  2010-12-09 11:20 [Bug c++/46862] New: ICE on std::decimal::decimal32 without any fields jakub at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2010-12-15  4:00 ` janis at gcc dot gnu.org
@ 2011-08-22 10:43 ` jakub at gcc dot gnu.org
  2011-08-22 11:58 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-08-22 10:43 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-08-22 10:41:15 UTC ---
*** Bug 50102 has been marked as a duplicate of this bug. ***


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

* [Bug c++/46862] ICE on std::decimal::decimal32 without any fields
  2010-12-09 11:20 [Bug c++/46862] New: ICE on std::decimal::decimal32 without any fields jakub at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-08-22 10:43 ` jakub at gcc dot gnu.org
@ 2011-08-22 11:58 ` jakub at gcc dot gnu.org
  2011-08-22 18:53 ` pthaugen at gcc dot gnu.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-08-22 11:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-08-22 11:26:04 UTC ---
Created attachment 25075
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25075
gcc47-pr46862.patch

Untested fix.


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

* [Bug c++/46862] ICE on std::decimal::decimal32 without any fields
  2010-12-09 11:20 [Bug c++/46862] New: ICE on std::decimal::decimal32 without any fields jakub at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2011-08-22 11:58 ` jakub at gcc dot gnu.org
@ 2011-08-22 18:53 ` pthaugen at gcc dot gnu.org
  2011-08-23 13:24 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pthaugen at gcc dot gnu.org @ 2011-08-22 18:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Pat Haugen <pthaugen at gcc dot gnu.org> 2011-08-22 18:44:01 UTC ---
I've verified the proposed patch fixes the testcase from bug 50102.


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

* [Bug c++/46862] ICE on std::decimal::decimal32 without any fields
  2010-12-09 11:20 [Bug c++/46862] New: ICE on std::decimal::decimal32 without any fields jakub at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2011-08-22 18:53 ` pthaugen at gcc dot gnu.org
@ 2011-08-23 13:24 ` jakub at gcc dot gnu.org
  2011-08-23 13:25 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-08-23 13:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-08-23 13:20:11 UTC ---
Author: jakub
Date: Tue Aug 23 13:20:04 2011
New Revision: 177987

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177987
Log:
    PR c++/46862
    * class.c (finish_struct_1): If TYPE_TRANSPARENT_AGGR is set on a type
    which doesn't have any fields, clear it and diagnose.

    * g++.dg/dfp/nofields.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/dfp/nofields.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/class.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/46862] ICE on std::decimal::decimal32 without any fields
  2010-12-09 11:20 [Bug c++/46862] New: ICE on std::decimal::decimal32 without any fields jakub at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2011-08-23 13:24 ` jakub at gcc dot gnu.org
@ 2011-08-23 13:25 ` jakub at gcc dot gnu.org
  2011-08-23 13:30 ` jakub at gcc dot gnu.org
  2011-09-08 18:11 ` bergner at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-08-23 13:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-08-23 13:23:29 UTC ---
Author: jakub
Date: Tue Aug 23 13:23:22 2011
New Revision: 177988

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177988
Log:
    PR c++/46862
    * class.c (finish_struct_1): If TYPE_TRANSPARENT_AGGR is set on a type
    which doesn't have any fields, clear it and diagnose.

    * g++.dg/dfp/nofields.C: New test.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/dfp/nofields.C
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/class.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/46862] ICE on std::decimal::decimal32 without any fields
  2010-12-09 11:20 [Bug c++/46862] New: ICE on std::decimal::decimal32 without any fields jakub at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2011-08-23 13:25 ` jakub at gcc dot gnu.org
@ 2011-08-23 13:30 ` jakub at gcc dot gnu.org
  2011-09-08 18:11 ` bergner at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-08-23 13:30 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-08-23 13:24:32 UTC ---
Fixed for 4.6+.


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

* [Bug c++/46862] ICE on std::decimal::decimal32 without any fields
  2010-12-09 11:20 [Bug c++/46862] New: ICE on std::decimal::decimal32 without any fields jakub at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2011-08-23 13:30 ` jakub at gcc dot gnu.org
@ 2011-09-08 18:11 ` bergner at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: bergner at gcc dot gnu.org @ 2011-09-08 18:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Peter Bergner <bergner at gcc dot gnu.org> 2011-09-08 18:09:02 UTC ---
Author: bergner
Date: Thu Sep  8 18:08:53 2011
New Revision: 178703

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178703
Log:
gcc/
    Backport from mainline

    2011-08-23  Jakub Jelinek  <jakub@redhat.com>

    PR c++/46862
    * class.c (finish_struct_1): If TYPE_TRANSPARENT_AGGR is set on a type
    which doesn't have any fields, clear it and diagnose.

    2011-08-29  Jakub Jelinek  <jakub@redhat.com>
            Jason Merrill  <jason@redhat.com>

    PR c++/50207
    * class.c (finish_struct_1): Complain if the first field is
    artificial.

gcc/testsuite/
    Backport from mainline
    2011-08-23  Jakub Jelinek  <jakub@redhat.com>

    PR c++/46862
    * g++.dg/dfp/nofields.C: New test.

    2011-08-29  Jakub Jelinek  <jakub@redhat.com>
            Jason Merrill  <jason@redhat.com>

    PR c++/50207
    * g++.dg/dfp/base.C: New test.

Added:
    branches/ibm/gcc-4_5-branch/gcc/testsuite/g++.dg/dfp/base.C
    branches/ibm/gcc-4_5-branch/gcc/testsuite/g++.dg/dfp/nofields.C
Modified:
    branches/ibm/gcc-4_5-branch/gcc/ChangeLog.ibm
    branches/ibm/gcc-4_5-branch/gcc/cp/class.c
    branches/ibm/gcc-4_5-branch/gcc/testsuite/ChangeLog.ibm


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

end of thread, other threads:[~2011-09-08 18:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-09 11:20 [Bug c++/46862] New: ICE on std::decimal::decimal32 without any fields jakub at gcc dot gnu.org
2010-12-09 11:25 ` [Bug c++/46862] " jakub at gcc dot gnu.org
2010-12-09 18:42 ` janis at gcc dot gnu.org
2010-12-09 18:46 ` jakub at gcc dot gnu.org
2010-12-09 18:50 ` janis at gcc dot gnu.org
2010-12-15  4:00 ` janis at gcc dot gnu.org
2011-08-22 10:43 ` jakub at gcc dot gnu.org
2011-08-22 11:58 ` jakub at gcc dot gnu.org
2011-08-22 18:53 ` pthaugen at gcc dot gnu.org
2011-08-23 13:24 ` jakub at gcc dot gnu.org
2011-08-23 13:25 ` jakub at gcc dot gnu.org
2011-08-23 13:30 ` jakub at gcc dot gnu.org
2011-09-08 18:11 ` bergner 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).