public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/44290] [4.5 regression] __naked attribute is broken
       [not found] <bug-44290-4@http.gcc.gnu.org/bugzilla/>
@ 2010-12-15 22:11 ` belyshev at depni dot sinp.msu.ru
  2010-12-16  3:06 ` jiez at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 20+ messages in thread
From: belyshev at depni dot sinp.msu.ru @ 2010-12-15 22:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290

Serge Belyshev <belyshev at depni dot sinp.msu.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Status|REOPENED                    |WAITING
                 CC|                            |belyshev at depni dot
                   |                            |sinp.msu.ru
      Known to work|                            |4.6.0
            Summary|[4.5 only] __naked          |[4.5 regression] __naked
                   |attribute is broken         |attribute is broken

--- Comment #28 from Serge Belyshev <belyshev at depni dot sinp.msu.ru> 2010-12-15 22:10:42 UTC ---
I presume this is fixed on trunk, but still broken n 4.5 branch, is that
correct?


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug target/44290] [4.5 regression] __naked attribute is broken
       [not found] <bug-44290-4@http.gcc.gnu.org/bugzilla/>
  2010-12-15 22:11 ` [Bug target/44290] [4.5 regression] __naked attribute is broken belyshev at depni dot sinp.msu.ru
@ 2010-12-16  3:06 ` jiez at gcc dot gnu.org
  2010-12-16 13:08 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 20+ messages in thread
From: jiez at gcc dot gnu.org @ 2010-12-16  3:06 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290

--- Comment #29 from Jie Zhang <jiez at gcc dot gnu.org> 2010-12-16 03:05:53 UTC ---
Serge, yes. But GCC 4.5 branch is frozen now again.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug target/44290] [4.5 regression] __naked attribute is broken
       [not found] <bug-44290-4@http.gcc.gnu.org/bugzilla/>
  2010-12-15 22:11 ` [Bug target/44290] [4.5 regression] __naked attribute is broken belyshev at depni dot sinp.msu.ru
  2010-12-16  3:06 ` jiez at gcc dot gnu.org
@ 2010-12-16 13:08 ` rguenth at gcc dot gnu.org
  2010-12-16 20:47 ` belyshev at depni dot sinp.msu.ru
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 20+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-12-16 13:08 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.5.2                       |4.5.3

--- Comment #30 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-12-16 13:02:52 UTC ---
GCC 4.5.2 is being released, adjusting target milestone.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug target/44290] [4.5 regression] __naked attribute is broken
       [not found] <bug-44290-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2010-12-16 13:08 ` rguenth at gcc dot gnu.org
@ 2010-12-16 20:47 ` belyshev at depni dot sinp.msu.ru
  2010-12-16 20:50 ` belyshev at depni dot sinp.msu.ru
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 20+ messages in thread
From: belyshev at depni dot sinp.msu.ru @ 2010-12-16 20:47 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290

Serge Belyshev <belyshev at depni dot sinp.msu.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
   Last reconfirmed|2010-05-29 11:42:59         |2010-12-16 3:05:53
      Known to fail|4.5.0                       |4.5.3


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug target/44290] [4.5 regression] __naked attribute is broken
       [not found] <bug-44290-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2010-12-16 20:47 ` belyshev at depni dot sinp.msu.ru
@ 2010-12-16 20:50 ` belyshev at depni dot sinp.msu.ru
  2010-12-21  4:16 ` jiez at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 20+ messages in thread
From: belyshev at depni dot sinp.msu.ru @ 2010-12-16 20:50 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290

Serge Belyshev <belyshev at depni dot sinp.msu.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug target/44290] [4.5 regression] __naked attribute is broken
       [not found] <bug-44290-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2010-12-16 20:50 ` belyshev at depni dot sinp.msu.ru
@ 2010-12-21  4:16 ` jiez at gcc dot gnu.org
  2011-04-10 10:27 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 20+ messages in thread
From: jiez at gcc dot gnu.org @ 2010-12-21  4:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290

--- Comment #31 from Jie Zhang <jiez at gcc dot gnu.org> 2010-12-21 04:16:19 UTC ---
Patch for 4.5 was posted:

http://gcc.gnu.org/ml/gcc-patches/2010-12/msg01351.html

Waiting for approval.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug target/44290] [4.5 regression] __naked attribute is broken
       [not found] <bug-44290-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2010-12-21  4:16 ` jiez at gcc dot gnu.org
@ 2011-04-10 10:27 ` rguenth at gcc dot gnu.org
  2011-04-28 15:35 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 20+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-10 10:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290

