Bug 99456

Summary:
Product: [Retired] Red Hat Raw Hide Reporter: hjl
Component: gccAssignee: Vladimir Makarov <vmakarov>
Status: CLOSED NOTABUG QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 1.0CC: tao
Target Milestone: ---   
Target Release: ---   
Hardware: ia64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-07-23 17:15:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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