Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: gcc
Version: 1.0
Hardware: ia64
OS: Linux
low
low
Target Milestone: ---
Assignee: Vladimir Makarov
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-07-19 23:46 UTC by hjl
Modified: 2006-03-11 03:37 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2003-07-23 17:15:16 UTC
Embargoed:


Attachments (Terms of Use)

Description hjl 2003-07-19 23:46:15 UTC
[hjl@gnu-3 predicate]$ cat bar.i
void
prefetch (void *p, int s)
{
  if (s)
    __builtin_prefetch (p, 1, 1);
}
[hjl@gnu-3 predicate]$ gcc -Wall -O bar.i -S
[hjl@gnu-3 predicate]$ cat bar.s
        .pred.safe_across_calls p1-p5,p16-p63
        .text
        .align 16
        .global prefetch#
        .proc prefetch#
prefetch:
        .prologue
        .body
        cmp4.eq p6, p7 = 0, r33
        ;;
        lfetch.excl.nt1 [r32]
        br.ret.sptk.many rp
        ;;
        .endp prefetch#

The problem is there is no (p7) before "lfetch.excl.nt1 [r32]". That means

__builtin_prefetch (p, 1, 1);

is always executed even if 's' is 0.

Comment 1 Larry Troan 2003-07-21 12:45:47 UTC
ISSUE TRACKER 26067 opened as sev 3

Comment 2 Vladimir Makarov 2003-07-23 17:15:16 UTC
It is not a bug (at least with user's point of view).  The code generated for
-O1
is the same as for -02 (lprefetch is not predicated).

HJ found that prefetch is predicated in RTL (when -O1) but the corresponding
lprefetch insn
is not predicated in assembler code therefore he reported about this.

I think we should not make a patch (or use already created patch) for gcc
especially on this stage.  

More information could be found in

http://gcc.gnu.org/ml/gcc/2003-07/msg01655.html
http://gcc.gnu.org/ml/gcc/2003-07/msg01657.html



Note You need to log in before you can comment on or make changes to this bug.