public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/47896] New: wrong code with -O -fno-early-inlining -fipa-pta -fno-tree-dominator-opts -fno-tree-forwprop
@ 2011-02-25 19:24 zsojka at seznam dot cz
  2011-02-26 23:28 ` [Bug tree-optimization/47896] " zsojka at seznam dot cz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: zsojka at seznam dot cz @ 2011-02-25 19:24 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: wrong code with -O -fno-early-inlining -fipa-pta
                    -fno-tree-dominator-opts -fno-tree-forwprop
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu


Created attachment 23470
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23470
auto-reduced testcase

Output:
$ g++ -O -fno-early-inlining -fipa-pta -fno-tree-dominator-opts
-fno-tree-forwprop testcase.C
$ ./a.out 
Aborted

Testcase was reduced from g++.dg/torture/pr37922.C, which fails with:
$ g++ -O -fno-early-inlining -fipa-pta -fschedule-insns2
-fno-tree-dominator-opts -fno-tree-forwprop -funroll-loops pr37922.ii
$ ./a.out 
Aborted

Tested revisions:
r170489 - fail


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

* [Bug tree-optimization/47896] wrong code with -O -fno-early-inlining -fipa-pta -fno-tree-dominator-opts -fno-tree-forwprop
  2011-02-25 19:24 [Bug tree-optimization/47896] New: wrong code with -O -fno-early-inlining -fipa-pta -fno-tree-dominator-opts -fno-tree-forwprop zsojka at seznam dot cz
@ 2011-02-26 23:28 ` zsojka at seznam dot cz
  2011-02-27 15:13 ` rguenth at gcc dot gnu.org
  2011-03-01 12:50 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: zsojka at seznam dot cz @ 2011-02-26 23:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Zdenek Sojka <zsojka at seznam dot cz> 2011-02-26 23:16:32 UTC ---
Created attachment 23481
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23481
reduced testcase

$ g++ -O -fno-early-inlining -fipa-pta -fno-tree-dominator-opts
-fno-tree-forwprop pr47896.C             
$ ./a.out 
Aborted

At the assembly level, the problematic line seems to be:
    mov    DWORD PTR [rsp+32], 9    # i9,
which directly stores the constant 9, instead of the updated value 8.
It doesn't seem to crash when compiled as C code.


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

* [Bug tree-optimization/47896] wrong code with -O -fno-early-inlining -fipa-pta -fno-tree-dominator-opts -fno-tree-forwprop
  2011-02-25 19:24 [Bug tree-optimization/47896] New: wrong code with -O -fno-early-inlining -fipa-pta -fno-tree-dominator-opts -fno-tree-forwprop zsojka at seznam dot cz
  2011-02-26 23:28 ` [Bug tree-optimization/47896] " zsojka at seznam dot cz
@ 2011-02-27 15:13 ` rguenth at gcc dot gnu.org
  2011-03-01 12:50 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-02-27 15:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011.02.27 15:01:42
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-02-27 15:01:42 UTC ---
Mine.


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

* [Bug tree-optimization/47896] wrong code with -O -fno-early-inlining -fipa-pta -fno-tree-dominator-opts -fno-tree-forwprop
  2011-02-25 19:24 [Bug tree-optimization/47896] New: wrong code with -O -fno-early-inlining -fipa-pta -fno-tree-dominator-opts -fno-tree-forwprop zsojka at seznam dot cz
  2011-02-26 23:28 ` [Bug tree-optimization/47896] " zsojka at seznam dot cz
  2011-02-27 15:13 ` rguenth at gcc dot gnu.org
@ 2011-03-01 12:50 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-03-01 12:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |alias

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-03-01 12:50:35 UTC ---
This is a failure to handle return-slot-optimization in IPA-PTA properly.  For

  D.2098 = foo (); [return slot optimization]

we have to make foos return function part point to D.2098.  That requires
some re-org, making the function result varinfo always a pointer,
making sure to use *result for result-decl uses (if not DECL_BY_REFERENCE).

I have a patch, but as this bug only affects IPA-PTA I'm defering it to 4.7
as the patch also touches non-IPA parts.


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

end of thread, other threads:[~2011-03-01 12:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-25 19:24 [Bug tree-optimization/47896] New: wrong code with -O -fno-early-inlining -fipa-pta -fno-tree-dominator-opts -fno-tree-forwprop zsojka at seznam dot cz
2011-02-26 23:28 ` [Bug tree-optimization/47896] " zsojka at seznam dot cz
2011-02-27 15:13 ` rguenth at gcc dot gnu.org
2011-03-01 12:50 ` rguenth 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).