public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/35739]  New: [4.3/4.4 regression] ICE with _Decimal128 and va_list
@ 2008-03-28 19:03 reichelt at gcc dot gnu dot org
  2008-03-28 19:04 ` [Bug c/35739] " reichelt at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-03-28 19:03 UTC (permalink / raw)
  To: gcc-bugs

The following valid code snippet triggers an ICE since GCC 4.3.0
when compiled with "-fmudflap -O":

=========================================
_Decimal128 foo(int n, ...)
{ 
  int i;
  _Decimal128 j;
  __builtin_va_list va;
  __builtin_va_start(va,n);
  for (i = 0; i < n; i++)
    j += __builtin_va_arg(va,_Decimal128);
  __builtin_va_end(va);
  return j;
}
=========================================

bug.c: In function 'foo':
bug.c:2: error: invalid operand to binary operator
<retval>

bug.c:2: internal compiler error: verify_stmts failed
Please submit a full bug report, [etc.]


-- 
           Summary: [4.3/4.4 regression] ICE with _Decimal128 and va_list
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, monitored
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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


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

* [Bug c/35739] [4.3/4.4 regression] ICE with _Decimal128 and va_list
  2008-03-28 19:03 [Bug c/35739] New: [4.3/4.4 regression] ICE with _Decimal128 and va_list reichelt at gcc dot gnu dot org
@ 2008-03-28 19:04 ` reichelt at gcc dot gnu dot org
  2008-03-30 20:53 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-03-28 19:04 UTC (permalink / raw)
  To: gcc-bugs



-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.3.1


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


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

* [Bug c/35739] [4.3/4.4 regression] ICE with _Decimal128 and va_list
  2008-03-28 19:03 [Bug c/35739] New: [4.3/4.4 regression] ICE with _Decimal128 and va_list reichelt at gcc dot gnu dot org
  2008-03-28 19:04 ` [Bug c/35739] " reichelt at gcc dot gnu dot org
@ 2008-03-30 20:53 ` pinskia at gcc dot gnu dot org
  2008-04-01  9:19 ` jakub at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-03-30 20:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-03-30 20:52 -------
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-03-30 20:52:57
               date|                            |


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


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

* [Bug c/35739] [4.3/4.4 regression] ICE with _Decimal128 and va_list
  2008-03-28 19:03 [Bug c/35739] New: [4.3/4.4 regression] ICE with _Decimal128 and va_list reichelt at gcc dot gnu dot org
  2008-03-28 19:04 ` [Bug c/35739] " reichelt at gcc dot gnu dot org
  2008-03-30 20:53 ` pinskia at gcc dot gnu dot org
@ 2008-04-01  9:19 ` jakub at gcc dot gnu dot org
  2008-04-01 11:12 ` reichelt at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-04-01  9:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2008-04-01 09:18 -------
Can't reproduce.  What target?


-- 


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


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

* [Bug c/35739] [4.3/4.4 regression] ICE with _Decimal128 and va_list
  2008-03-28 19:03 [Bug c/35739] New: [4.3/4.4 regression] ICE with _Decimal128 and va_list reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-04-01  9:19 ` jakub at gcc dot gnu dot org
@ 2008-04-01 11:12 ` reichelt at gcc dot gnu dot org
  2008-04-02 16:21 ` jakub at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-04-01 11:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from reichelt at gcc dot gnu dot org  2008-04-01 11:11 -------
i686-pc-linux-gnu or x86_64-unknown-linux-gnu (with -m32)


-- 


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


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

* [Bug c/35739] [4.3/4.4 regression] ICE with _Decimal128 and va_list
  2008-03-28 19:03 [Bug c/35739] New: [4.3/4.4 regression] ICE with _Decimal128 and va_list reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-04-01 11:12 ` reichelt at gcc dot gnu dot org
@ 2008-04-02 16:21 ` jakub at gcc dot gnu dot org
  2008-04-15  9:35 ` jakub at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-04-02 16:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2008-04-02 16:20 -------
Heh, I was testing with -m32 and -m64 on 4.3 branch (but that was
--enable-checking=release default) and on the trunk just -m64.  Can reproduce
now.

This seems to be NRV that is creating non-GIMPLE by replacing GIMPLE regs with
<result> which needs to live in memory.

The following patch cures this, though I'm not sure if it can actually
pessimize code:

--- tree-nrv.c.jj       2008-03-19 14:18:00.000000000 +0100
+++ tree-nrv.c  2008-04-02 18:11:14.000000000 +0200
@@ -1,5 +1,5 @@
 /* Language independent return value optimizations
-   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.

 This file is part of GCC.

@@ -115,6 +115,11 @@ tree_nrv (void)
   if (!aggregate_value_p (result, current_function_decl))
     return 0;

+  /* If a GIMPLE type is returned in memory, finalize_nrv_r might create
+     non-GIMPLE.  */
+  if (is_gimple_reg_type (result_type))
+    return 0;
+
   /* Look through each block for assignments to the RESULT_DECL.  */
   FOR_EACH_BB (bb)
     {

The idea is that if found var isn't really an aggregate, but gimple reg, then
1) nvr might create non-GIMPLE as say x = x + 32; can be valid, while <result>
= <result> + 32; where <result> is aggregate_value_p and thus
needs_to_live_in_memory is true for it is invalid GIMPLE (without -fmudflap
just no pass verified that) 2) the replacement might tie hands of the RTL
passes - without the nrv replacement it works with pseudos, but with the nrv
replacement
it suddenly needs to be MEM in all the operations on it.


-- 


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


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

* [Bug c/35739] [4.3/4.4 regression] ICE with _Decimal128 and va_list
  2008-03-28 19:03 [Bug c/35739] New: [4.3/4.4 regression] ICE with _Decimal128 and va_list reichelt at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-04-02 16:21 ` jakub at gcc dot gnu dot org
