mirrored from git://gcc.gnu.org/git/gcc.git
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pragma: respect pragma in lambda functions
In g:01ad8c54fdca we started supporting target pragma changes that are primarily caused by optimization option. The same can happen in the opposite way and we need to check for changes both in optimization_current_node and target_option_current_node. PR c++/103696 gcc/ChangeLog: * attribs.c (decl_attributes): Check if target_option_current_node is changed. gcc/testsuite/ChangeLog: * g++.target/i386/pr103696.C: New test.
- Loading branch information
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// PR c++/103696 | ||
// { dg-options "-O2 -std=c++14 -fdump-tree-optimized" } | ||
|
||
int global_var; | ||
|
||
void fn() { | ||
} | ||
|
||
#pragma GCC optimize("finite-math-only") | ||
#pragma GCC target("sse3") | ||
|
||
void fn2() { | ||
} | ||
|
||
void fn3() { | ||
} | ||
|
||
int solve() { | ||
auto nested = []() { | ||
return global_var; | ||
}; | ||
return nested(); | ||
} | ||
|
||
/* { dg-final { scan-tree-dump-not "lambda" "optimized" } } */ |