public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/21538] New: [4.0/4.1 Regression] g++.dg/opt/temp1.C execution test fails
@ 2005-05-12 19:55 jsm28 at gcc dot gnu dot org
  2005-05-12 19:57 ` [Bug middle-end/21538] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2005-05-12 19:55 UTC (permalink / raw)
  To: gcc-bugs

FAIL: g++.dg/opt/temp1.C execution test
has appeared on mainline between 20050511 and 20050512 on multiple targets.
In <http://gcc.gnu.org/ml/gcc-patches/2005-05/msg01158.html>
Jakub Jelinek notes it appears on 4.0 branch as well and blames

> 2005-04-28  Richard Guenther  <rguenth@gcc.gnu.org>
>
>       * fold-const.c (fold_indirect_ref_1): Avoid removing
>       NOP_EXPRs with type qualifiers like const.

-- 
           Summary: [4.0/4.1 Regression] g++.dg/opt/temp1.C execution test
                    fails
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jsm28 at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,jakub at gcc dot gnu dot
                    org,rguenth at gcc dot gnu dot org


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


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

* [Bug middle-end/21538] [4.0/4.1 Regression] g++.dg/opt/temp1.C execution test fails
  2005-05-12 19:55 [Bug tree-optimization/21538] New: [4.0/4.1 Regression] g++.dg/opt/temp1.C execution test fails jsm28 at gcc dot gnu dot org
@ 2005-05-12 19:57 ` pinskia at gcc dot gnu dot org
  2005-05-12 21:59 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-12 19:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-12 19:57 -------
CCing Mark as he wrote the code to fix this testcase in the first place.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mmitchel at gcc dot gnu dot
                   |                            |org
          Component|tree-optimization           |middle-end
           Keywords|                            |missed-optimization
   Target Milestone|---                         |4.0.1


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


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

* [Bug middle-end/21538] [4.0/4.1 Regression] g++.dg/opt/temp1.C execution test fails
  2005-05-12 19:55 [Bug tree-optimization/21538] New: [4.0/4.1 Regression] g++.dg/opt/temp1.C execution test fails jsm28 at gcc dot gnu dot org
  2005-05-12 19:57 ` [Bug middle-end/21538] " pinskia at gcc dot gnu dot org
@ 2005-05-12 21:59 ` pinskia at gcc dot gnu dot org
  2005-05-13  6:18 ` mark at codesourcery dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-12 21:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-12 21:59 -------
Confirmed, though I think the testcase is wrong though if we use memcpy before main.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-05-12 21:59:06
               date|                            |


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


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

* [Bug middle-end/21538] [4.0/4.1 Regression] g++.dg/opt/temp1.C execution test fails
  2005-05-12 19:55 [Bug tree-optimization/21538] New: [4.0/4.1 Regression] g++.dg/opt/temp1.C execution test fails jsm28 at gcc dot gnu dot org
  2005-05-12 19:57 ` [Bug middle-end/21538] " pinskia at gcc dot gnu dot org
  2005-05-12 21:59 ` pinskia at gcc dot gnu dot org
@ 2005-05-13  6:18 ` mark at codesourcery dot com
  2005-05-13  9:52 ` rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mark at codesourcery dot com @ 2005-05-13  6:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mark at codesourcery dot com  2005-05-13 06:18 -------
Subject: Re:  [4.0/4.1 Regression] g++.dg/opt/temp1.C
 execution test fails

pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-12 21:59 -------
> Confirmed, though I think the testcase is wrong though if we use memcpy before main.

Why do you think that's wrong?



-- 


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


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

* [Bug middle-end/21538] [4.0/4.1 Regression] g++.dg/opt/temp1.C execution test fails
  2005-05-12 19:55 [Bug tree-optimization/21538] New: [4.0/4.1 Regression] g++.dg/opt/temp1.C execution test fails jsm28 at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-05-13  6:18 ` mark at codesourcery dot com
@ 2005-05-13  9:52 ` rguenth at gcc dot gnu dot org
  2005-05-14 15:42 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-05-13  9:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at gcc dot gnu dot org  2005-05-13 09:52 -------
The testcase is fine.  We just optimize it no more with the STRIP_TYPE_NOPS
change.  This change was to avoid stripping type qualifiers such as const
from lvalues - so we might need to use some other type stripping mechanism
that preserves the current optimizations but avoids stripping qualifiers
(we shouldn't strip a volatile qualifier from rvalues, too, f.i., but stripping
a const qualifier from an rvalue is probably ok).

I know too little about all this to fix it myself, using f.i. 
tree_ssa_useless_type_conversion will again cause const being stripped.

Patch reverted from 4.0 branch.

-- 


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


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

* [Bug middle-end/21538] [4.0/4.1 Regression] g++.dg/opt/temp1.C execution test fails
  2005-05-12 19:55 [Bug tree-optimization/21538] New: [4.0/4.1 Regression] g++.dg/opt/temp1.C execution test fails jsm28 at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-05-13  9:52 ` rguenth at gcc dot gnu dot org
@ 2005-05-14 15:42 ` rguenth at gcc dot gnu dot org
  2005-05-14 16:46 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-05-14 15:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at gcc dot gnu dot org  2005-05-14 15:42 -------
It looks like fold_indirect_ref is not supposed to be used as a generic folder,
but explicitly to strip these const casts.  So the bug I tried to fix with this 
has to be fixed elsewhere!?

Reverted from mainline.

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


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


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

* [Bug middle-end/21538] [4.0/4.1 Regression] g++.dg/opt/temp1.C execution test fails
  2005-05-12 19:55 [Bug tree-optimization/21538] New: [4.0/4.1 Regression] g++.dg/opt/temp1.C execution test fails jsm28 at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2005-05-14 15:42 ` rguenth at gcc dot gnu dot org
