public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/47033] New: loop distribution has problems on sane testcases
@ 2010-12-21 19:19 hubicka at gcc dot gnu.org
  2010-12-28 16:11 ` [Bug middle-end/47033] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: hubicka at gcc dot gnu.org @ 2010-12-21 19:19 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: loop distribution has problems on sane testcases
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hubicka@gcc.gnu.org


The following patch:
Index: predict.c
===================================================================
--- predict.c   (revision 168047)
+++ predict.c   (working copy)
@@ -126,7 +126,7 @@ maybe_hot_frequency_p (int freq)
   if (node->frequency == NODE_FREQUENCY_EXECUTED_ONCE
       && freq <= (ENTRY_BLOCK_PTR->frequency * 2 / 3))
     return false;
-  if (freq < BB_FREQ_MAX / PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION))
+  if (freq < ENTRY_BLOCK_PTR->frequency / PARAM_VALUE
(HOT_BB_FREQUENCY_FRACTION))
     return false;
   return true;
 }
makes the testcase gcc.dg/tree-ssa/ldist-pr45948.c  to fail.

The testcase seems to test if the loop is converted to memsets. The problem is
that with the patch above the code is considered hot and loop gets header
copied as a result the code in loop distribution seems confused.
Profile info is wrong and one copy of loop stays in the code.


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

* [Bug middle-end/47033] loop distribution has problems on sane testcases
  2010-12-21 19:19 [Bug middle-end/47033] New: loop distribution has problems on sane testcases hubicka at gcc dot gnu.org
@ 2010-12-28 16:11 ` rguenth at gcc dot gnu.org
  2010-12-29  5:15 ` spop at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-12-28 16:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |spop at gcc dot gnu.org

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-12-28 16:11:35 UTC ---
I suppose the same problem can be seen if you make the function artificially
hot by calling it from inside a loop.


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

* [Bug middle-end/47033] loop distribution has problems on sane testcases
  2010-12-21 19:19 [Bug middle-end/47033] New: loop distribution has problems on sane testcases hubicka at gcc dot gnu.org
  2010-12-28 16:11 ` [Bug middle-end/47033] " rguenth at gcc dot gnu.org
@ 2010-12-29  5:15 ` spop at gcc dot gnu.org
  2010-12-29 16:13 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: spop at gcc dot gnu.org @ 2010-12-29  5:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Sebastian Pop <spop at gcc dot gnu.org> 2010-12-29 05:15:19 UTC ---
Is the problem that the testcase is too fragile and we have to fix the pattern
expected by the testcase?

I suppose we can just disable the scan for memset and leave the testcase test
for no ICE while compiling it.


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

* [Bug middle-end/47033] loop distribution has problems on sane testcases
  2010-12-21 19:19 [Bug middle-end/47033] New: loop distribution has problems on sane testcases hubicka at gcc dot gnu.org
  2010-12-28 16:11 ` [Bug middle-end/47033] " rguenth at gcc dot gnu.org
  2010-12-29  5:15 ` spop at gcc dot gnu.org
@ 2010-12-29 16:13 ` rguenth at gcc dot gnu.org
  2011-01-01 13:30 ` hubicka at ucw dot cz
  2021-12-26 12:35 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-12-29 16:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2010.12.29 16:12:57
     Ever Confirmed|0                           |1

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-12-29 16:12:57 UTC ---
Loop distribution shouldn't fail if loop header copying was applied and it
would
be nice to know why it does.


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

* [Bug middle-end/47033] loop distribution has problems on sane testcases
  2010-12-21 19:19 [Bug middle-end/47033] New: loop distribution has problems on sane testcases hubicka at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2010-12-29 16:13 ` rguenth at gcc dot gnu.org
@ 2011-01-01 13:30 ` hubicka at ucw dot cz
  2021-12-26 12:35 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: hubicka at ucw dot cz @ 2011-01-01 13:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jan Hubicka <hubicka at ucw dot cz> 2011-01-01 13:29:47 UTC ---
I at least checked in the fix for uninitialized var. It would indeed be nice to
know why the generated code is worse than before.

Honza


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

* [Bug middle-end/47033] loop distribution has problems on sane testcases
  2010-12-21 19:19 [Bug middle-end/47033] New: loop distribution has problems on sane testcases hubicka at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-01-01 13:30 ` hubicka at ucw dot cz
@ 2021-12-26 12:35 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-26 12:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47033

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=43884,
                   |                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=45948,
                   |                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=44334
   Target Milestone|---                         |4.6.0

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jan Hubicka from comment #0)
> The following patch:

Which was committed as r0-106204 with the change of the testcase too but not
the number of memset's so I assume the problem reported here was fixed.


Note r8-18 removed the undefined behavior from the testcase and updated the
testcase, as PRE is able to remove one of the stores even.

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

end of thread, other threads:[~2021-12-26 12:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-21 19:19 [Bug middle-end/47033] New: loop distribution has problems on sane testcases hubicka at gcc dot gnu.org
2010-12-28 16:11 ` [Bug middle-end/47033] " rguenth at gcc dot gnu.org
2010-12-29  5:15 ` spop at gcc dot gnu.org
2010-12-29 16:13 ` rguenth at gcc dot gnu.org
2011-01-01 13:30 ` hubicka at ucw dot cz
2021-12-26 12:35 ` pinskia 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).