public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/11599] New: ia64: gcc generates wrong code when predicate is used
@ 2003-07-19 23:40 hjl at lucon dot org
  2003-07-19 23:41 ` [Bug target/11599] " hjl at lucon dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: hjl at lucon dot org @ 2003-07-19 23:40 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: ia64: gcc generates wrong code when predicate is used
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: critical
          Priority: P1
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl at lucon dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: ia64-unknown-linux-gnu
  GCC host triplet: ia64-unknown-linux-gnu
GCC target triplet: ia64-unknown-linux-gnu

[hjl@gnu-3 predicate]$ cat bar.i
void
prefetch (void *p, int s)
{
  if (s)
    __builtin_prefetch (p, 1, 1);
}
[hjl@gnu-3 predicate]$ make
/usr/gcc-3.4/bin/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.


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

* [Bug target/11599] ia64: gcc generates wrong code when predicate is used
  2003-07-19 23:40 [Bug target/11599] New: ia64: gcc generates wrong code when predicate is used hjl at lucon dot org
@ 2003-07-19 23:41 ` hjl at lucon dot org
  2003-07-19 23:52 ` [Bug optimization/11599] " pinskia at physics dot uc dot edu
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hjl at lucon dot org @ 2003-07-19 23:41 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


hjl at lucon dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-07-19 23:41:01
               date|                            |
   Target Milestone|3.4                         |3.3.2


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

* [Bug optimization/11599] gcc generates wrong code when predicate is used
  2003-07-19 23:40 [Bug target/11599] New: ia64: gcc generates wrong code when predicate is used hjl at lucon dot org
  2003-07-19 23:41 ` [Bug target/11599] " hjl at lucon dot org
@ 2003-07-19 23:52 ` pinskia at physics dot uc dot edu
  2003-07-20  5:04 ` [Bug optimization/11599] gcc generates wrong code when builtins are used hjl at lucon dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-19 23:52 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|target                      |optimization
  GCC build triplet|ia64-unknown-linux-gnu      |
   GCC host triplet|ia64-unknown-linux-gnu      |
 GCC target triplet|ia64-unknown-linux-gnu      |ia64-*-linux-gnu, powerpc-
                   |                            |apple-darwin6.6
            Summary|ia64: gcc generates wrong   |gcc generates wrong code
                   |code when predicate is used |when predicate is used


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-19 23:52 -------
Do not confirm your own bugs, please.  We like to use peer review.
It also happens on powerpc-apple-darwin6.6 so it looks like a generic bug:
_prefetch:
        dcbtst 0,r3
        blr

gcc -S -O -Wall -o - pr11599.c -v -maltivec, where pr11599.c contains:
void t(void *p, int s)
{
  if (s)
    __builtin_altivec_dst (p, 0, 0);
}
produces:
_t:
        li r0,0
        dst r3,r0,0
        blr
So very much a generic bug.


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

* [Bug optimization/11599] gcc generates wrong code when builtins are used
  2003-07-19 23:40 [Bug target/11599] New: ia64: gcc generates wrong code when predicate is used hjl at lucon dot org
  2003-07-19 23:41 ` [Bug target/11599] " hjl at lucon dot org
  2003-07-19 23:52 ` [Bug optimization/11599] " pinskia at physics dot uc dot edu
@ 2003-07-20  5:04 ` hjl at lucon dot org
  2003-07-20 12:00 ` [Bug optimization/11599] gcc generates wrong code when predicate " pinskia at physics dot uc dot edu
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hjl at lucon dot org @ 2003-07-20  5:04 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From hjl at lucon dot org  2003-07-20 05:04 -------
I think they are 2 different bugs.

http://gcc.gnu.org/ml/gcc-patches/2003-07/msg01997.html

fixes the ia64 bug.


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

* [Bug optimization/11599] gcc generates wrong code when predicate are used
  2003-07-19 23:40 [Bug target/11599] New: ia64: gcc generates wrong code when predicate is used hjl at lucon dot org
                   ` (2 preceding siblings ...)
  2003-07-20  5:04 ` [Bug optimization/11599] gcc generates wrong code when builtins are used hjl at lucon dot org
