This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/11399] gcc 3.3.1 miscompiles an if - else if - else statement with O1 on ia64


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 ianw at gelato dot unsw dot edu dot au  2003-07-04 06:31 -------
Subject: Re:  gcc 3.3.1 miscompiles an if - else if - else statement with O1 on ia64

On Fri, Jul 04, 2003 at 05:07:13AM -0000, wilson at tuliptree dot org wrote:
> ------- Additional Comments From wilson at tuliptree dot org  2003-07-04 05:07 -------
> 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

I pasted in the wrong example -- that p6 in the annoted code was put
in by *me* playing with the output of -S when I found the problem.
Sorry!!  However, the attached examples are verbatim, gcc 3.3.1
produces the code :

	(p7) ld8.mov r15 = [r14], retval#
	(p7) addl r14 = 1, r0
	;;
	(p7) st4 [r15] = r14
	(p7) br.cond.dptk .L3

> The 3.3/3.4 .s output have only p7 predicate register 
> usage.

gcc 3.4 also only uses p7, but it uses r15.

	(p7) addl r15 = 1, r0
	(p7) addl r14 = @ltoffx(retval#), r1
	;;
	(p7) ld8.mov r14 = [r14], retval#
	;;
	(p7) st4 [r14] = r15
	(p7) br.cond.dptk .L3
 
> 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.

ok, I just built from CVS gcc-3_3-branch 5 minutes ago :
ianw@tartufi:~/tmp/gcc-bug$ cvs-gcc -v
Reading specs from /usr/local/lib/gcc-lib/ia64-unknown-linux-gnu/3.3.1/specs
Configured with: ./configure --enable-languages=c --program-prefix=cvs- --enable-shared
Thread model: posix
gcc version 3.3.1 20030704 (prerelease)

and it still does it with -O2

> I don't have access to IPF hardware, so I am unfortunately not able to 
> run the example.

If you think it would help I can most probably get you access to some;
please email me privately.

Otherwise, can you suggest where in the code you think the difference
between 3.3 and 3.4 is likely to be?  I'd like to get the fix
backported, but currently I'm a bit lost at where to look.

Thankyou for looking at the bug,

-i


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]