public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/44503]  New: "control flow in the middle of basic block" with -fprefetch-loop-arrays
@ 2010-06-11 16:31 changpeng dot fang at amd dot com
  2010-06-11 16:32 ` [Bug c/44503] " changpeng dot fang at amd dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: changpeng dot fang at amd dot com @ 2010-06-11 16:31 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 910 bytes --]

Attached is a test case from gcc regression test. verify_flow_info failed
when I turned on prefetching.

gcc -O3 -fprefetch-loop-arrays setjmp-1.c
setjmp-1.c: In function ‘main’:
setjmp-1.c:17:1: error: control flow in the middle of basic block 20
setjmp-1.c:17:1: error: control flow in the middle of basic block 20
setjmp-1.c:17:1: internal compiler error: verify_flow_info failed
Please submit a full bug report,

Looks like loops with longjmp should not be unrolled.


-- 
           Summary: "control flow in the middle of basic block" with -
                    fprefetch-loop-arrays
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: changpeng dot fang at amd dot com


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


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

* [Bug c/44503] "control flow in the middle of basic block" with -fprefetch-loop-arrays
  2010-06-11 16:31 [Bug c/44503] New: "control flow in the middle of basic block" with -fprefetch-loop-arrays changpeng dot fang at amd dot com
@ 2010-06-11 16:32 ` changpeng dot fang at amd dot com
  2010-06-11 18:46 ` [Bug tree-optimization/44503] " changpeng dot fang at amd dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: changpeng dot fang at amd dot com @ 2010-06-11 16:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from changpeng dot fang at amd dot com  2010-06-11 16:32 -------
Created an attachment (id=20894)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20894&action=view)
prefetching for the while loop?


-- 


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


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

* [Bug tree-optimization/44503] "control flow in the middle of basic block" with -fprefetch-loop-arrays
  2010-06-11 16:31 [Bug c/44503] New: "control flow in the middle of basic block" with -fprefetch-loop-arrays changpeng dot fang at amd dot com
  2010-06-11 16:32 ` [Bug c/44503] " changpeng dot fang at amd dot com
@ 2010-06-11 18:46 ` changpeng dot fang at amd dot com
  2010-06-14 18:29 ` changpeng dot fang at amd dot com
  2010-06-14 22:23 ` changpeng dot fang at amd dot com
  3 siblings, 0 replies; 6+ messages in thread
From: changpeng dot fang at amd dot com @ 2010-06-11 18:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from changpeng dot fang at amd dot com  2010-06-11 18:45 -------
Bug 39398 looks similar but that one seems with except handling instead of
setjmp.


-- 


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


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

* [Bug tree-optimization/44503] "control flow in the middle of basic block" with -fprefetch-loop-arrays
  2010-06-11 16:31 [Bug c/44503] New: "control flow in the middle of basic block" with -fprefetch-loop-arrays changpeng dot fang at amd dot com
  2010-06-11 16:32 ` [Bug c/44503] " changpeng dot fang at amd dot com
  2010-06-11 18:46 ` [Bug tree-optimization/44503] " changpeng dot fang at amd dot com
@ 2010-06-14 18:29 ` changpeng dot fang at amd dot com
  2010-06-14 22:23 ` changpeng dot fang at amd dot com
  3 siblings, 0 replies; 6+ messages in thread
From: changpeng dot fang at amd dot com @ 2010-06-14 18:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from changpeng dot fang at amd dot com  2010-06-14 18:28 -------
Actually, the prefetching is for the following loop:
    for (i = 0; i < p[2]; i++)
      q[i] = 0;

I do not understand why unrolling of this loop affects other part of
the program that has longjmp.


-- 


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


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

* [Bug tree-optimization/44503] "control flow in the middle of basic block" with -fprefetch-loop-arrays
  2010-06-11 16:31 [Bug c/44503] New: "control flow in the middle of basic block" with -fprefetch-loop-arrays changpeng dot fang at amd dot com
                   ` (2 preceding siblings ...)
  2010-06-14 18:29 ` changpeng dot fang at amd dot com
@ 2010-06-14 22:23 ` changpeng dot fang at amd dot com
  3 siblings, 0 replies; 6+ messages in thread
From: changpeng dot fang at amd dot com @ 2010-06-14 22:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from changpeng dot fang at amd dot com  2010-06-14 22:22 -------
There is nothing wrong in the prefetch itself. The problem is 
__builtin_prefetch call used for prefetch instruction. Whenever,
there is a non-local lable in the current function,  the __builtin_prefetch
inserted will be considered as a control flow statement:

is_ctrl_altering_stmt (gimple t)
{
   ....

    /* A non-pure/const call alters flow control if the current
       function has nonlocal labels.  */
    if (!(flags & (ECF_CONST | ECF_PURE)) && cfun->has_nonlocal_label) {
          return true;
    ...
}


-- 


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


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

* [Bug tree-optimization/44503] "control flow in the middle of basic block" with -fprefetch-loop-arrays
       [not found] <bug-44503-4@http.gcc.gnu.org/bugzilla/>
@ 2010-10-19 21:54 ` changpeng.fang at amd dot com
  0 siblings, 0 replies; 6+ messages in thread
From: changpeng.fang at amd dot com @ 2010-10-19 21:54 UTC (permalink / raw)
  To: gcc-bugs

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

Changpeng Fang <changpeng.fang at amd dot com> changed:

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

--- Comment #5 from Changpeng Fang <changpeng.fang at amd dot com> 2010-10-19 21:54:27 UTC ---
This bug is no longer valid for the current gcc trunk. It is
possibly fixed by Honza's CFG work related to leaf attribute.

Anyway, I close this bug.


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

end of thread, other threads:[~2010-10-19 21:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-11 16:31 [Bug c/44503] New: "control flow in the middle of basic block" with -fprefetch-loop-arrays changpeng dot fang at amd dot com
2010-06-11 16:32 ` [Bug c/44503] " changpeng dot fang at amd dot com
2010-06-11 18:46 ` [Bug tree-optimization/44503] " changpeng dot fang at amd dot com
2010-06-14 18:29 ` changpeng dot fang at amd dot com
2010-06-14 22:23 ` changpeng dot fang at amd dot com
     [not found] <bug-44503-4@http.gcc.gnu.org/bugzilla/>
2010-10-19 21:54 ` changpeng.fang at amd dot com

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).