Bug 12928 - [tree-ssa] Bad assembly code produced when compiling glibc
Summary: [tree-ssa] Bad assembly code produced when compiling glibc
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: tree-ssa
: P2 critical
Target Milestone: tree-ssa
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2003-11-06 20:17 UTC by Brian Booth
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host:
Target: x86_64-unknown-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Associated .i file (8.70 KB, text/plain)
2003-11-06 20:18 UTC, Brian Booth
Details
The assembly code causing the errors. (633 bytes, text/plain)
2003-11-06 20:18 UTC, Brian Booth
Details
Associated .i file (32.48 KB, text/plain)
2003-11-07 19:43 UTC, Brian Booth
Details
The bad assembly code. (2.23 KB, text/plain)
2003-11-07 19:44 UTC, Brian Booth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Booth 2003-11-06 20:17:29 UTC
GCC version:
    gcc (GCC) 3.5-tree-ssa 20031106 (merged 20031026)

GCC configure options:
    --prefix=/notnfs/bbooth/tree-ssa/i686/inst
    --srcdir=/notnfs/bbooth/tree-ssa/gcc
    --disable-multilib

Command line & compiler/assembler output:

/notnfs/bbooth/tree-ssa/i686/inst/libexec/gcc/i686-pc-linux-gnu/3.5-tree-ssa/cc1
-fpreprocessed sigsuspend.i -quiet -dumpbase sigsuspend.c -mtune=pentiumpro
-auxbase-strip /home/bbooth/tree-ssa/build/i686/GLIBC/signal/sigsuspend.o -O2
-Wall -Winline -Wstrict-prototypes -Wwrite-strings -version -ftime-report -o
sigsuspend.s
GNU C version 3.5-tree-ssa 20031106 (merged 20031026) (i686-pc-linux-gnu)
	compiled by GNU C version 3.5-tree-ssa 20031106 (merged 20031026).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

Execution times (seconds)
 lexical analysis      :   0.01 (14%) usr   0.00 ( 0%) sys   0.01 (11%) wall
 parser                :   0.02 (29%) usr   0.00 ( 0%) sys   0.02 (22%) wall
 tree gimplify         :   0.01 (14%) usr   0.00 ( 0%) sys   0.01 (11%) wall
 bypass jumps          :   0.01 (14%) usr   0.00 ( 0%) sys   0.01 (11%) wall
 symout                :   0.01 (14%) usr   0.00 ( 0%) sys   0.01 (11%) wall
 TOTAL                 :   0.07             0.02             0.09
 as -V -Qy -o /home/bbooth/tree-ssa/build/i686/GLIBC/signal/sigsuspend.o
sigsuspend.s
GNU assembler version 2.14.90.0.4 (i386-redhat-linux) using BFD version
2.14.90.0.4 20030523
sigsuspend.s: Assembler messages:
sigsuspend.s:83: Error: non-constant expression in ".if" statement
sigsuspend.s:84: Error: non-constant expression in ".if" statement
sigsuspend.s:87: Error: non-constant expression in ".if" statement

==============

.i file to come.
Comment 1 Brian Booth 2003-11-06 20:18:00 UTC
Created attachment 5074 [details]
Associated .i file
Comment 2 Brian Booth 2003-11-06 20:18:53 UTC
Created attachment 5075 [details]
The assembly code causing the errors.
Comment 3 Andrew Pinski 2003-11-06 20:28:57 UTC
This is not a gcc problem from the source:
     ".if 1 - \\name\n\t"
Report it to glibc.
Comment 4 Diego Novillo 2003-11-06 20:38:25 UTC
Subject: Re:  [tree-ssa] Bad assembly code produced
	when compiling glibc

On Thu, 2003-11-06 at 15:28, pinskia at gcc dot gnu dot org wrote:

> This is not a gcc problem from the source:
>      ".if 1 - \\name\n\t"
> Report it to glibc.
>
Hmm, we don't get this problem with gcc 3.2.  Is this something we've
deprecated since then?


Diego.

