This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/11399] gcc 3.3.1 miscompiles an if - else if - else statement with O1 on ia64
- From: "wilson at tuliptree dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jul 2003 05:07:13 -0000
- Subject: [Bug c/11399] gcc 3.3.1 miscompiles an if - else if - else statement with O1 on ia64
- References: <20030702000627.11399.ianw@gelato.unsw.edu.au>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11399
------- Additional Comments From wilson at tuliptree dot org 2003-07-04 05:07 -------
Subject: Re: New: gcc 3.3.1 miscompiles an if - else if - else
statement with O1 on ia64
ianw at gelato dot unsw dot edu dot au wrote:
> cmp4.ne p6, p7 = 0, r8
> addl r14 = @ltoffx("a string"), r1
> ;;
> (p7) addl r14 = 1, r0 <---- set r14 to 1
> ;;
> .mmb
> (p6) ld8.mov r8 = [r14], "a string" <---- segfault
You are misreading the code. IPF has predicated execution. An
instruction executes only if the qualifying predicate is true. In this
case, the two instructions use different predicate registers p6/p7, and
because this is a predicate register pair we are guaranteed that at most
one is true, i.e. they are mutex in IPF terminology.
The 3.3 and 3.4 .s files you put in the bug report don't match your
annotated assembly sample. The annotated code has p6/p7 predicate
register usage. The 3.3/3.4 .s output have only p7 predicate register
usage.
I am unable to reproduce your assembly output using a x86-x-ia64 cross
compiler using 3.3 branch last updated a few days ago.
I don't have access to IPF hardware, so I am unfortunately not able to
run the example.
Jim