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]

Re: "const double" variable in 20000214 snapshot (Linux/Intel) with -O1


On Mon, Apr 03, 2000 at 03:10:22AM -0600, Jeffrey A Law wrote:
> In message <20000215140239.A21291@lightlink.com> I wrote:
>> I am trying the 20000214 snapshot on Linux/Intel (Debian potato, i586).
>> The appended code doesn't pass the right value of x to p() when I compile
>> with "-O1".  It does the right thing if the variable x is not "const".

>> /* begin C code */
>> 
>> int true (void);  /* always returns 1 */
>> void p (double);
>> 
>> void
>> f (double a, double b)
>> {
>>   const double x = -(0.25*b + 0.5*a);
>> 
>>   if (true())
>>      p(x);
>> 
>>   return;
>> }
>> 
>> /* end C code */

> I believe this bug was fixed in the development sources a few weeks ago.

I continue to have it through the latest (20000327) snapshot. 
(Could someone doublecheck this?)

For your amusement, I append the .S output.

	-Paul <kimoto@lightlink.com>

###

	.file	"const.c"
	.version	"01.01"
gcc2_compiled.:
.text
	.align 16
.globl f
	.type	 f,@function
f:
	pushl	%ebp
	movl	%esp, %ebp
	subl	$8, %esp
	xorb	$128, -1(%ebp)
	call	true
	testl	%eax, %eax
	je	.L2
	subl	$8, %esp
	pushl	-4(%ebp)
	pushl	-8(%ebp)
	call	p
	addl	$16, %esp
.L2:
	movl	%ebp, %esp
	popl	%ebp
	ret
.Lfe1:
	.size	 f,.Lfe1-f
	.ident	"GCC: (GNU) 2.96 20000327 (experimental)"


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