--- Comment #32 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-10 10:27:30 UTC ---
Backporting regression fixes is generally fine and does not require explicit
approval (given that the patches do not need significant changes).


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug target/44290] [4.5 regression] __naked attribute is broken
       [not found] <bug-44290-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2011-04-10 10:27 ` rguenth at gcc dot gnu.org
@ 2011-04-28 15:35 ` rguenth at gcc dot gnu.org
  2011-06-03 22:20 ` ramana at gcc dot gnu.org
  2012-07-02 10:37 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 20+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-28 15:35 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.5.3                       |4.5.4

--- Comment #33 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-28 14:51:08 UTC ---
GCC 4.5.3 is being released, adjusting target milestone.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug target/44290] [4.5 regression] __naked attribute is broken
       [not found] <bug-44290-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2011-04-28 15:35 ` rguenth at gcc dot gnu.org
@ 2011-06-03 22:20 ` ramana at gcc dot gnu.org
  2012-07-02 10:37 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 20+ messages in thread
From: ramana at gcc dot gnu.org @ 2011-06-03 22:20 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290

Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ramana at gcc dot gnu.org

--- Comment #34 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> 2011-06-03 22:19:40 UTC ---
Jie , 

Are you still planning on backporting this ?

Ramana


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug target/44290] [4.5 regression] __naked attribute is broken
       [not found] <bug-44290-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2011-06-03 22:20 ` ramana at gcc dot gnu.org
@ 2012-07-02 10:37 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 20+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-07-02 10:37 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.5.4                       |4.6.0

--- Comment #35 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-07-02 10:36:35 UTC ---
Fixed in 4.6.0, the 4.5 branch is being closed.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug target/44290] [4.5 Regression] __naked attribute is broken
  2010-05-27  6:26 [Bug tree-optimization/44290] New: arm linux kernel crahes when built with -fipa-sra raj dot khem at gmail dot com
                   ` (8 preceding siblings ...)
  2010-07-23 14:51 ` jiez at gcc dot gnu dot org
@ 2010-07-23 14:52 ` jiez at gcc dot gnu dot org
  9 siblings, 0 replies; 20+ messages in thread
From: jiez at gcc dot gnu dot org @ 2010-07-23 14:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #23 from jiez at gcc dot gnu dot org  2010-07-23 14:52 -------
Set the status to FIXED.


-- 

jiez at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug target/44290] [4.5 Regression] __naked attribute is broken
  2010-05-27  6:26 [Bug tree-optimization/44290] New: arm linux kernel crahes when built with -fipa-sra raj dot khem at gmail dot com
                   ` (7 preceding siblings ...)
  2010-07-23 14:48 ` jiez at gcc dot gnu dot org
@ 2010-07-23 14:51 ` jiez at gcc dot gnu dot org
  2010-07-23 14:52 ` jiez at gcc dot gnu dot org
  9 siblings, 0 replies; 20+ messages in thread
From: jiez at gcc dot gnu dot org @ 2010-07-23 14:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #22 from jiez at gcc dot gnu dot org  2010-07-23 14:51 -------
Should be fixed on trunk now.


-- 

jiez at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jiez at gcc dot gnu dot org
                   |dot org                     |
             Status|REOPENED                    |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug target/44290] [4.5 Regression] __naked attribute is broken
  2010-05-27  6:26 [Bug tree-optimization/44290] New: arm linux kernel crahes when built with -fipa-sra raj dot khem at gmail dot com
                   ` (6 preceding siblings ...)
  2010-05-30 17:04 ` rguenth at gcc dot gnu dot org
@ 2010-07-23 14:48 ` jiez at gcc dot gnu dot org
  2010-07-23 14:51 ` jiez at gcc dot gnu dot org
  2010-07-23 14:52 ` jiez at gcc dot gnu dot org
  9 siblings, 0 replies; 20+ messages in thread
From: jiez at gcc dot gnu dot org @ 2010-07-23 14:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from jiez at gcc dot gnu dot org  2010-07-23 14:48 -------
Subject: Bug 44290

Author: jiez
Date: Fri Jul 23 14:47:46 2010
New Revision: 162466

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162466
Log:
        PR target/44290
        * attribs.c (decl_attributes): Insert "noinline" and "noclone"
        if "naked".
        * tree-sra.c (ipa_sra_preliminary_function_checks): Return
        false if ! tree_versionable_function_p.

        testsuite/
        PR target/44290
        * gcc.dg/pr44290-1.c: New test.
        * gcc.dg/pr44290-2.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr44290-1.c
    trunk/gcc/testsuite/gcc.dg/pr44290-2.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/attribs.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-sra.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug target/44290] [4.5 Regression] __naked attribute is broken
  2010-05-27  6:26 [Bug tree-optimization/44290] New: arm linux kernel crahes when built with -fipa-sra raj dot khem at gmail dot com
                   ` (5 preceding siblings ...)
  2010-05-30  6:55 ` raj dot khem at gmail dot com