@ 2008-04-15  9:35 ` jakub at gcc dot gnu dot org
  2008-04-15 18:59 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-04-15  9:35 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

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


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


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

* [Bug c/35739] [4.3/4.4 regression] ICE with _Decimal128 and va_list
  2008-03-28 19:03 [Bug c/35739] New: [4.3/4.4 regression] ICE with _Decimal128 and va_list reichelt at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-04-15  9:35 ` jakub at gcc dot gnu dot org
@ 2008-04-15 18:59 ` jakub at gcc dot gnu dot org
  2008-04-16 16:03 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-04-15 18:59 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-03-30 20:52:57         |2008-04-15 18:58:38
               date|                            |


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


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

* [Bug c/35739] [4.3/4.4 regression] ICE with _Decimal128 and va_list
  2008-03-28 19:03 [Bug c/35739] New: [4.3/4.4 regression] ICE with _Decimal128 and va_list reichelt at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2008-04-15 18:59 ` jakub at gcc dot gnu dot org
@ 2008-04-16 16:03 ` jakub at gcc dot gnu dot org
  2008-04-16 16:11 ` jakub at gcc dot gnu dot org
  2008-04-16 16:12 ` jakub at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-04-16 16:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2008-04-16 16:02 -------
Subject: Bug 35739

Author: jakub
Date: Wed Apr 16 16:01:57 2008
New Revision: 134351

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=134351
Log:
        PR c/35739
        * tree-nrv.c (tree_nrv): Don't optimize if result_type is GIMPLE
        reg type.

        * gcc.dg/dfp/pr35739.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/dfp/pr35739.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-nrv.c


-- 


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


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

* [Bug c/35739] [4.3/4.4 regression] ICE with _Decimal128 and va_list
  2008-03-28 19:03 [Bug c/35739] New: [4.3/4.4 regression] ICE with _Decimal128 and va_list reichelt at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2008-04-16 16:03 ` jakub at gcc dot gnu dot org
@ 2008-04-16 16:11 ` jakub at gcc dot gnu dot org
  2008-04-16 16:12 ` jakub at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-04-16 16:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jakub at gcc dot gnu dot org  2008-04-16 16:10 -------
Subject: Bug 35739

Author: jakub
Date: Wed Apr 16 16:10:04 2008
New Revision: 134354

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=134354
Log:
        PR c/35739
        * tree-nrv.c (tree_nrv): Don't optimize if result_type is GIMPLE
        reg type.

        * gcc.dg/dfp/pr35739.c: New test.

Added:
    branches/gcc-4_3-branch/gcc/testsuite/gcc.dg/dfp/pr35739.c
Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_3-branch/gcc/tree-nrv.c


-- 


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


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

* [Bug c/35739] [4.3/4.4 regression] ICE with _Decimal128 and va_list
  2008-03-28 19:03 [Bug c/35739] New: [4.3/4.4 regression] ICE with _Decimal128 and va_list reichelt at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2008-04-16 16:11 ` jakub at gcc dot gnu dot org
@ 2008-04-16 16:12 ` jakub at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-04-16 16:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jakub at gcc dot gnu dot org  2008-04-16 16:12 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-04-16 16:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-28 19:03 [Bug c/35739] New: [4.3/4.4 regression] ICE with _Decimal128 and va_list reichelt at gcc dot gnu dot org
2008-03-28 19:04 ` [Bug c/35739] " reichelt at gcc dot gnu dot org
2008-03-30 20:53 ` pinskia at gcc dot gnu dot org
2008-04-01  9:19 ` jakub at gcc dot gnu dot org
2008-04-01 11:12 ` reichelt at gcc dot gnu dot org
2008-04-02 16:21 ` jakub at gcc dot gnu dot org
2008-04-15  9:35 ` jakub at gcc dot gnu dot org
2008-04-15 18:59 ` jakub at gcc dot gnu dot org
2008-04-16 16:03 ` jakub at gcc dot gnu dot org
2008-04-16 16:11 ` jakub at gcc dot gnu dot org
2008-04-16 16:12 ` jakub at gcc dot gnu dot 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).