public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/54988] New: fpmath=sse target pragma causes inlining failure because of target specific option mismatch
@ 2012-10-19 15:36 gcc at blino dot org
2012-10-22 9:15 ` [Bug c++/54988] " rguenth at gcc dot gnu.org
` (13 more replies)
0 siblings, 14 replies; 15+ messages in thread
From: gcc at blino dot org @ 2012-10-19 15:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54988
Bug #: 54988
Summary: fpmath=sse target pragma causes inlining failure
because of target specific option mismatch
Classification: Unclassified
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: gcc@blino.org
CC: loic.yhuel@gmail.com, thiago@kde.org
#pragma GCC target "fpmath=sse"
static inline __attribute__((always_inline)) int a(int x) { return x; }
int b(int src)
{
return a(src);
}
$ gcc -O1 ./qdrawhelper_test.cpp -c
./qdrawhelper_test.cpp: In function 'int b(int)':
./qdrawhelper_test.cpp:3:50: error: inlining failed in call to always_inline
'int a(int)': target specific option mismatch
./qdrawhelper_test.cpp:7:17: error: called from here
I have the patch from bug 33763 applied in this gcc 4.7.2 build, if that
matters.
This bug initially happened when building Qt5 with gcc -m32 on a x86_64 host
(gcc being configured without any --with-arch_32 option), in
qt5/qtbase/src/gui/painting/qdrawhelper.cpp:
In file included from
../../include/QtGui/5.0.0/QtGui/private/qdrawhelper_p.h:1:0,
from
/home/sah0146/dev/workspaces/pc32/stb/opensource/LGPL/qt/vendor/qt.gitorious.org/MAIN/qt5/qtbase/src/gui/painting/qdrawhelper.cpp:54:
../../include/QtGui/5.0.0/QtGui/private/../../../../../../../qt5/qtbase/src/gui/painting/qdrawhelper_p.h:
In function 'int multiply_op(int, int, int, int)':
../../include/QtGui/5.0.0/QtGui/private/../../../../../../../qt5/qtbase/src/gui/painting/qdrawhelper_p.h:797:30:
error: inlining failed in call to always_inline 'int qt_div_255(int)': target
specific option mismatch
/home/sah0146/dev/workspaces/pc32/stb/opensource/LGPL/qt/vendor/qt.gitorious.org/MAIN/qt5/qtbase/src/gui/painting/qdrawhelper.cpp:2498:70:
error: called from here
Bug 41201 might be related, even if it mentions C++ only.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/54988] fpmath=sse target pragma causes inlining failure because of target specific option mismatch
2012-10-19 15:36 [Bug target/54988] New: fpmath=sse target pragma causes inlining failure because of target specific option mismatch gcc at blino dot org
@ 2012-10-22 9:15 ` rguenth at gcc dot gnu.org
2012-10-22 10:54 ` jakub at gcc dot gnu.org
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-10-22 9:15 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54988
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-10-22
Component|target |c++
Ever Confirmed|0 |1
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> 2012-10-22 09:15:19 UTC ---
It's interesting to note that this only fails when using the C++ frontend,
and only when optimizing(!). b does not have target specific optimization
assigned for C++ while a has.
Thus this is a C++ frontend issue.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/54988] fpmath=sse target pragma causes inlining failure because of target specific option mismatch
2012-10-19 15:36 [Bug target/54988] New: fpmath=sse target pragma causes inlining failure because of target specific option mismatch gcc at blino dot org
2012-10-22 9:15 ` [Bug c++/54988] " rguenth at gcc dot gnu.org
@ 2012-10-22 10:54 ` jakub at gcc dot gnu.org
2012-10-22 14:43 ` thiago at kde dot org
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-10-22 10:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54988
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |jakub at gcc dot gnu.org
|gnu.org |
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-10-22 10:54:25 UTC ---
Created attachment 28504
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28504
gcc48-pr54988.patch
Untested fix. Apparently the C++ FE assumes that if attributes is NULL,
decl_attributes does nothing, which isn't true for FUNCTION_DECLs.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/54988] fpmath=sse target pragma causes inlining failure because of target specific option mismatch
2012-10-19 15:36 [Bug target/54988] New: fpmath=sse target pragma causes inlining failure because of target specific option mismatch gcc at blino dot org
2012-10-22 9:15 ` [Bug c++/54988] " rguenth at gcc dot gnu.org
2012-10-22 10:54 ` jakub at gcc dot gnu.org
@ 2012-10-22 14:43 ` thiago at kde dot org
2012-10-23 12:22 ` gcc at blino dot org
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: thiago at kde dot org @ 2012-10-22 14:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54988
--- Comment #3 from Thiago Macieira <thiago at kde dot org> 2012-10-22 14:43:11 UTC ---
This might be as I pointed out in
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54231:
(Node "Function attributes"):
On the 386/x86_64 and PowerPC backends, the inliner will not
inline a function that has different target options than the
caller, unless the callee has a subset of the target options of
the caller. For example a function declared with `target("sse3")'
can inline a function with `target("sse2")', since `-msse3'
implies `-msse2'.
My guess was that we were forcing the inlining (via always_inline) of a
function that has different target options.
But I guess that doesn't explain why it happens only in C++ and only in
optimising mode. Does always_inline inline on -O0 too?
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/54988] fpmath=sse target pragma causes inlining failure because of target specific option mismatch
2012-10-19 15:36 [Bug target/54988] New: fpmath=sse target pragma causes inlining failure because of target specific option mismatch gcc at blino dot org
` (2 preceding siblings ...)
2012-10-22 14:43 ` thiago at kde dot org
@ 2012-10-23 12:22 ` gcc at blino dot org
2012-10-23 16:56 ` jakub at gcc dot gnu.org
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: gcc at blino dot org @ 2012-10-23 12:22 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54988
--- Comment #4 from Olivier Blin <gcc at blino dot org> 2012-10-23 12:21:52 UTC ---
Thanks Jakub, I can confirm that your patch fixes both the small testcase and
the Qt5 qdrawhelper issues (applied on top of gcc 4.7.2)
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/54988] fpmath=sse target pragma causes inlining failure because of target specific option mismatch
2012-10-19 15:36 [Bug target/54988] New: fpmath=sse target pragma causes inlining failure because of target specific option mismatch gcc at blino dot org
` (3 preceding siblings ...)
2012-10-23 12:22 ` gcc at blino dot org
@ 2012-10-23 16:56 ` jakub at gcc dot gnu.org
2012-10-23 17:56 ` jakub at gcc dot gnu.org
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-10-23 16:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54988
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-10-23 16:56:01 UTC ---
Author: jakub
Date: Tue Oct 23 16:55:56 2012
New Revision: 192722
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192722
Log:
PR c++/54988
* decl2.c (cplus_decl_attributes): Don't return early
if attributes is NULL.
* c-c++-common/pr54988.c: New test.
Added:
trunk/gcc/testsuite/c-c++-common/pr54988.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cp/decl2.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/54988] fpmath=sse target pragma causes inlining failure because of target specific option mismatch
2012-10-19 15:36 [Bug target/54988] New: fpmath=sse target pragma causes inlining failure because of target specific option mismatch gcc at blino dot org
` (4 preceding siblings ...)
2012-10-23 16:56 ` jakub at gcc dot gnu.org
@ 2012-10-23 17:56 ` jakub at gcc dot gnu.org
2012-10-24 9:52 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-10-23 17:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54988
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-10-23 17:56:04 UTC ---
Author: jakub
Date: Tue Oct 23 17:55:56 2012
New Revision: 192734
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192734
Log:
PR c++/54988
* decl2.c (cplus_decl_attributes): Don't return early
if attributes is NULL.
* c-c++-common/pr54988.c: New test.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cp/ChangeLog
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/54988] fpmath=sse target pragma causes inlining failure because of target specific option mismatch
2012-10-19 15:36 [Bug target/54988] New: fpmath=sse target pragma causes inlining failure because of target specific option mismatch gcc at blino dot org
` (5 preceding siblings ...)
2012-10-23 17:56 ` jakub at gcc dot gnu.org
@ 2012-10-24 9:52 ` jakub at gcc dot gnu.org
2012-10-30 9:07 ` olegendo at gcc dot gnu.org
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-10-24 9:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54988
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-10-24 09:52:20 UTC ---
Fixed on the trunk so far.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/54988] fpmath=sse target pragma causes inlining failure because of target specific option mismatch
2012-10-19 15:36 [Bug target/54988] New: fpmath=sse target pragma causes inlining failure because of target specific option mismatch gcc at blino dot org
` (6 preceding siblings ...)
2012-10-24 9:52 ` jakub at gcc dot gnu.org
@ 2012-10-30 9:07 ` olegendo at gcc dot gnu.org
2012-10-31 22:09 ` olegendo at gcc dot gnu.org
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-10-30 9:07 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54988
--- Comment #8 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-10-30 09:07:17 UTC ---
Author: olegendo
Date: Tue Oct 30 09:07:08 2012
New Revision: 192982
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192982
Log:
PR target/54988
* config/sh/sh.md (tstqi_t_zero): Rename to *tstqi_t_zero.
(*tst<mode>_t_zero): New insns.
* config/sh/iterators.md (lowpart_be, lowpart_le): New mode attributes.
PR target/54988
* gcc.target/sh/pr53988.c: New.
Added:
trunk/gcc/testsuite/gcc.target/sh/pr53988.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/sh/iterators.md
trunk/gcc/config/sh/sh.md
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/54988] fpmath=sse target pragma causes inlining failure because of target specific option mismatch
2012-10-19 15:36 [Bug target/54988] New: fpmath=sse target pragma causes inlining failure because of target specific option mismatch gcc at blino dot org
` (7 preceding siblings ...)
2012-10-30 9:07 ` olegendo at gcc dot gnu.org
@ 2012-10-31 22:09 ` olegendo at gcc dot gnu.org
2012-11-05 15:07 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-10-31 22:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54988
Oleg Endo <olegendo at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |olegendo at gcc dot gnu.org
--- Comment #9 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-10-31 22:09:10 UTC ---
(In reply to comment #8)
> Author: olegendo
> Date: Tue Oct 30 09:07:08 2012
> New Revision: 192982
>
> URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192982
> Log:
> PR target/54988
> * config/sh/sh.md (tstqi_t_zero): Rename to *tstqi_t_zero.
> (*tst<mode>_t_zero): New insns.
> * config/sh/iterators.md (lowpart_be, lowpart_le): New mode attributes.
>
> PR target/54988
> * gcc.target/sh/pr53988.c: New.
>
>
> Added:
> trunk/gcc/testsuite/gcc.target/sh/pr53988.c
> Modified:
> trunk/gcc/ChangeLog
> trunk/gcc/config/sh/iterators.md
> trunk/gcc/config/sh/sh.md
> trunk/gcc/testsuite/ChangeLog
Sorry for the typo in the PR number of the ChangeLog. ChangeLog fixed, commit
message posted to PR 53988.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/54988] fpmath=sse target pragma causes inlining failure because of target specific option mismatch
2012-10-19 15:36 [Bug target/54988] New: fpmath=sse target pragma causes inlining failure because of target specific option mismatch gcc at blino dot org
` (8 preceding siblings ...)
2012-10-31 22:09 ` olegendo at gcc dot gnu.org
@ 2012-11-05 15:07 ` jakub at gcc dot gnu.org
2013-01-15 8:41 ` net147 at gmail dot com
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-05 15:07 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54988
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-05 15:07:22 UTC ---
Author: jakub
Date: Mon Nov 5 15:07:14 2012
New Revision: 193165
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193165
Log:
Backported from mainline
2012-10-23 Jakub Jelinek <jakub@redhat.com>
PR c++/54988
* decl2.c (cplus_decl_attributes): Don't return early
if attributes is NULL.
* c-c++-common/pr54988.c: New test.
Added:
branches/gcc-4_7-branch/gcc/testsuite/c-c++-common/pr54988.c
Modified:
branches/gcc-4_7-branch/gcc/cp/ChangeLog
branches/gcc-4_7-branch/gcc/cp/decl2.c
branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/54988] fpmath=sse target pragma causes inlining failure because of target specific option mismatch
2012-10-19 15:36 [Bug target/54988] New: fpmath=sse target pragma causes inlining failure because of target specific option mismatch gcc at blino dot org
` (9 preceding siblings ...)
2012-11-05 15:07 ` jakub at gcc dot gnu.org
@ 2013-01-15 8:41 ` net147 at gmail dot com
2013-01-15 8:53 ` alexpux at gmail dot com
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: net147 at gmail dot com @ 2013-01-15 8:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54988
Jonathan Liu <net147 at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |net147 at gmail dot com
--- Comment #11 from Jonathan Liu <net147 at gmail dot com> 2013-01-15 08:40:55 UTC ---
#pragma GCC optimize "O2"
#include <mshtmlc.h> // big header that's part of MinGW-builds
C:\gcc_oom>g++ -c -o release\test.o test.cpp
cc1plus.exe: out of memory allocating 177249 bytes
The patch is causing out of memory error on Windows with MinGW-builds GCC 4.7.2
32-bit
(http://download.sourceforge.net/project/mingwbuilds/host-windows/releases/4.7.2/32-bit/threads-posix/sjlj/x32-4.7.2-release-posix-sjlj-rev7.7z).
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/54988] fpmath=sse target pragma causes inlining failure because of target specific option mismatch
2012-10-19 15:36 [Bug target/54988] New: fpmath=sse target pragma causes inlining failure because of target specific option mismatch gcc at blino dot org
` (10 preceding siblings ...)
2013-01-15 8:41 ` net147 at gmail dot com
@ 2013-01-15 8:53 ` alexpux at gmail dot com
2013-03-27 9:12 ` kai.koehne at digia dot com
2021-08-11 21:16 ` pinskia at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: alexpux at gmail dot com @ 2013-01-15 8:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54988
Alexey Pavlov <alexpux at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |alexpux at gmail dot com
--- Comment #12 from Alexey Pavlov <alexpux at gmail dot com> 2013-01-15 08:53:25 UTC ---
Confirm the issue with allocation memory for rev.195125 of gcc-4_7 from branch
too
(http://sourceforge.net/projects/mingwbuilds/files/host-windows/testing/4.7.3/32-bit/threads-posix/sjlj/x32-4.7.3-prerelease-20130114-rev195125-posix-sjlj.7z)
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/54988] fpmath=sse target pragma causes inlining failure because of target specific option mismatch
2012-10-19 15:36 [Bug target/54988] New: fpmath=sse target pragma causes inlining failure because of target specific option mismatch gcc at blino dot org
` (11 preceding siblings ...)
2013-01-15 8:53 ` alexpux at gmail dot com
@ 2013-03-27 9:12 ` kai.koehne at digia dot com
2021-08-11 21:16 ` pinskia at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: kai.koehne at digia dot com @ 2013-03-27 9:12 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54988
--- Comment #13 from Kai Koehne <kai.koehne at digia dot com> 2013-03-27 09:12:42 UTC ---
The OOM problem is still there with gcc 4.8.0 on MinGW: Any #pragma optimize
"X" will result in OOM for big files.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/54988] fpmath=sse target pragma causes inlining failure because of target specific option mismatch
2012-10-19 15:36 [Bug target/54988] New: fpmath=sse target pragma causes inlining failure because of target specific option mismatch gcc at blino dot org
` (12 preceding siblings ...)
2013-03-27 9:12 ` kai.koehne at digia dot com
@ 2021-08-11 21:16 ` pinskia at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-11 21:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54988
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.7.2
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #14 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Kai Koehne from comment #13)
> The OOM problem is still there with gcc 4.8.0 on MinGW: Any #pragma optimize
> "X" will result in OOM for big files.
Can you report that as a seperate bug? With the preprocessed source and an
updated compiler?
The original reported issue has been fixed.
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2021-08-11 21:16 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-19 15:36 [Bug target/54988] New: fpmath=sse target pragma causes inlining failure because of target specific option mismatch gcc at blino dot org
2012-10-22 9:15 ` [Bug c++/54988] " rguenth at gcc dot gnu.org
2012-10-22 10:54 ` jakub at gcc dot gnu.org
2012-10-22 14:43 ` thiago at kde dot org
2012-10-23 12:22 ` gcc at blino dot org
2012-10-23 16:56 ` jakub at gcc dot gnu.org
2012-10-23 17:56 ` jakub at gcc dot gnu.org
2012-10-24 9:52 ` jakub at gcc dot gnu.org
2012-10-30 9:07 ` olegendo at gcc dot gnu.org
2012-10-31 22:09 ` olegendo at gcc dot gnu.org
2012-11-05 15:07 ` jakub at gcc dot gnu.org
2013-01-15 8:41 ` net147 at gmail dot com
2013-01-15 8:53 ` alexpux at gmail dot com
2013-03-27 9:12 ` kai.koehne at digia dot com
2021-08-11 21:16 ` pinskia at gcc dot gnu.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).