Comment 5 Andrew Pinski 2003-11-06 20:48:11 UTC
I take that back, I needed to look into the asm a little more:
	bpushl .L__X'$0, $0
	bmovl .L__X'$0, $0
	movl $72, %eax
	int $0x80
	bpopl .L__X'$0, $0

%k2 == $0?
	
Comment 6 Andrew Pinski 2003-11-06 21:05:14 UTC
Still valid as "C" constraint, I think glibc wanted "c" here instead (and maybe "d" instead of "D"):
Specifies constant that can be easily constructed in SSE register without loading it from memory. 
From the source:
"aCD" (0)
Comment 7 Brian Booth 2003-11-07 19:43:26 UTC
Created attachment 5088 [details]
Associated .i file
Comment 8 Brian Booth 2003-11-07 19:44:06 UTC
Created attachment 5089 [details]
The bad assembly code.
Comment 9 Brian Booth 2003-11-07 19:45:04 UTC
What about this case...

GCC version:
    gcc (GCC) 3.5-tree-ssa 20031107 (merged 20031026)

GCC configure options:
    --prefix=/notnfs/bbooth/tree-ssa/x86_64/inst
    --srcdir=/notnfs/bbooth/tree-ssa/gcc
    --disable-multilib

Command line & compiler/assembler output:

/notnfs/bbooth/tree-ssa/x86_64/inst/libexec/gcc/x86_64-unknown-linux-gnu/3.5-tree-ssa/cc1
-fpreprocessed l10nflist.i -quiet -dumpbase l10nflist.c -mtune=k8 -auxbase-strip
/home/bbooth/tree-ssa/build/x86_64/GLIBC/intl/l10nflist.o -O2 -Wall -Winline
-Wstrict-prototypes -Wwrite-strings -std=gnu99 -version -ftime-report -o l10nflist.s
GNU C version 3.5-tree-ssa 20031107 (merged 20031026) (x86_64-unknown-linux-gnu)
	compiled by GNU C version 3.5-tree-ssa 20031107 (merged 20031026).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

Execution times (seconds)
 garbage collection    :   0.02 (12%) usr   0.00 ( 0%) sys   0.02 (11%) wall
 callgraph construction:   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 6%) wall
 life analysis         :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 6%) wall
 life info update      :   0.01 ( 6%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
 alias analysis        :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.02 (11%) wall
 register scan         :   0.01 ( 6%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
 preprocessing         :   0.01 ( 6%) usr   0.00 ( 0%) sys   0.02 (11%) wall
 lexical analysis      :   0.03 (18%) usr   0.00 ( 0%) sys   0.01 ( 6%) wall
 parser                :   0.02 (12%) usr   0.00 ( 0%) sys   0.03 (17%) wall
 tree CFG construction :   0.01 ( 6%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
 tree CFG cleanup      :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 6%) wall
 tree thread jumps     :   0.01 ( 6%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
 expand                :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 6%) wall
 CSE                   :   0.01 ( 6%) usr   0.00 ( 0%) sys   0.01 ( 6%) wall
 loop analysis         :   0.01 ( 6%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
 flow analysis         :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 6%) wall
 combiner              :   0.01 ( 6%) usr   0.00 ( 0%) sys   0.01 ( 6%) wall
 if-conversion         :   0.01 ( 6%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
 scheduling 2          :   0.01 ( 6%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
 TOTAL                 :   0.17             0.01             0.18
 as -V -Qy -o /home/bbooth/tree-ssa/build/x86_64/GLIBC/intl/l10nflist.o l10nflist.s
GNU assembler version 2.14.90.0.4 (x86_64-redhat-linux) using BFD version
2.14.90.0.4 20030523
l10nflist.s: Assembler messages:
l10nflist.s:406: Error: Incorrect register `%rax' used with `l' suffix
Comment 10 Andrew Pinski 2003-11-07 19:53:46 UTC
Either a machine description problem or a miscompiling something generated from the *.md files.
Comment 11 Richard Henderson 2004-01-16 20:23:42 UTC
Fixed on mainline by
  http://gcc.gnu.org/ml/gcc-patches/2004-01/msg01612.html