public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/17280] New: -mrelax and -O cause .uses directives in assembler to refer to non-existent local labels
@ 2004-09-02 10:33 michaelb at ieee dot org
2004-09-02 17:04 ` [Bug target/17280] " pinskia at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: michaelb at ieee dot org @ 2004-09-02 10:33 UTC (permalink / raw)
To: gcc-bugs
When invoked with the -mrelax and -O flags, the generated assembler may
contain .uses directives that refer to non-existent local labels (they have
been optimized out?).
Viz...
bash-2.05b$ ../new-gnu-tools/install/bin/sh-elf-gcc -mrelax -O -c foo2.c
/tmp/cc75nvlf.s: Assembler messages:
/tmp/cc75nvlf.s:13: Warning: .uses does not refer to a local symbol in the same
section
The test program (foo2.c) used is as follows...
extern void foo(int);
int main()
{
foo(7);
}
The generated assembler looks like...
.file "foo2.c"
.text
.text
.align 1
.align 2
.global _main
.type _main, @function
_main:
mov.l r14,@-r15
sts.l pr,@-r15
mov r15,r14
mov.l .L3,r1
.uses .L2
jsr @r1
mov #7,r4
mov r14,r15
lds.l @r15+,pr
rts
mov.l @r15+,r14
.L4:
.align 2
.L3:
.long _foo
.size _main, .-_main
.ident "GCC: (GNU) 3.4.1"
Note that the problem goes away if the -mrelax option is removed, or if the
optimisation level is changed to -O0, -O2 or -O3.
I originally encountered this problem while attempting to do a make check of
binutils-2.15 for sh-elf. It was reporting an error in
binutils-2.15/ld/testsuite/ld-sh/sh.exp, while attempting to compile
binutils-2.15/ld/testsuite/ld-sh/sh2.c. I derived the included test program by
cutting down sh2.c.
Oh, and sh-elf-gcc was built using the following options...
configure --prefix=/home/michaelb/stuff/new-gnu-tools/install --target=sh-elf
--enable-languages="c,c++" --with-newlib
--
Summary: -mrelax and -O cause .uses directives in assembler to
refer to non-existent local labels
Product: gcc
Version: 3.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: michaelb at ieee dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: sh-unknown-elf
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17280
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/17280] -mrelax and -O cause .uses directives in assembler to refer to non-existent local labels
2004-09-02 10:33 [Bug c/17280] New: -mrelax and -O cause .uses directives in assembler to refer to non-existent local labels michaelb at ieee dot org
@ 2004-09-02 17:04 ` pinskia at gcc dot gnu dot org
2004-12-10 3:20 ` pinskia at gcc dot gnu dot org
2005-06-19 14:46 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-02 17:04 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Component|c |target
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17280
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/17280] -mrelax and -O cause .uses directives in assembler to refer to non-existent local labels
2004-09-02 10:33 [Bug c/17280] New: -mrelax and -O cause .uses directives in assembler to refer to non-existent local labels michaelb at ieee dot org
2004-09-02 17:04 ` [Bug target/17280] " pinskia at gcc dot gnu dot org
@ 2004-12-10 3:20 ` pinskia at gcc dot gnu dot org
2005-06-19 14:46 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-10 3:20 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17280
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/17280] -mrelax and -O cause .uses directives in assembler to refer to non-existent local labels
2004-09-02 10:33 [Bug c/17280] New: -mrelax and -O cause .uses directives in assembler to refer to non-existent local labels michaelb at ieee dot org
2004-09-02 17:04 ` [Bug target/17280] " pinskia at gcc dot gnu dot org
2004-12-10 3:20 ` pinskia at gcc dot gnu dot org
@ 2005-06-19 14:46 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-19 14:46 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
GCC build triplet|i686-pc-linux-gnu |
GCC host triplet|i686-pc-linux-gnu |
GCC target triplet|sh-unknown-elf |sh-elf
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17280
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-06-19 14:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-02 10:33 [Bug c/17280] New: -mrelax and -O cause .uses directives in assembler to refer to non-existent local labels michaelb at ieee dot org
2004-09-02 17:04 ` [Bug target/17280] " pinskia at gcc dot gnu dot org
2004-12-10 3:20 ` pinskia at gcc dot gnu dot org
2005-06-19 14:46 ` pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).