--- Comment #1 from mattst88 at gmail dot com 2010-04-08 16:50 ---
Created an attachment (id=20337)
-- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20337action=view)
rewritten.S - external assembly
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43691
--- Comment #2 from mattst88 at gmail dot com 2010-04-08 16:50 ---
Created an attachment (id=20338)
-- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20338action=view)
test.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43691
I don't think this is a bug in gcc. The inline-asm uses $16 but any of
the output/temp registers could use that as you don't say the agrument
is used as an input.
Sent from my iPhone
On Apr 8, 2010, at 9:50 AM, mattst88 at gmail dot com gcc-bugzi...@gcc.gnu.org
wrote:
--- Comment
--- Comment #3 from pinskia at gmail dot com 2010-04-08 17:06 ---
Subject: Re: Code segfault when compiled with -Os, -O2, or -O3
I don't think this is a bug in gcc. The inline-asm uses $16 but any of
the output/temp registers could use that as you don't say the agrument
is used as
--- Comment #4 from zackw at panix dot com 2010-04-08 17:28 ---
(In reply to comment #0)
When this testcase, using inline assembly, is compiled with -Os, -O2, or -O3
it segfaults. -O0 and -O1 allow it to run correctly.
Moving the inline assembly into a separate file and including
--
zackw at panix dot com changed:
What|Removed |Added
Status|UNCONFIRMED |WAITING
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43691
--- Comment #5 from ubizjak at gmail dot com 2010-04-08 17:45 ---
The problem is, that when rewritten gets inlined (in -O2+ case), you can't
expect argument to be passed into the inlined section of the function via
locations, specifed by ABI. So, you have:
$main..ng:
lda
--- Comment #6 from ubizjak at gmail dot com 2010-04-08 17:52 ---
(In reply to comment #4)
From these symptoms, it is practically certain that you have done something
wrong with the asm inputs and outputs. I don't have an Alpha compiler to
hand,
but just from looking at your
--- Comment #7 from mattst88 at gmail dot com 2010-04-08 17:53 ---
(In reply to comment #4)
(In reply to comment #0)
When this testcase, using inline assembly, is compiled with -Os, -O2, or -O3
it segfaults. -O0 and -O1 allow it to run correctly.
Moving the inline assembly