@ 2010-05-30 17:04 ` rguenth at gcc dot gnu dot org
  2010-07-23 14:48 ` jiez at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 20+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-30 17:04 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug target/44290] [4.5 Regression] __naked attribute is broken
  2010-05-27  6:26 [Bug tree-optimization/44290] New: arm linux kernel crahes when built with -fipa-sra raj dot khem at gmail dot com
                   ` (4 preceding siblings ...)
  2010-05-30  5:58 ` raj dot khem at gmail dot com
@ 2010-05-30  6:55 ` raj dot khem at gmail dot com
  2010-05-30 17:04 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 20+ messages in thread
From: raj dot khem at gmail dot com @ 2010-05-30  6:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from raj dot khem at gmail dot com  2010-05-30 06:54 -------
Created an attachment (id=20777)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20777&action=view)
includes fix for all arms

I see the problem after reading Richard's comment #10, here is some more
additions to kernel workaround patch which work for me too.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug target/44290] [4.5 Regression] __naked attribute is broken
  2010-05-27  6:26 [Bug tree-optimization/44290] New: arm linux kernel crahes when built with -fipa-sra raj dot khem at gmail dot com
                   ` (3 preceding siblings ...)
  2010-05-29 18:00 ` mikpe at it dot uu dot se
@ 2010-05-30  5:58 ` raj dot khem at gmail dot com
  2010-05-30  6:55 ` raj dot khem at gmail dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 20+ messages in thread
From: raj dot khem at gmail dot com @ 2010-05-30  5:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from raj dot khem at gmail dot com  2010-05-30 05:58 -------
(In reply to comment #18)
> Created an attachment (id=20773)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20773&action=view) [edit]
> linux kernel workaround for attribute naked breakage
> 
> This patch makes the Linux kernel add noinline and noclone attributes to
> functions declared __naked.  This allows gcc-4.5 to build a working 2.6.34
> Linux kernel for my mach-iop32x/n2100 ARM box.
> 
> Khem: can you check if this kernel-side workaround fixes your problem?

I have tried using __noclone__ a couple of days ago to workaround the problem
//static void __attribute__((__naked__, __noinline__, __noclone__,
__no_instrument_function__))

static void __attribute__((__naked__, __no_instrument_function__))
v4wb_copy_user_page(void *kto, const void *kfrom)

But my gcc seems to ignore it and its generating same code for both with Os and
O2 for both
above cases. Hence did not solve my issue.
I am using snapshot of 4.5 branch from May 20

> 
> Eventually I'd like the kernel to not use __naked, but that is non-trivial. 
> This fix should work now and be easily backportable to older kernels.
> 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug target/44290] [4.5 Regression] __naked attribute is broken
  2010-05-27  6:26 [Bug tree-optimization/44290] New: arm linux kernel crahes when built with -fipa-sra raj dot khem at gmail dot com
                   ` (2 preceding siblings ...)
  2010-05-29 14:47 ` mikpe at it dot uu dot se
@ 2010-05-29 18:00 ` mikpe at it dot uu dot se
  2010-05-30  5:58 ` raj dot khem at gmail dot com
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 20+ messages in thread
From: mikpe at it dot uu dot se @ 2010-05-29 18:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from mikpe at it dot uu dot se  2010-05-29 18:00 -------
Created an attachment (id=20773)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20773&action=view)
linux kernel workaround for attribute naked breakage

This patch makes the Linux kernel add noinline and noclone attributes to
functions declared __naked.  This allows gcc-4.5 to build a working 2.6.34
Linux kernel for my mach-iop32x/n2100 ARM box.

Khem: can you check if this kernel-side workaround fixes your problem?

Eventually I'd like the kernel to not use __naked, but that is non-trivial. 
This fix should work now and be easily backportable to older kernels.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug target/44290] [4.5 Regression] __naked attribute is broken
  2010-05-27  6:26 [Bug tree-optimization/44290] New: arm linux kernel crahes when built with -fipa-sra raj dot khem at gmail dot com
  2010-05-29 14:45 ` [Bug target/44290] [4.5 Regression] __naked attribute is broken rguenth at gcc dot gnu dot org
  2010-05-29 14:46 ` rguenth at gcc dot gnu dot org
@ 2010-05-29 14:47 ` mikpe at it dot uu dot se
  2010-05-29 18:00 ` mikpe at it dot uu dot se
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 20+ messages in thread
From: mikpe at it dot uu dot se @ 2010-05-29 14:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from mikpe at it dot uu dot se  2010-05-29 14:47 -------
Created an attachment (id=20772)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20772&action=view)
test case from copypage-xscale.c

This is distilled from the kernel's copypage-xscale.c file and illustrates the
issue.  With gcc-4.4 the __naked__ function foo() is called with the standard
call sequence register assignment, so the asm() body of foo() works.  With
gcc-4.5 foo() is cloned and gets its second parameter `to' in r0 (not r1 as
expected), and the body of foo() is modified to set up the actual first
parameter (&fie[0]) in r1 (not r0 as expected).  Obviously the asm() then
breaks.

