Bug 13041 - [3.3 Regression] linux-2.6/sound/core/oss/rate.c miscompiled
Summary: [3.3 Regression] linux-2.6/sound/core/oss/rate.c miscompiled
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.3.2
: P2 critical
Target Milestone: 3.3.3
Assignee: Eric Botcazou
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2003-11-13 19:14 UTC by Debian GCC Maintainers
Modified: 2003-12-01 08:19 UTC (History)
2 users (show)

See Also:
Host: i386-linux
Target: 386-linux
Build: 386-linux
Known to work:
Known to fail:
Last reconfirmed: 2003-11-14 14:16:37


Attachments
preprocessed source (56.20 KB, application/x-bzip2)
2003-11-13 19:15 UTC, Debian GCC Maintainers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Debian GCC Maintainers 2003-11-13 19:14:52 UTC
[ forwarded from http://bugs.debian.org/219949 ]

gcc-3.3.2 release:

gcc -march=i386 -fomit-frame-pointer -O2

miscompiles sound/core/oss/rate.c in Linux 2.6.0-test9.

I've attached the preprocessed source that demonstrates the
problem.

In the assembly output with -S, look for the 5th label in
get_s16_labels.0.  That label should do a word load, but
instead it does a double word load:

.L4:
        movl    (%ebp), %eax
        jmp     .L111
Comment 1 Debian GCC Maintainers 2003-11-13 19:15:27 UTC
Created attachment 5131 [details]
preprocessed source
Comment 2 Andrew Pinski 2003-11-13 19:37:51 UTC
On the mainline the asm looks like:
        movw    (%edi), %ax
        movw    %ax, (%esp)

Comment 3 Eric Botcazou 2003-11-14 14:16:36 UTC
Confirmed, GCC has no right to "promote" the memory access.
Comment 4 Eric Botcazou 2003-11-14 14:17:09 UTC
Fixing.
Comment 5 Eric Botcazou 2003-11-17 08:37:31 UTC
I think the bug is generic.
Comment 6 CVS Commits 2003-11-27 06:45:27 UTC
Subject: Bug 13041

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	ebotcazou@gcc.gnu.org	2003-11-27 06:45:25

Modified files:
	gcc            : ChangeLog final.c reload1.c 

Log message:
	PR optimization/13041
	* final.c (frame_pointer_needed): Fix comment.
	* reload1.c (reload): Decrease alignment of the frame
	pointer if it was used for register allocation.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.1834&r2=2.1835
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/final.c.diff?cvsroot=gcc&r1=1.294&r2=1.295
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/reload1.c.diff?cvsroot=gcc&r1=1.413&r2=1.414

Comment 7 CVS Commits 2003-12-01 08:18:44 UTC
Subject: Bug 13041

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	ebotcazou@gcc.gnu.org	2003-12-01 08:18:40

Modified files:
	gcc            : ChangeLog final.c reload1.c 

Log message:
	Backport from mainline:
	
	2003-11-27  Eric Botcazou  <ebotcazou@libertysurf.fr>
	
	PR optimization/13041
	* final.c (frame_pointer_needed): Fix comment.
	* reload1.c (reload): Decrease alignment of the frame
	pointer if it was used for register allocation.

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.812&r2=1.16114.2.813
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/final.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.271.2.1&r2=1.271.2.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/reload1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.366.2.6&r2=1.366.2.7

Comment 8 Eric Botcazou 2003-12-01 08:19:29 UTC
See http://gcc.gnu.org/ml/gcc-patches/2003-11/msg01629.html