public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/25977] miscompile with classes without copy constructor
  2006-01-26 15:40 [Bug middle-end/25977] New: miscompile with classes without copy constructor mueller at gcc dot gnu dot org
@ 2006-01-26 15:40 ` mueller at gcc dot gnu dot org
  2006-01-26 15:45 ` pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mueller at gcc dot gnu dot org @ 2006-01-26 15:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from mueller at gcc dot gnu dot org  2006-01-26 15:40 -------
Created an attachment (id=10734)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10734&action=view)
testcase


-- 


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


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

* [Bug middle-end/25977]  New: miscompile with classes without copy constructor
@ 2006-01-26 15:40 mueller at gcc dot gnu dot org
  2006-01-26 15:40 ` [Bug middle-end/25977] " mueller at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: mueller at gcc dot gnu dot org @ 2006-01-26 15:40 UTC (permalink / raw)
  To: gcc-bugs

Hmm, the summary is really bad. I'm seeing the attached testcase to fail on
4.2.0 and 4.1.0, both with -O0 and with -O2.


-- 
           Summary: miscompile with classes without copy constructor
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mueller at gcc dot gnu dot org


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


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

* [Bug middle-end/25977] miscompile with classes without copy constructor
  2006-01-26 15:40 [Bug middle-end/25977] New: miscompile with classes without copy constructor mueller at gcc dot gnu dot org
  2006-01-26 15:40 ` [Bug middle-end/25977] " mueller at gcc dot gnu dot org
@ 2006-01-26 15:45 ` pinskia at gcc dot gnu dot org
  2006-01-26 15:48 ` [Bug middle-end/25977] [4.1/4.2 Regression] RSO vs NRV (twice) pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-26 15:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-01-26 15:45 -------
  <retval> = operator& (&<retval>, &r) [return slot optimization];


We cannot do RSO here.


-- 


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


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

* [Bug middle-end/25977] [4.1/4.2 Regression] RSO vs NRV (twice)
  2006-01-26 15:40 [Bug middle-end/25977] New: miscompile with classes without copy constructor mueller at gcc dot gnu dot org
  2006-01-26 15:40 ` [Bug middle-end/25977] " mueller at gcc dot gnu dot org
  2006-01-26 15:45 ` pinskia at gcc dot gnu dot org
@ 2006-01-26 15:48 ` pinskia at gcc dot gnu dot org
  2006-01-26 15:50 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-26 15:48 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org, mmitchel at gcc dot gnu
                   |                            |dot org
           Severity|normal                      |critical
      Known to fail|                            |4.1.0 4.2.0
      Known to work|                            |3.4.0
            Summary|RSO vs NRV (twice)          |[4.1/4.2 Regression] RSO vs
                   |                            |NRV (twice)
   Target Milestone|---                         |4.1.0


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


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

* [Bug middle-end/25977] [4.1/4.2 Regression] RSO vs NRV (twice)
  2006-01-26 15:40 [Bug middle-end/25977] New: miscompile with classes without copy constructor mueller at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-01-26 15:48 ` [Bug middle-end/25977] [4.1/4.2 Regression] RSO vs NRV (twice) pinskia at gcc dot gnu dot org
@ 2006-01-26 15:50 ` pinskia at gcc dot gnu dot org
  2006-01-26 15:54 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-26 15:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-01-26 15:50 -------
Confirmed.  Very much related to PR 19317 so CCing Jason.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu dot org
  BugsThisDependsOn|                            |19317
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to work|3.4.0                       |3.4.0 4.0.3
   Last reconfirmed|0000-00-00 00:00:00         |2006-01-26 15:50:23
               date|                            |


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


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

* [Bug middle-end/25977] [4.1/4.2 Regression] RSO vs NRV (twice)
  2006-01-26 15:40 [Bug middle-end/25977] New: miscompile with classes without copy constructor mueller at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-01-26 15:50 ` pinskia at gcc dot gnu dot org
