[Bug c/31362] gcc should not inline functions with 'section' attribute

2025-03-17 Thread stefan.tauner at gmx dot at via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31362 stefan.tauner at gmx dot at changed: What|Removed |Added CC||stefan.tauner at gmx dot at

[Bug c/31362] gcc should not inline functions with 'section' attribute

2007-03-27 Thread thutt at vmware dot com
--- Comment #19 from thutt at vmware dot com 2007-03-27 14:44 --- I guess I need a bigger typeface because I don't see where it says '(the out-of-line copy)'. Or, perhaps, you've simply added that '(the out-of-line copy)' annotation yourself because that's what the code currently does,

[Bug c/31362] gcc should not inline functions with 'section' attribute

2007-03-27 Thread rguenth at gcc dot gnu dot org
--- Comment #18 from rguenth at gcc dot gnu dot org 2007-03-27 14:22 --- Well, you can continue to waste your time arguing here instead of fixing your code with a few additions of noinline. 'The `section' attribute specifies that a function lives in a particular sect

[Bug c/31362] gcc should not inline functions with 'section' attribute

2007-03-27 Thread thutt at vmware dot com
--- Comment #17 from thutt at vmware dot com 2007-03-27 13:49 --- In response to comment #16: I wouldn't call an inliner which inlines functions specifically marked as "do not put this in '.text'" as 'smart'. I'd use a more pejorative adjective, such as 'broken' or 'dumb'. -- http

[Bug c/31362] gcc should not inline functions with 'section' attribute

2007-03-26 Thread pinskia at gcc dot gnu dot org
--- Comment #16 from pinskia at gcc dot gnu dot org 2007-03-26 21:21 --- You supposed to mark all functions which you don't want inlined as noinline. that is what the noinline attribute is there for. The inliner is just too smart that is all. If you want a dumber inliner fine, but do

[Bug c/31362] gcc should not inline functions with 'section' attribute

2007-03-26 Thread eweddington at cso dot atmel dot com
--- Comment #15 from eweddington at cso dot atmel dot com 2007-03-26 20:22 --- FWIW, I agree with the OP. This will place a burden on users who work with embedded systems such as the AVR. Special sections are sometimes needed in the AVR to place code into a special bootloader area that

[Bug c/31362] gcc should not inline functions with 'section' attribute

2007-03-26 Thread thutt at vmware dot com
--- Comment #14 from thutt at vmware dot com 2007-03-26 18:54 --- > Why do you think sections are special? > GCC does not know if a section is special or not and it really should not > know. I don't necessarily think that sections are 'special', but since gcc has the capability to chan

[Bug c/31362] gcc should not inline functions with 'section' attribute

2007-03-26 Thread pinskia at gcc dot gnu dot org
--- Comment #13 from pinskia at gcc dot gnu dot org 2007-03-26 18:10 --- Why do you think sections are special? GCC does not know if a section is special or not and it really should not know. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31362

[Bug c/31362] gcc should not inline functions with 'section' attribute

2007-03-26 Thread thutt at vmware dot com
--- Comment #12 from thutt at vmware dot com 2007-03-26 17:46 --- I respectfully submit that I think you guys are missing the point. The problem isn't that the compiler is inlining functions which are called once, the problem is that the compiler is inlining a function which

[Bug c/31362] gcc should not inline functions with 'section' attribute

2007-03-26 Thread rguenth at gcc dot gnu dot org
--- Comment #11 from rguenth at gcc dot gnu dot org 2007-03-26 17:02 --- 4.1.2 also inlines the other one, so that won't help. Still noinline will. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31362

[Bug c/31362] gcc should not inline functions with 'section' attribute

2007-03-26 Thread pinskia at gcc dot gnu dot org
--- Comment #10 from pinskia at gcc dot gnu dot org 2007-03-26 16:58 --- And now there is already an option to stop this inlining static functions called once. http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-finline_002dfunctions_002dcalled_002donce-507 -- pinskia at g

[Bug c/31362] gcc should not inline functions with 'section' attribute

2007-03-26 Thread rguenth at gcc dot gnu dot org
--- Comment #9 from rguenth at gcc dot gnu dot org 2007-03-26 16:28 --- We inline static functions used once (special_function_0 in your testcase) starting with the tree inliner which appeared in 3.4.0. So the "bug" is present in all releases starting from 3.4.0 and still present in mai

[Bug c/31362] gcc should not inline functions with 'section' attribute

2007-03-26 Thread thutt at vmware dot com
--- Comment #8 from thutt at vmware dot com 2007-03-26 15:57 --- Furthermore, 4. By placing the code in a different section, I'm instructing the the compiler to *not* put it in '.text'. By inlining it, it places it in '.text' despite my instructions. -- http://g

[Bug c/31362] gcc should not inline functions with 'section' attribute

2007-03-26 Thread rguenth at gcc dot gnu dot org
--- Comment #7 from rguenth at gcc dot gnu dot org 2007-03-26 15:51 --- Note that for your testcase even if you specify the noinline attribute the function calls will be optimized away as the function calls do not have side-effects. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=313

[Bug c/31362] gcc should not inline functions with 'section' attribute

2007-03-26 Thread rguenth at gcc dot gnu dot org
--- Comment #6 from rguenth at gcc dot gnu dot org 2007-03-26 15:47 --- In the actual implementation from which this test case was derived, the function *must* reside at a specific location in memory, but due to the inlining, it does not. This causes failures in the application. You

[Bug c/31362] gcc should not inline functions with 'section' attribute

2007-03-26 Thread thutt at vmware dot com
--- Comment #5 from thutt at vmware dot com 2007-03-26 15:40 --- I'm going to argue that comment #4 is incorrect. 1. This new behavior is a regression from previous versions of gcc. 2. The 4.1.1 compiler gets it right at -O0 and -O3. Previous versions of gcc which we've been usi

[Bug c/31362] gcc should not inline functions with 'section' attribute

2007-03-26 Thread rguenth at gcc dot gnu dot org
--- Comment #4 from rguenth at gcc dot gnu dot org 2007-03-26 15:11 --- If it is incorrect to inline a function you should specify that with __attribute__((noinline)), I don't see why in general inlining a function which out of line copy is in a special section is wrong. -- rguenth a

[Bug c/31362] gcc should not inline functions with 'section' attribute

2007-03-26 Thread thutt at vmware dot com
--- Comment #3 from thutt at vmware dot com 2007-03-26 15:09 --- Created an attachment (id=13290) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13290&action=view) preprocessed source -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31362

[Bug c/31362] gcc should not inline functions with 'section' attribute

2007-03-26 Thread thutt at vmware dot com
--- Comment #2 from thutt at vmware dot com 2007-03-26 15:09 --- Created an attachment (id=13289) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13289&action=view) original source -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31362

[Bug c/31362] gcc should not inline functions with 'section' attribute

2007-03-26 Thread thutt at vmware dot com
--- Comment #1 from thutt at vmware dot com 2007-03-26 15:08 --- Created an attachment (id=13288) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13288&action=view) Simple Script which will build the original C source Simple Script which will build the original C source -- http