@ 2005-05-14 16:46 ` pinskia at gcc dot gnu dot org
  2005-05-15 19:30 ` [Bug middle-end/21538] g++.dg/opt/temp1.C should be optimized elsewhere rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-14 16:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-14 16:46 -------
(In reply to comment #5)
> It looks like fold_indirect_ref is not supposed to be used as a generic folder,
> but explicitly to strip these const casts.  So the bug I tried to fix with this 
> has to be fixed elsewhere!?

Note I don't believe that is true, but this is why having no real type system and just making it up as we 
go is bad.

-- 


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


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

* [Bug middle-end/21538] g++.dg/opt/temp1.C should be optimized elsewhere
  2005-05-12 19:55 [Bug tree-optimization/21538] New: [4.0/4.1 Regression] g++.dg/opt/temp1.C execution test fails jsm28 at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2005-05-14 16:46 ` pinskia at gcc dot gnu dot org
@ 2005-05-15 19:30 ` rguenth at gcc dot gnu dot org
  2005-05-16  0:18 ` mark at codesourcery dot com
  2005-06-13  3:33 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-05-15 19:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at gcc dot gnu dot org  2005-05-15 19:30 -------
This optimization should take place in

cp/typeck:build_indirect_ref

where it even tries to do so but fails because it does not strip
NOP_EXPRs before checking for the optimization and also because
same_types_p says const T and T are not equal.  Where we have a
MODIFY_EXPR(T, const T) and the const T coming from argument
conversion to operator=(const T&).  Maybe carrying out the
actual conversion for creating of the MODIFY_EXPR is not
necessary.

In build_indirect_ref we end up with sth like
(struct TD.1679 &) (struct TD.1679 *) &TARGET_EXPR <D.1693, operator+ (&bD.1689,
(struct TD.1679 &) (struct TD.1679 *) &cD.1690)>
when the only thing we are doing is a conversion from T& to const T&.

Deferred to someone knowing the C++ frontend - this optimization certainly
should take place there.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |
            Summary|[4.0/4.1 Regression]        |g++.dg/opt/temp1.C should be
                   |g++.dg/opt/temp1.C execution|optimized elsewhere
                   |test fails                  |


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


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

* [Bug middle-end/21538] g++.dg/opt/temp1.C should be optimized elsewhere
  2005-05-12 19:55 [Bug tree-optimization/21538] New: [4.0/4.1 Regression] g++.dg/opt/temp1.C execution test fails jsm28 at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2005-05-15 19:30 ` [Bug middle-end/21538] g++.dg/opt/temp1.C should be optimized elsewhere rguenth at gcc dot gnu dot org
@ 2005-05-16  0:18 ` mark at codesourcery dot com
  2005-06-13  3:33 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: mark at codesourcery dot com @ 2005-05-16  0:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mark at codesourcery dot com  2005-05-16 00:17 -------
Subject: Re:  g++.dg/opt/temp1.C should be optimized
 elsewhere

rguenth at gcc dot gnu dot org wrote:
> ------- Additional Comments From rguenth at gcc dot gnu dot org  2005-05-15 19:30 -------
> This optimization should take place in
> 
> cp/typeck:build_indirect_ref
> 
> where it even tries to do so but fails because it does not strip
> NOP_EXPRs before checking for the optimization and also because
> same_types_p says const T and T are not equal.

They're not equal, and I don't think this should be fixed in 
build_indirect_ref.  It definitely seems like something that should be 
optimized in the middle end.

In any case, given that you've kindly reverted your patch, is there any 
reason that the 4.0.1 target milestone is still on this PR, or may I 
remove it?



-- 


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


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

* [Bug middle-end/21538] g++.dg/opt/temp1.C should be optimized elsewhere
  2005-05-12 19:55 [Bug tree-optimization/21538] New: [4.0/4.1 Regression] g++.dg/opt/temp1.C execution test fails jsm28 at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2005-05-16  0:18 ` mark at codesourcery dot com
@ 2005-06-13  3:33 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-13  3:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-13 03:33 -------
Lets close this as invalid for now.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |INVALID


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


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

end of thread, other threads:[~2005-06-13  3:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-12 19:55 [Bug tree-optimization/21538] New: [4.0/4.1 Regression] g++.dg/opt/temp1.C execution test fails jsm28 at gcc dot gnu dot org
2005-05-12 19:57 ` [Bug middle-end/21538] " pinskia at gcc dot gnu dot org
2005-05-12 21:59 ` pinskia at gcc dot gnu dot org
2005-05-13  6:18 ` mark at codesourcery dot com
2005-05-13  9:52 ` rguenth at gcc dot gnu dot org
2005-05-14 15:42 ` rguenth at gcc dot gnu dot org
2005-05-14 16:46 ` pinskia at gcc dot gnu dot org
2005-05-15 19:30 ` [Bug middle-end/21538] g++.dg/opt/temp1.C should be optimized elsewhere rguenth at gcc dot gnu dot org
2005-05-16  0:18 ` mark at codesourcery dot com
2005-06-13  3:33 ` pinskia 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).