@ 2006-01-26 15:54 ` pinskia at gcc dot gnu dot org
  2006-01-26 17:36 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-26 15:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2006-01-26 15:54 -------
Hmm:
  (void) (<retval> = *(struct A &) (struct A *) &TARGET_EXPR <D.1827, operator&
(&<retval>, (struct A &) (struct A *) &r)>) >>>
>>;

Maybe it is not fully related to PR 19317 but a different issue really.


-- 


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


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

* [Bug middle-end/25977] [4.1/4.2 Regression] RSO vs NRV (twice)
  2006-01-26 15:40 [Bug middle-end/25977] New: miscompile with classes without copy constructor mueller at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2006-01-26 15:54 ` pinskia at gcc dot gnu dot org
@ 2006-01-26 17:36 ` pinskia at gcc dot gnu dot org
  2006-01-27 16:50 ` jason at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-26 17:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2006-01-26 17:36 -------
*** Bug 25979 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hhinnant at apple dot com


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


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

* [Bug middle-end/25977] [4.1/4.2 Regression] RSO vs NRV (twice)
  2006-01-26 15:40 [Bug middle-end/25977] New: miscompile with classes without copy constructor mueller at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2006-01-26 17:36 ` pinskia at gcc dot gnu dot org
@ 2006-01-27 16:50 ` jason at gcc dot gnu dot org
  2006-02-01  3:01 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu dot org @ 2006-01-27 16:50 UTC (permalink / raw)
  To: gcc-bugs



-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jason at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-01-26 15:50:23         |2006-01-27 16:50:08
               date|                            |


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


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

* [Bug middle-end/25977] [4.1/4.2 Regression] RSO vs NRV (twice)
  2006-01-26 15:40 [Bug middle-end/25977] New: miscompile with classes without copy constructor mueller at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2006-01-27 16:50 ` jason at gcc dot gnu dot org
@ 2006-02-01  3:01 ` mmitchel at gcc dot gnu dot org
  2006-02-03 21:56 ` jason at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-02-01  3:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from mmitchel at gcc dot gnu dot org  2006-02-01 03:01 -------
Jason, do you have an ETA on a fix?


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


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

* [Bug middle-end/25977] [4.1/4.2 Regression] RSO vs NRV (twice)
  2006-01-26 15:40 [Bug middle-end/25977] New: miscompile with classes without copy constructor mueller at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2006-02-01  3:01 ` mmitchel at gcc dot gnu dot org
@ 2006-02-03 21:56 ` jason at gcc dot gnu dot org
  2006-02-03 21:57 ` jason at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu dot org @ 2006-02-03 21:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jason at gcc dot gnu dot org  2006-02-03 21:56 -------
Subject: Bug 25977

Author: jason
Date: Fri Feb  3 21:56:03 2006
New Revision: 110564

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110564
Log:
        PR c++/25979
        * gimplify.c (gimplify_modify_expr_rhs): Disable *& optimization for
now.

        PR middle-end/25977
        * gimplify.c (gimplify_modify_expr_rhs): It's not always safe to do RVO
        on the return slot if it's an NRV.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/opt/nrv10.C
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/opt/nrv11.C
Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/gimplify.c
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/opt/temp1.C


-- 


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


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

* [Bug middle-end/25977] [4.1/4.2 Regression] RSO vs NRV (twice)
  2006-01-26 15:40 [Bug middle-end/25977] New: miscompile with classes without copy constructor mueller at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2006-02-03 21:56 ` jason at gcc dot gnu dot org
@ 2006-02-03 21:57 ` jason at gcc dot gnu dot org
  2006-02-03 21:58 ` jason at gcc dot gnu dot org
  2006-02-05  9:48 ` jakub at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu dot org @ 2006-02-03 21:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jason at gcc dot gnu dot org  2006-02-03 21:57 -------
Subject: Bug 25977

Author: jason
Date: Fri Feb  3 21:57:08 2006
New Revision: 110565

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110565
Log:
        PR c++/25979
        * gimplify.c (gimplify_modify_expr_rhs): Disable *& optimization for
now.

        PR middle-end/25977
        * gimplify.c (gimplify_modify_expr_rhs): It's not always safe to do RVO
        on the return slot if it's an NRV.

Added:
    trunk/gcc/testsuite/g++.dg/opt/nrv10.C
    trunk/gcc/testsuite/g++.dg/opt/nrv11.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gimplify.c
    trunk/gcc/testsuite/g++.dg/opt/temp1.C


-- 


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


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

