public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/46781] New: [4.6 Regression] Missing optimization
@ 2010-12-03 12:36 d.g.gorbachev at gmail dot com
  2010-12-03 12:38 ` [Bug tree-optimization/46781] " d.g.gorbachev at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2010-12-03 12:36 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [4.6 Regression] Missing optimization
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: d.g.gorbachev@gmail.com


Created attachment 22612
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22612
Code produced by GCC 4.6.0

Compiled with -O2


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

* [Bug tree-optimization/46781] [4.6 Regression] Missing optimization
  2010-12-03 12:36 [Bug tree-optimization/46781] New: [4.6 Regression] Missing optimization d.g.gorbachev at gmail dot com
@ 2010-12-03 12:38 ` d.g.gorbachev at gmail dot com
  2010-12-03 13:55 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2010-12-03 12:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> 2010-12-03 12:38:03 UTC ---
Created attachment 22613
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22613
Code produced by GCC 4.5.2

C source is in attachment 19980.


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

* [Bug tree-optimization/46781] [4.6 Regression] Missing optimization
  2010-12-03 12:36 [Bug tree-optimization/46781] New: [4.6 Regression] Missing optimization d.g.gorbachev at gmail dot com
  2010-12-03 12:38 ` [Bug tree-optimization/46781] " d.g.gorbachev at gmail dot com
@ 2010-12-03 13:55 ` rguenth at gcc dot gnu.org
  2010-12-03 15:39 ` d.g.gorbachev at gmail dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-12-03 13:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2010.12.03 13:55:38
   Target Milestone|---                         |4.6.0
     Ever Confirmed|0                           |1

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-12-03 13:55:38 UTC ---
Confirmed.  GCC 4.5 tree DSE removes the first store to p:

fun (void * * q)
{
  void * r;
  void * * p.1;

<bb 2>:
  p.1_1 = p;
  p = 0B;
  r_3 = *q_2(D);
  p = p.1_1;
  return r_3;

and then PRE figures out the redundant store.

4.6 correctly preserves the store to p as the read from *q aliases it
(4.5 type-based aliasing concludes that void * doesn't alias void **,
something that people regularly get wrong thus I dumbed down TBAA).

Where did you get this testcase from?

To illustrate the difference, the following testcase is not optimized
by GCC 4.5 either (and that's required):

extern void **p;

void **fun (void ***q)
{
  void **t;
  void **r;

  t = p;
  p = 0;
  r = *q;
  p = t;

  return r;
}

The observed change is caused by:

2010-08-25  Richard Guenther  <rguenther@suse.de>

        * alias.c (get_alias_set): Assign a single alias-set to all pointers.
        * gimple.c (gimple_get_alias_set): Remove special handling
        for pointers.


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

* [Bug tree-optimization/46781] [4.6 Regression] Missing optimization
  2010-12-03 12:36 [Bug tree-optimization/46781] New: [4.6 Regression] Missing optimization d.g.gorbachev at gmail dot com
  2010-12-03 12:38 ` [Bug tree-optimization/46781] " d.g.gorbachev at gmail dot com
  2010-12-03 13:55 ` rguenth at gcc dot gnu.org
@ 2010-12-03 15:39 ` d.g.gorbachev at gmail dot com
  2011-01-03 20:32 ` rguenth at gcc dot gnu.org
  2011-02-03  8:55 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2010-12-03 15:39 UTC (permalink / raw)
  To: gcc-bugs

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

Dmitry Gorbachev <d.g.gorbachev at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #22612|application/octet-stream    |text/plain
          mime type|                            |

--- Comment #3 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> 2010-12-03 15:39:16 UTC ---
Comment on attachment 22612
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22612
Code produced by GCC 4.6.0

(In reply to comment #2)
> Where did you get this testcase from?

May I know why do you ask?

IIRC, it was distilled from some large program. There was a difference when
compiling it with and without LTO, and I reported it as a bug 43201.


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

* [Bug tree-optimization/46781] [4.6 Regression] Missing optimization
  2010-12-03 12:36 [Bug tree-optimization/46781] New: [4.6 Regression] Missing optimization d.g.gorbachev at gmail dot com
                   ` (2 preceding siblings ...)
  2010-12-03 15:39 ` d.g.gorbachev at gmail dot com
@ 2011-01-03 20:32 ` rguenth at gcc dot gnu.org
  2011-02-03  8:55 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-01-03 20:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-01-03 20:31:55 UTC ---
(In reply to comment #3)
> Comment on attachment 22612 [details]
> Code produced by GCC 4.6.0
> 
> (In reply to comment #2)
> > Where did you get this testcase from?
> 
> May I know why do you ask?

To see if the change indeed causes important regressions in real-world
code.  The change was done to be less surprising when doing TBAA based
disambiguations as people regularly expect void * to be similar to char *
and also do not really handle multiple-indirect pointers the correct
way.  Thus, we now miscompile less not strictly conforming programs.

> IIRC, it was distilled from some large program. There was a difference when
> compiling it with and without LTO, and I reported it as a bug 43201.

Ah, that explains it (LTO did the pointer TBAA thing for a long time).


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

* [Bug tree-optimization/46781] [4.6 Regression] Missing optimization
  2010-12-03 12:36 [Bug tree-optimization/46781] New: [4.6 Regression] Missing optimization d.g.gorbachev at gmail dot com
                   ` (3 preceding siblings ...)
  2011-01-03 20:32 ` rguenth at gcc dot gnu.org
@ 2011-02-03  8:55 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-02-03  8:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jakub at gcc dot gnu.org
         Resolution|                            |WONTFIX

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-02-03 08:55:23 UTC ---
The change was intentional.


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

end of thread, other threads:[~2011-02-03  8:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-03 12:36 [Bug tree-optimization/46781] New: [4.6 Regression] Missing optimization d.g.gorbachev at gmail dot com
2010-12-03 12:38 ` [Bug tree-optimization/46781] " d.g.gorbachev at gmail dot com
2010-12-03 13:55 ` rguenth at gcc dot gnu.org
2010-12-03 15:39 ` d.g.gorbachev at gmail dot com
2011-01-03 20:32 ` rguenth at gcc dot gnu.org
2011-02-03  8:55 ` jakub 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).