@ 2003-07-20 12:00 ` pinskia at physics dot uc dot edu
  2003-07-20 17:12 ` falk at debian dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-20 12:00 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 GCC target triplet|ia64-*-linux-gnu, powerpc-  |ia64-*-linux-gnu
                   |apple-darwin6.6             |
            Summary|gcc generates wrong code    |gcc generates wrong code
                   |when builtins are used      |when predicate are used


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-20 12:00 -------
There are two different bugs as the powerpc-*-* one is caused by the if-conversion, I will 
file it seperately.


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

* [Bug optimization/11599] gcc generates wrong code when predicate are used
  2003-07-19 23:40 [Bug target/11599] New: ia64: gcc generates wrong code when predicate is used hjl at lucon dot org
                   ` (3 preceding siblings ...)
  2003-07-20 12:00 ` [Bug optimization/11599] gcc generates wrong code when predicate " pinskia at physics dot uc dot edu
@ 2003-07-20 17:12 ` falk at debian dot org
  2003-07-21 17:56 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: falk at debian dot org @ 2003-07-20 17:12 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From falk at debian dot org  2003-07-20 17:12 -------
I'm not convinced this is a bug. __builtin_prefetch is supposed to have no 
visible effect, so gcc should be free to move it out of conditions, as it also
does with arithmetics. Does this also occur with anything else than
__builtin_prefetch?


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

* [Bug optimization/11599] gcc generates wrong code when predicate are used
  2003-07-19 23:40 [Bug target/11599] New: ia64: gcc generates wrong code when predicate is used hjl at lucon dot org
                   ` (4 preceding siblings ...)
  2003-07-20 17:12 ` falk at debian dot org
@ 2003-07-21 17:56 ` cvs-commit at gcc dot gnu dot org
  2003-07-21 18:17 ` pinskia at gcc dot gnu dot org
  2003-07-25 16:31 ` jbuck at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-07-21 17:56 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-07-21 17:56 -------
Subject: Bug 11599

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	hjl@gcc.gnu.org	2003-07-21 17:56:14

Modified files:
	gcc            : ChangeLog 
	gcc/config/ia64: ia64.md 

Log message:
	2003-07-21  H.J. Lu <hongjiu.lu@intel.com>
	
	PR optimization/11599
	* config/ia64/ia64.md (prefetch): Support predicate.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.679&r2=1.16114.2.680
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/ia64/ia64.md.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.94.4.6&r2=1.94.4.7


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

* [Bug optimization/11599] gcc generates wrong code when predicate are used
  2003-07-19 23:40 [Bug target/11599] New: ia64: gcc generates wrong code when predicate is used hjl at lucon dot org
                   ` (5 preceding siblings ...)
  2003-07-21 17:56 ` cvs-commit at gcc dot gnu dot org
@ 2003-07-21 18:17 ` pinskia at gcc dot gnu dot org
  2003-07-25 16:31 ` jbuck at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-07-21 18:17 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at gcc dot gnu dot org changed:

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


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-07-21 18:17 -------
Fixed on the mainline (for 3.4) and for 3.3.1 by the patch above.


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

* [Bug optimization/11599] gcc generates wrong code when predicate are used
  2003-07-19 23:40 [Bug target/11599] New: ia64: gcc generates wrong code when predicate is used hjl at lucon dot org
                   ` (6 preceding siblings ...)
  2003-07-21 18:17 ` pinskia at gcc dot gnu dot org
@ 2003-07-25 16:31 ` jbuck at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: jbuck at gcc dot gnu dot org @ 2003-07-25 16:31 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


jbuck at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.3.2                       |3.3.1


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

end of thread, other threads:[~2003-07-25 16:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-19 23:40 [Bug target/11599] New: ia64: gcc generates wrong code when predicate is used hjl at lucon dot org
2003-07-19 23:41 ` [Bug target/11599] " hjl at lucon dot org
2003-07-19 23:52 ` [Bug optimization/11599] " pinskia at physics dot uc dot edu
2003-07-20  5:04 ` [Bug optimization/11599] gcc generates wrong code when builtins are used hjl at lucon dot org
2003-07-20 12:00 ` [Bug optimization/11599] gcc generates wrong code when predicate " pinskia at physics dot uc dot edu
2003-07-20 17:12 ` falk at debian dot org
2003-07-21 17:56 ` cvs-commit at gcc dot gnu dot org
2003-07-21 18:17 ` pinskia at gcc dot gnu dot org
2003-07-25 16:31 ` jbuck at gcc dot gnu dot 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).