* [Bug middle-end/25977] [4.1/4.2 Regression] RSO vs NRV (twice)
  2006-01-26 15:40 [Bug middle-end/25977] New: miscompile with classes without copy constructor mueller at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2006-02-03 21:57 ` jason at gcc dot gnu dot org
@ 2006-02-03 21:58 ` jason at gcc dot gnu dot org
  2006-02-05  9:48 ` jakub at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu dot org @ 2006-02-03 21:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jason at gcc dot gnu dot org  2006-02-03 21:57 -------
Fixed.


-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Known to fail|4.1.0 4.2.0                 |
      Known to work|3.4.0 4.0.3                 |3.4.0 4.0.3 4.1.0 4.2.0
           Priority|P1                          |P3
         Resolution|                            |FIXED


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


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

* [Bug middle-end/25977] [4.1/4.2 Regression] RSO vs NRV (twice)
  2006-01-26 15:40 [Bug middle-end/25977] New: miscompile with classes without copy constructor mueller at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2006-02-03 21:58 ` jason at gcc dot gnu dot org
@ 2006-02-05  9:48 ` jakub at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-02-05  9:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jakub at gcc dot gnu dot org  2006-02-05 09:48 -------
This patch introduces a regression
FAIL: g++.dg/opt/complex5.C (test for excess errors)
ICE on at least {i686,s390,s390x}-linux on gcc-4_1-branch in dom2 pass (with
-O2).
At copyrename2 the function is:
double __complex__ elt_zero() ()
{
  doubleD.28 CR.13D.1769;
  doubleD.28 D.1768;
  doubleD.28 CI.12D.1767;
  doubleD.28 CR.11D.1766;
  doubleD.28 rD.1754;
  cdoubleD.1733 zD.1755;
  cdoubleD.1733 aD.1741;
  complex doubleD.32 D.1745;
  complex doubleD.32 a.0D.1744;
  complex doubleD.32 D.1743;

  # BLOCK 0 freq:10000
  # PRED: ENTRY [100.0%]  (fallthru,exec)
  REALPART_EXPR <D.1743_2> = 0.0;
  CR.13D.1769_8 = CR.11D.1766_5 + 1.0e+0;
  D.1745_6 = COMPLEX_EXPR <CR.13D.1769_8, CI.12D.1767_4>;
  CR.13D.1769_1 = CR.13D.1769_8;
  #   <retval>_9 = V_MAY_DEF <<retval>_3>;
  REALPART_EXPR <<retval>> = CR.13D.1769_1;
  #   <retval>_10 = V_MAY_DEF <<retval>_9>;
  IMAGPART_EXPR <<retval>> = 0.0;
  #   VUSE <<retval>_10>;
  return <retval>;
  # SUCC: EXIT [100.0%]

}

In simple_iv_increment_p
1738      phi = SSA_NAME_DEF_STMT (preinc);
1739      if (TREE_CODE (phi) != PHI_NODE)
1740        return false;
phi is NULL.  preinc is:
CR.11D.1761_5


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu dot
                   |                            |org, dnovillo at gcc dot gnu
                   |                            |dot org


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


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

end of thread, other threads:[~2006-02-05  9:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-26 15:40 [Bug middle-end/25977] New: miscompile with classes without copy constructor mueller at gcc dot gnu dot org
2006-01-26 15:40 ` [Bug middle-end/25977] " mueller at gcc dot gnu dot org
2006-01-26 15:45 ` pinskia at gcc dot gnu dot org
2006-01-26 15:48 ` [Bug middle-end/25977] [4.1/4.2 Regression] RSO vs NRV (twice) pinskia at gcc dot gnu dot org
2006-01-26 15:50 ` pinskia at gcc dot gnu dot org
2006-01-26 15:54 ` pinskia at gcc dot gnu dot org
2006-01-26 17:36 ` pinskia at gcc dot gnu dot org
2006-01-27 16:50 ` jason at gcc dot gnu dot org
2006-02-01  3:01 ` mmitchel at gcc dot gnu dot org
2006-02-03 21:56 ` jason at gcc dot gnu dot org
2006-02-03 21:57 ` jason at gcc dot gnu dot org
2006-02-03 21:58 ` jason at gcc dot gnu dot org
2006-02-05  9:48 ` 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).