Compiling with -fno-ipa-cp avoids this problem, as does adding __noclone__ and
__noinline__ to foo()'s function definition.

I don't immediately see how to enforce __noclone__ and __noinline__ in the ARM
backend when it sees __naked__.  Any ideas?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug target/44290] [4.5 Regression] __naked attribute is broken
  2010-05-27  6:26 [Bug tree-optimization/44290] New: arm linux kernel crahes when built with -fipa-sra raj dot khem at gmail dot com
  2010-05-29 14:45 ` [Bug target/44290] [4.5 Regression] __naked attribute is broken rguenth at gcc dot gnu dot org
@ 2010-05-29 14:46 ` rguenth at gcc dot gnu dot org
  2010-05-29 14:47 ` mikpe at it dot uu dot se
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 20+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-29 14:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from rguenth at gcc dot gnu dot org  2010-05-29 14:46 -------
And CC a arm maintainer.  There might be more target-specific attributes that
need adjustment.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rearnsha at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug target/44290] [4.5 Regression] __naked attribute is broken
  2010-05-27  6:26 [Bug tree-optimization/44290] New: arm linux kernel crahes when built with -fipa-sra raj dot khem at gmail dot com
@ 2010-05-29 14:45 ` rguenth at gcc dot gnu dot org
  2010-05-29 14:46 ` rguenth at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 20+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-29 14:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from rguenth at gcc dot gnu dot org  2010-05-29 14:45 -------
(In reply to comment #13)
> (In reply to comment #10)
> > Or rather, if you have
> > 
> > void __attribute__((naked)) foo (int i)
> > {
> >   asm("use i");
> > }
> > 
> > without any inputs refering to i that is invalid.
> 
> Not according to gcc/doc/extend.texi:
> 
> > @item naked
> > @cindex function without a prologue/epilogue code
> > Use this attribute on the ARM, AVR, IP2K, RX and SPU ports to indicate that
> > the specified function does not need prologue/epilogue sequences generated by
> > the compiler.  It is up to the programmer to provide these sequences. The 
> > only statements that can be safely included in naked functions are 
> > @code{asm} statements that do not have operands.
> 
> Note: "do not have operands".  Thus the only way such an asm() can refer to
> parameters is by assuming a standard function call sequence and hardcoding
> corresponding register numbers or stack frame offsets.

Then the target has to properly communicate this to the middle-end.

> However, even if the asm() refers to those parameters via "r"(...) inputs,
> gcc-4.5 changes the register assignment to not agree with the standard call
> sequence, I'll attach a small test case showing that in a moment.

I'd have required dummy inputs like "g" (kto), "g" (kfrom) not used by
the actual assembly.

For now re-open as a target bug.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |
            Summary|[4.5 Regression] arm linux  |[4.5 Regression] __naked
                   |kernel crahes when built    |attribute is broken
                   |with -fipa-sra, __naked     |
                   |attribute is broken         |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2012-07-02 10:37 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-44290-4@http.gcc.gnu.org/bugzilla/>
2010-12-15 22:11 ` [Bug target/44290] [4.5 regression] __naked attribute is broken belyshev at depni dot sinp.msu.ru
2010-12-16  3:06 ` jiez at gcc dot gnu.org
2010-12-16 13:08 ` rguenth at gcc dot gnu.org
2010-12-16 20:47 ` belyshev at depni dot sinp.msu.ru
2010-12-16 20:50 ` belyshev at depni dot sinp.msu.ru
2010-12-21  4:16 ` jiez at gcc dot gnu.org
2011-04-10 10:27 ` rguenth at gcc dot gnu.org
2011-04-28 15:35 ` rguenth at gcc dot gnu.org
2011-06-03 22:20 ` ramana at gcc dot gnu.org
2012-07-02 10:37 ` rguenth at gcc dot gnu.org
2010-05-27  6:26 [Bug tree-optimization/44290] New: arm linux kernel crahes when built with -fipa-sra raj dot khem at gmail dot com
2010-05-29 14:45 ` [Bug target/44290] [4.5 Regression] __naked attribute is broken rguenth at gcc dot gnu dot org
2010-05-29 14:46 ` rguenth at gcc dot gnu dot org
2010-05-29 14:47 ` mikpe at it dot uu dot se
2010-05-29 18:00 ` mikpe at it dot uu dot se
2010-05-30  5:58 ` raj dot khem at gmail dot com
2010-05-30  6:55 ` raj dot khem at gmail dot com
2010-05-30 17:04 ` rguenth at gcc dot gnu dot org
2010-07-23 14:48 ` jiez at gcc dot gnu dot org
2010-07-23 14:51 ` jiez at gcc dot gnu dot org
2010-07-23 14:52 ` jiez 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).